1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.hadoop.hbase.snapshot;
19
20 import java.io.IOException;
21
22 import org.apache.commons.logging.Log;
23 import org.apache.commons.logging.LogFactory;
24 import org.apache.hadoop.conf.Configuration;
25 import org.apache.hadoop.hbase.HBaseTestingUtility;
26 import org.apache.hadoop.hbase.TableName;
27 import org.apache.hadoop.hbase.client.Table;
28 import org.apache.hadoop.hbase.mob.MobConstants;
29 import org.apache.hadoop.hbase.testclassification.LargeTests;
30 import org.junit.BeforeClass;
31 import org.junit.experimental.categories.Category;
32
33
34
35
36
37
38
39 @Category({LargeTests.class})
40 public class TestMobRestoreFlushSnapshotFromClient extends TestRestoreFlushSnapshotFromClient {
41 final Log LOG = LogFactory.getLog(getClass());
42
43 @BeforeClass
44 public static void setupCluster() throws Exception {
45 setupConf(UTIL.getConfiguration());
46 UTIL.startMiniCluster(3);
47 }
48
49 protected static void setupConf(Configuration conf) {
50 TestRestoreFlushSnapshotFromClient.setupConf(conf);
51 UTIL.getConfiguration().setInt(MobConstants.MOB_FILE_CACHE_SIZE_KEY, 0);
52 }
53
54 @Override
55 protected void createTable() throws Exception {
56 MobSnapshotTestingUtils.createMobTable(UTIL, tableName, 1, FAMILY);
57 }
58
59 @Override
60 protected void verifyRowCount(final HBaseTestingUtility util, final TableName tableName,
61 long expectedRows) throws IOException {
62 MobSnapshotTestingUtils.verifyMobRowCount(util, tableName, expectedRows);
63 }
64
65 @Override
66 protected int countRows(final Table table, final byte[]... families) throws IOException {
67 return MobSnapshotTestingUtils.countMobRows(table, families);
68 }
69 }