Class ReplicationSyncUp
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.hadoop.hbase.replication.regionserver.ReplicationSyncUp
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable
,org.apache.hadoop.util.Tool
@Private
public class ReplicationSyncUp
extends org.apache.hadoop.conf.Configured
implements org.apache.hadoop.util.Tool
In a scenario of Replication based Disaster/Recovery, when hbase Master-Cluster crashes, this
tool is used to sync-up the delta from Master to Slave using the info from ZooKeeper. The tool
will run on Master-Cluster, and assume ZK, Filesystem and NetWork still available after hbase
crashes
hbase org.apache.hadoop.hbase.replication.regionserver.ReplicationSyncUp
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static final class
static class
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
addMissingReplicationQueues
(ReplicationQueueStorage storage, Set<ServerName> regionServers, Set<String> peerIds) private void
addMissingReplicationQueues
(ReplicationQueueStorage storage, ServerName regionServer, Set<String> peerIds) private void
claimReplicationQueues
(ReplicationSourceManager mgr, Set<ServerName> regionServers) private Set<ServerName>
listRegionServers
(org.apache.hadoop.fs.FileSystem walFs, org.apache.hadoop.fs.Path walDir) static void
Main programprivate static boolean
private static void
printUsage
(String message) private static void
printUsageAndExit
(String message, int exitCode) int
private void
writeInfoFile
(org.apache.hadoop.fs.FileSystem fs, boolean isForce) 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
-
INFO_DIR
- See Also:
-
INFO_FILE
- See Also:
-
SLEEP_TIME
- See Also:
-
-
Constructor Details
-
ReplicationSyncUp
public ReplicationSyncUp()
-
-
Method Details
-
main
Main program- Throws:
Exception
-
listRegionServers
private Set<ServerName> listRegionServers(org.apache.hadoop.fs.FileSystem walFs, org.apache.hadoop.fs.Path walDir) throws IOException - Throws:
IOException
-
addMissingReplicationQueues
private void addMissingReplicationQueues(ReplicationQueueStorage storage, ServerName regionServer, Set<String> peerIds) throws ReplicationException - Throws:
ReplicationException
-
addMissingReplicationQueues
private void addMissingReplicationQueues(ReplicationQueueStorage storage, Set<ServerName> regionServers, Set<String> peerIds) throws ReplicationException - Throws:
ReplicationException
-
claimReplicationQueues
private void claimReplicationQueues(ReplicationSourceManager mgr, Set<ServerName> regionServers) throws ReplicationException, org.apache.zookeeper.KeeperException, IOException - Throws:
ReplicationException
org.apache.zookeeper.KeeperException
IOException
-
writeInfoFile
- Throws:
IOException
-
parseOpts
-
printUsageAndExit
-
printUsage
-
run
- Specified by:
run
in interfaceorg.apache.hadoop.util.Tool
- Throws:
Exception
-