com.sleepycat.je.rep.utilint
Class DbSync

java.lang.Object
  extended by 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.


Field Summary
static String DBSYNC_ENV
           
static String DBSYNC_GROUP_NAME
           
static String DBSYNC_HELPER_HOST
           
static String DBSYNC_NODE_HOST
           
static String DBSYNC_NODE_NAME
           
static String DBSYNC_TIMEOUT
           
 
Constructor Summary
DbSync(String envHome, String groupName, String nodeName, String nodeHost, String helperHost, long timeout)
          Create a DbSync object for the purposed of syncing up a specific replication group.
 
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
 

Field Detail

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
Constructor Detail

DbSync

public DbSync(String envHome,
              String groupName,
              String nodeName,
              String nodeHost,
              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.
groupName - The replication group name that replicas would join in.
nodeName - The name of this replica.
nodeHost - The host name and port for this replica.
helperHost - The helper host for this replica.
timeout - The permitted time period, in milliseconds, for the replica to catch up with master.
Method Detail

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-2010 Oracle. All rights reserved.