Class TestSyncTable
java.lang.Object
org.apache.hadoop.hbase.mapreduce.TestSyncTable
Basic test for the SyncTable M/R tool
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final HBaseClassTestRuleprivate static final org.slf4j.Loggerorg.junit.rules.TestNameprivate static final HBaseTestingUtilprivate static final HBaseTestingUtil -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidprivate voidassertCellEquals(org.apache.hadoop.hbase.Cell sourceCell, org.apache.hadoop.hbase.Cell targetCell, BooleanSupplier checkTimestamp) private voidassertEqualTables(int expectedRows, HBaseTestingUtil sourceCluster, org.apache.hadoop.hbase.TableName sourceTableName, HBaseTestingUtil targetCluster, org.apache.hadoop.hbase.TableName targetTableName, boolean ignoreTimestamps) private voidassertTargetDoDeletesFalse(int expectedRows, HBaseTestingUtil sourceCluster, org.apache.hadoop.hbase.TableName sourceTableName, HBaseTestingUtil targetCluster, org.apache.hadoop.hbase.TableName targetTableName) private voidassertTargetDoPutsFalse(int expectedRows, HBaseTestingUtil sourceCluster, org.apache.hadoop.hbase.TableName sourceTableName, HBaseTestingUtil targetCluster, org.apache.hadoop.hbase.TableName targetTableName) static voidprivate static byte[][]generateSplits(int numRows, int numRegions) private voidhashSourceTable(HBaseTestingUtil sourceCluster, org.apache.hadoop.hbase.TableName sourceTableName, org.apache.hadoop.fs.Path testDir, String... options) private org.apache.hadoop.mapreduce.CounterssyncTables(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.TableName sourceTableName, org.apache.hadoop.hbase.TableName targetTableName, org.apache.hadoop.fs.Path testDir, String... options) voidprivate voidtestSyncTable(HBaseTestingUtil source, HBaseTestingUtil target, String... options) voidvoidvoidvoidvoidvoidprivate voidwriteTestData(HBaseTestingUtil sourceCluster, org.apache.hadoop.hbase.TableName sourceTableName, HBaseTestingUtil targetCluster, org.apache.hadoop.hbase.TableName targetTableName, long... timestamps)
-
Field Details
-
CLASS_RULE
-
LOG
-
UTIL1
-
UTIL2
-
name
-
-
Constructor Details
-
TestSyncTable
public TestSyncTable()
-
-
Method Details
-
beforeClass
- Throws:
Exception
-
afterClass
- Throws:
Exception
-
generateSplits
-
testSyncTable
private void testSyncTable(HBaseTestingUtil source, HBaseTestingUtil target, String... options) throws Exception - Throws:
Exception
-
testSyncTable
- Throws:
Exception
-
testSyncTableToPeerCluster
- Throws:
Exception
-
testSyncTableFromSourceToPeerCluster
- Throws:
Exception
-
testSyncTableFromSourceToPeerClusterWithClusterKey
- Throws:
Exception
-
testSyncTableDoDeletesFalse
- Throws:
Exception
-
testSyncTableDoPutsFalse
- Throws:
Exception
-
testSyncTableIgnoreTimestampsTrue
- Throws:
Exception
-
assertCellEquals
private void assertCellEquals(org.apache.hadoop.hbase.Cell sourceCell, org.apache.hadoop.hbase.Cell targetCell, BooleanSupplier checkTimestamp) -
assertEqualTables
private void assertEqualTables(int expectedRows, HBaseTestingUtil sourceCluster, org.apache.hadoop.hbase.TableName sourceTableName, HBaseTestingUtil targetCluster, org.apache.hadoop.hbase.TableName targetTableName, boolean ignoreTimestamps) throws Exception - Throws:
Exception
-
assertTargetDoDeletesFalse
private void assertTargetDoDeletesFalse(int expectedRows, HBaseTestingUtil sourceCluster, org.apache.hadoop.hbase.TableName sourceTableName, HBaseTestingUtil targetCluster, org.apache.hadoop.hbase.TableName targetTableName) throws Exception - Throws:
Exception
-
assertTargetDoPutsFalse
private void assertTargetDoPutsFalse(int expectedRows, HBaseTestingUtil sourceCluster, org.apache.hadoop.hbase.TableName sourceTableName, HBaseTestingUtil targetCluster, org.apache.hadoop.hbase.TableName targetTableName) throws Exception - Throws:
Exception
-
syncTables
private org.apache.hadoop.mapreduce.Counters syncTables(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.TableName sourceTableName, org.apache.hadoop.hbase.TableName targetTableName, org.apache.hadoop.fs.Path testDir, String... options) throws Exception - Throws:
Exception
-
hashSourceTable
private void hashSourceTable(HBaseTestingUtil sourceCluster, org.apache.hadoop.hbase.TableName sourceTableName, org.apache.hadoop.fs.Path testDir, String... options) throws Exception - Throws:
Exception
-
writeTestData
private void writeTestData(HBaseTestingUtil sourceCluster, org.apache.hadoop.hbase.TableName sourceTableName, HBaseTestingUtil targetCluster, org.apache.hadoop.hbase.TableName targetTableName, long... timestamps) throws Exception - Throws:
Exception
-