View Javadoc

1   /**
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *     http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  package org.apache.hadoop.hbase.client;
19  
20  import org.apache.commons.logging.Log;
21  import org.apache.commons.logging.LogFactory;
22  import org.apache.hadoop.conf.Configuration;
23  import org.apache.hadoop.hbase.mob.MobConstants;
24  import org.apache.hadoop.hbase.snapshot.MobSnapshotTestingUtils;
25  import org.apache.hadoop.hbase.testclassification.LargeTests;
26  import org.junit.BeforeClass;
27  import org.junit.experimental.categories.Category;
28  
29  
30  /**
31   * Test create/using/deleting snapshots from the client
32   * <p>
33   * This is an end-to-end test for the snapshot utility
34   */
35  @Category({LargeTests.class})
36  public class TestMobSnapshotFromClient extends TestSnapshotFromClient {
37    private static final Log LOG = LogFactory.getLog(TestMobSnapshotFromClient.class);
38  
39    /**
40     * Setup the config for the cluster
41     * @throws Exception on failure
42     */
43    @BeforeClass
44    public static void setupCluster() throws Exception {
45      setupConf(UTIL.getConfiguration());
46      UTIL.startMiniCluster(NUM_RS);
47    }
48  
49    protected static void setupConf(Configuration conf) {
50      TestSnapshotFromClient.setupConf(conf);
51      conf.setInt(MobConstants.MOB_FILE_CACHE_SIZE_KEY, 0);
52    }
53  
54    @Override
55    protected void createTable() throws Exception {
56      MobSnapshotTestingUtils.createMobTable(UTIL, TABLE_NAME, getNumReplicas(), TEST_FAM);
57    }
58  }