com.sleepycat.je.rep.stream
Class ReplicaFeederSyncup

java.lang.Object
  extended by com.sleepycat.je.rep.stream.ReplicaFeederSyncup

public class ReplicaFeederSyncup
extends Object

Establish where the replication stream should start for a replica and feeder pair. The replica compares what is in its log with what the feeder has, to determine the latest common log entry matchpoint - If the replica has applied log entries after that matchpoint, roll them back - If a common matchpoint can't be found, the replica will need to do a network restore.


Nested Class Summary
static interface ReplicaFeederSyncup.TestHook<T>
          This interface is used instead of com.sleepycat.je.utilint.TestHook because the doHook method needs to throw InterruptedException.
 
Constructor Summary
ReplicaFeederSyncup(RepNode repNode, Replay replay, NamedChannel namedChannel, Protocol protocol, boolean hardRecoveryNeedsElection)
           
 
Method Summary
 void execute(LocalCBVLSNTracker cbvlsnTracker)
          The replica's side of the protocol.
 VLSN getMatchedVLSN()
           
 long getMatchedVLSNTime()
           
static void setGlobalSyncupEndHook(ReplicaFeederSyncup.TestHook<Object> syncupEndHook)
           
 RollbackException setupHardRecovery(VLSNRange range)
          Hard recovery: truncate the files, repeat recovery.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplicaFeederSyncup

public ReplicaFeederSyncup(RepNode repNode,
                           Replay replay,
                           NamedChannel namedChannel,
                           Protocol protocol,
                           boolean hardRecoveryNeedsElection)
Method Detail

getMatchedVLSNTime

public long getMatchedVLSNTime()

getMatchedVLSN

public VLSN getMatchedVLSN()

execute

public void execute(LocalCBVLSNTracker cbvlsnTracker)
             throws IOException,
                    DatabaseException,
                    InterruptedException,
                    InsufficientLogException,
                    Replica.HardRecoveryElectionException
The replica's side of the protocol.

Throws:
InterruptedException
InsufficientLogException
Replica.HardRecoveryElectionException
IOException
DatabaseException

setupHardRecovery

public RollbackException setupHardRecovery(VLSNRange range)
                                    throws IOException
Hard recovery: truncate the files, repeat recovery. If this hard recovery came about before the ReplicatedEnvironment was fully instantiated, we will recreate the environment under the covers. If this came while the replica was up and supporting existing Environment handles, we must invalidate the environment, and ask the application to reopen.

Throws:
IOException

setGlobalSyncupEndHook

public static void setGlobalSyncupEndHook(ReplicaFeederSyncup.TestHook<Object> syncupEndHook)


Copyright (c) 2004-2012 Oracle. All rights reserved.