public class Replica
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
Replica.ConnectRetryException |
class |
Replica.ConsistencyTracker
Tracks the consistency of this replica wrt the Master.
|
static class |
Replica.HardRecoveryElectionException
Indicates that an election is needed before the hard recovery can
proceed.
|
(package private) class |
Replica.ReplayThread
The thread responsible for the replay of messages delivered over the
replication stream.
|
(package private) static class |
Replica.RetryException
Thrown to indicate that the Replica must retry connecting to the same
master, after some period of time.
|
Constructor and Description |
---|
Replica(RepNode repNode,
Replay replay) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
clearDbTreeCache() |
protected void |
doRunReplicaLoopInternalWork() |
Replica.ConsistencyTracker |
getConsistencyTracker() |
DbCache |
getDbCache() |
long |
getMasterTxnEndVLSN()
Returns the last commit VLSN at the master, as known at the replica.
|
(package private) Protocol |
getProtocol() |
StatGroup |
getProtocolStats(StatsConfig config) |
StatGroup |
getReplayStats(StatsConfig config)
Returns the replay statistics associated with the Replica.
|
(package private) java.nio.channels.SocketChannel |
getReplicaFeederChannel() |
ReplicaFeederSyncup.TestHook<java.lang.Object> |
getReplicaFeederSyncupHook() |
StatGroup |
getTrackerStats(StatsConfig config) |
(package private) void |
masterTransitionCleanup()
Invoked when this node transitions to the master state.
|
Replay |
replay() |
void |
resetStats() |
(package private) void |
runReplicaLoop()
The core control loop when the node is serving as a Replica.
|
void |
setDontProcessStream()
For unit testing only!
|
static void |
setInitialReplayHook(TestHook<BinaryProtocol.Message> hook)
Sets a test hook for installation into Replica class instances to be
created in the future.
|
void |
setReplayHook(TestHook<BinaryProtocol.Message> hook)
Sets a test hook which is executed in the reply loop.
|
void |
setReplicaFeederSyncupHook(ReplicaFeederSyncup.TestHook<java.lang.Object> syncupHook)
Set a test hook which is executed when the ReplicaFeederSyncup
finishes.
|
void |
setTestDelayMs(int testDelayMs)
For unit testing only!
|
void |
shutdown()
Shutdown the Replica, free any threads that may have been waiting for
the replica to reach some degree of consistency.
|
public void shutdown()
public void setTestDelayMs(int testDelayMs)
public void setDontProcessStream()
public Replay replay()
public DbCache getDbCache()
public Replica.ConsistencyTracker getConsistencyTracker()
java.nio.channels.SocketChannel getReplicaFeederChannel()
Protocol getProtocol()
public long getMasterTxnEndVLSN()
void runReplicaLoop() throws java.lang.InterruptedException, DatabaseException, GroupShutdownException
java.lang.InterruptedException
RestoreFailedException
DatabaseException
- if the environment cannot be closed/for a
re-initGroupShutdownException
protected void doRunReplicaLoopInternalWork() throws java.lang.Exception
java.lang.Exception
void clearDbTreeCache()
void masterTransitionCleanup() throws DatabaseException
DatabaseException
public StatGroup getReplayStats(StatsConfig config)
public StatGroup getProtocolStats(StatsConfig config)
public StatGroup getTrackerStats(StatsConfig config)
public void resetStats()
public void setReplayHook(TestHook<BinaryProtocol.Message> hook)
public static void setInitialReplayHook(TestHook<BinaryProtocol.Message> hook)
ReplicatedEnvironment
handle constructor
returns, so that a test may influence the replay of the sync-up
transaction backlog.public void setReplicaFeederSyncupHook(ReplicaFeederSyncup.TestHook<java.lang.Object> syncupHook)
public ReplicaFeederSyncup.TestHook<java.lang.Object> getReplicaFeederSyncupHook()
Copyright (c) 2004-2012 Oracle. All rights reserved.