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
Nested ClassesModifier and TypeClassDescriptionstatic classMap-only comparator for 2 tables -
Field Summary
FieldsModifier and TypeFieldDescription(package private) int(package private) String(package private) long(package private) String(package private) booleanprivate static final Stringprivate static final org.slf4j.Loggerstatic final Stringprivate 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) intprivate 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate org.apache.hadoop.conf.ConfigurationapplyURIConf(org.apache.hadoop.conf.Configuration conf, URI uri) private static ThreadPoolExecutorbuildReCompareExecutor(int maxThreads, org.apache.hadoop.mapreduce.Mapper.Context context) private static ThreadPoolExecutor.CallerRunsPolicybuildRejectedReComparePolicy(org.apache.hadoop.mapreduce.Mapper.Context context) org.apache.hadoop.mapreduce.JobcreateSubmittableJob(org.apache.hadoop.conf.Configuration conf, String[] args) Sets up the actual job.booleandoCommandLine(String[] args) private static Pair<ReplicationPeerConfig,org.apache.hadoop.conf.Configuration> getPeerQuorumConfig(org.apache.hadoop.conf.Configuration conf, String peerId) protected static byte[]private booleanstatic voidMain entry point.private static voidprintUsage(String errorMsg) private voidrestoreSnapshotForPeerCluster(org.apache.hadoop.conf.Configuration conf, String peerQuorumAddress) intprivate static voidsetRowPrefixFilter(Scan scan, String rowPrefixes) private static voidsetStartAndStopRows(Scan scan, byte[] startPrefixRow, byte[] lastPrefixRow) Methods inherited from class org.apache.hadoop.conf.Configured
getConf, setConfMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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
-
applyURIConf
private org.apache.hadoop.conf.Configuration applyURIConf(org.apache.hadoop.conf.Configuration conf, URI uri) -
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:
runin interfaceorg.apache.hadoop.util.Tool- Throws:
Exception
-
main
Main entry point.- Parameters:
args- The command line parameters.- Throws:
Exception- When running the job fails.
-