Class TestSyncTable
java.lang.Object
org.apache.hadoop.hbase.mapreduce.TestSyncTable
Basic test for the SyncTable M/R tool
-
Field Summary
Modifier and TypeFieldDescriptionstatic final HBaseClassTestRule
private static final org.slf4j.Logger
org.junit.rules.TestName
private static final HBaseTestingUtil
private static final HBaseTestingUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
private void
assertCellEquals
(org.apache.hadoop.hbase.Cell sourceCell, org.apache.hadoop.hbase.Cell targetCell, BooleanSupplier checkTimestamp) private void
assertEqualTables
(int expectedRows, HBaseTestingUtil sourceCluster, org.apache.hadoop.hbase.TableName sourceTableName, HBaseTestingUtil targetCluster, org.apache.hadoop.hbase.TableName targetTableName, boolean ignoreTimestamps) private void
assertTargetDoDeletesFalse
(int expectedRows, HBaseTestingUtil sourceCluster, org.apache.hadoop.hbase.TableName sourceTableName, HBaseTestingUtil targetCluster, org.apache.hadoop.hbase.TableName targetTableName) private void
assertTargetDoPutsFalse
(int expectedRows, HBaseTestingUtil sourceCluster, org.apache.hadoop.hbase.TableName sourceTableName, HBaseTestingUtil targetCluster, org.apache.hadoop.hbase.TableName targetTableName) static void
private static byte[][]
generateSplits
(int numRows, int numRegions) private void
hashSourceTable
(HBaseTestingUtil sourceCluster, org.apache.hadoop.hbase.TableName sourceTableName, org.apache.hadoop.fs.Path testDir, String... options) 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) void
private void
testSyncTable
(HBaseTestingUtil source, HBaseTestingUtil target, String... options) void
void
void
void
void
void
private void
writeTestData
(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
-