Class VerifyReplication
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.hadoop.hbase.mapreduce.replication.VerifyReplication
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable
,org.apache.hadoop.util.Tool
@Private
public class VerifyReplication
extends org.apache.hadoop.conf.Configured
implements org.apache.hadoop.util.Tool
This map-only job compares the data from a local table with a remote one. Every cell is compared
and must have exactly the same keys (even timestamp) as well as same value. It is possible to
restrict the job by time range and families. The peer id that's provided must match the one given
when the replication stream was setup.
Two counters are provided, Verifier.Counters.GOODROWS and BADROWS. The reason for a why a row is different is shown in the map's log.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Map-only comparator for 2 tables -
Field Summary
Modifier and TypeFieldDescription(package private) int
(package private) String
(package private) long
(package private) String
(package private) boolean
private static final String
private static final org.slf4j.Logger
static final String
private static final String
(package private) String
(package private) String
(package private) String
(package private) String
(package private) String
(package private) String
(package private) String
(package private) int
private static ThreadPoolExecutor
(package private) int
(package private) int
(package private) String
(package private) int
(package private) String
(package private) String
(package private) long
(package private) String
(package private) boolean
(package private) int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate static ThreadPoolExecutor
buildReCompareExecutor
(int maxThreads, org.apache.hadoop.mapreduce.Mapper.Context context) private static ThreadPoolExecutor.CallerRunsPolicy
buildRejectedReComparePolicy
(org.apache.hadoop.mapreduce.Mapper.Context context) org.apache.hadoop.mapreduce.Job
createSubmittableJob
(org.apache.hadoop.conf.Configuration conf, String[] args) Sets up the actual job.boolean
doCommandLine
(String[] args) private static Pair<ReplicationPeerConfig,
org.apache.hadoop.conf.Configuration> getPeerQuorumConfig
(org.apache.hadoop.conf.Configuration conf, String peerId) protected static byte[]
private boolean
static void
Main entry point.private static void
printUsage
(String errorMsg) private void
restoreSnapshotForPeerCluster
(org.apache.hadoop.conf.Configuration conf, String peerQuorumAddress) int
private static void
setRowPrefixFilter
(Scan scan, String rowPrefixes) private static void
setStartAndStopRows
(Scan scan, byte[] startPrefixRow, byte[] lastPrefixRow) Methods inherited from class org.apache.hadoop.conf.Configured
getConf, setConf
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.hadoop.conf.Configurable
getConf, setConf
-
Field Details
-
LOG
-
NAME
- See Also:
-
PEER_CONFIG_PREFIX
- See Also:
-
reCompareExecutor
-
reCompareTries
int reCompareTries -
reCompareBackoffExponent
-
reCompareThreads
int reCompareThreads -
sleepMsBeforeReCompare
-
startTime
long startTime -
endTime
long endTime -
batch
int batch -
versions
int versions -
tableName
-
families
-
delimiter
-
peerId
-
peerQuorumAddress
-
rowPrefixes
-
verbose
boolean verbose -
includeDeletedCells
boolean includeDeletedCells -
sourceSnapshotName
-
sourceSnapshotTmpDir
-
peerSnapshotName
-
peerSnapshotTmpDir
-
peerFSAddress
-
peerHBaseRootAddress
-
peerTableName
-
JOB_NAME_CONF_KEY
- See Also:
-
-
Constructor Details
-
VerifyReplication
public VerifyReplication()
-
-
Method Details
-
getPeerQuorumConfig
private static Pair<ReplicationPeerConfig,org.apache.hadoop.conf.Configuration> getPeerQuorumConfig(org.apache.hadoop.conf.Configuration conf, String peerId) throws IOException - Throws:
IOException
-
restoreSnapshotForPeerCluster
private void restoreSnapshotForPeerCluster(org.apache.hadoop.conf.Configuration conf, String peerQuorumAddress) throws IOException - Throws:
IOException
-
createSubmittableJob
public org.apache.hadoop.mapreduce.Job createSubmittableJob(org.apache.hadoop.conf.Configuration conf, String[] args) throws IOException Sets up the actual job.- Parameters:
conf
- The current configuration.args
- The command line parameters.- Returns:
- The newly created job.
- Throws:
IOException
- When setting up the job fails.
-
getRow
-
setRowPrefixFilter
-
setStartAndStopRows
-
doCommandLine
-
isPeerQuorumAddress
-
printUsage
-
buildReCompareExecutor
private static ThreadPoolExecutor buildReCompareExecutor(int maxThreads, org.apache.hadoop.mapreduce.Mapper.Context context) -
buildRejectedReComparePolicy
private static ThreadPoolExecutor.CallerRunsPolicy buildRejectedReComparePolicy(org.apache.hadoop.mapreduce.Mapper.Context context) -
run
- Specified by:
run
in interfaceorg.apache.hadoop.util.Tool
- Throws:
Exception
-
main
Main entry point.- Parameters:
args
- The command line parameters.- Throws:
Exception
- When running the job fails.
-