com.sleepycat.je.rep.utilint
Class DbSync
java.lang.Object
com.sleepycat.je.rep.utilint.DbSync
public class DbSync
- extends Object
DbSync is a utility for ensuring that a group of replication nodes have
fully caught up on the replication stream. The target use case is
testing. If a replication group has crashed abruptly, nodes may have closed
without finishing the full replay of the replication stream and the
environments might not have the same contents. This makes it impossible to
compare the contents of the environments for correctness.
DbSync assumes that all nodes are down. The utility is invoked for each node
in the group. The node will come up and rejoin the group, causing the whole
group to reach the same point in the replication stream. If the node becomes
the master, it will issue a shutdown request. Otherwise, a node is a
replica, and will wait for the shutdown message to come, and will then
close.
Method Summary |
static void |
main(String[] args)
|
void |
sync()
Open this replication node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DBSYNC_ENV
public static final String DBSYNC_ENV
- See Also:
- Constant Field Values
DBSYNC_GROUP_NAME
public static final String DBSYNC_GROUP_NAME
- See Also:
- Constant Field Values
DBSYNC_NODE_NAME
public static final String DBSYNC_NODE_NAME
- See Also:
- Constant Field Values
DBSYNC_NODE_HOST
public static final String DBSYNC_NODE_HOST
- See Also:
- Constant Field Values
DBSYNC_HELPER_HOST
public static final String DBSYNC_HELPER_HOST
- See Also:
- Constant Field Values
DBSYNC_TIMEOUT
public static final String DBSYNC_TIMEOUT
- See Also:
- Constant Field Values
DbSync
public DbSync(String envHome,
EnvironmentConfig envConfig,
ReplicationConfig repConfig,
String helperHost,
long timeout)
- Create a DbSync object for the purposed of syncing up a specific
replication group.
- Parameters:
envHome
- The Environment home directories of this replica.helperHost
- The helper host for this replica.timeout
- The permitted time period, in milliseconds, for the
replica to catch up with master.
main
public static void main(String[] args)
throws Exception
- Throws:
Exception
sync
public void sync()
throws Exception
- Open this replication node. Block until the node has opened, synced up,
and closed.
- Throws:
Exception
Copyright (c) 2004-2012 Oracle. All rights reserved.