|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.rep.impl.node.FeederManager
public final class FeederManager
FeedManager is responsible for the creation and management of the Feeders used to respond to connections initiated by a Replica. runfeeders() is the central loop that listens for replica connections and manages the lifecycle of individual Feeders. It's re-entered each time the node becomes a Master and is exited when its status changes. There is a single instance of FeederManager that is created for a replication node. There are many instances of Feeders per FeederManager. Each Feeder instance represents an instance of a connection between the node serving as the feeder and the replica. Note that the FeederManager and the Replica currently reuse the Replication node's thread of control. When we implement r2r we will need to revisit the thread management to provide for concurrent operation of the FeederManger and the Replica.
Field Summary | |
---|---|
static String |
FEEDER_SERVICE
|
(package private) AtomicBoolean |
shutdown
|
Constructor Summary | |
---|---|
FeederManager(RepNode repNode)
|
Method Summary | |
---|---|
(package private) void |
activateFeeder(Feeder feeder)
Transitions a Feeder to being active, so that it can be used in considerations relating to commit acknowledgments. |
int |
activeReplicaCount()
The numbers of Replicas currently "active" with this feeder. |
Set<String> |
activeReplicas()
Returns the set of Replicas that are currently active with this feeder. |
String |
dumpState()
|
void |
ensureReplicasForCommit(MasterTxn txn,
Durability.ReplicaAckPolicy ackPolicy,
int requiredReplicaCount,
int insufficientReplicasTimeout)
Ensures that the required number of replicas are active if the node is currently the master. |
Feeder |
getFeeder(String nodeName)
Returns the Feeder associated with the node, if such a feeder is currently active. |
StatGroup |
getFeederManagerStats(StatsConfig config)
Returns the statistics associated with the FeederManager. |
StatGroup |
getProtocolStats(StatsConfig config)
|
int |
getTestDelayMs()
|
(package private) void |
incStats(StatGroup feederStats)
Accumulates statistics from a terminating feeder. |
Feeder |
putFeeder(String nodeName,
Feeder feeder)
|
(package private) void |
removeFeeder(Feeder feeder)
Remove the feeder from the sets used to track it. |
(package private) RepNode |
repNode()
Returns the RepNode associated with the FeederManager |
void |
resetStats()
|
(package private) void |
runFeeders()
The core feeder listener loop that is run either in a Master node, or in a Replica that is serving as a Feeder to other Replica nodes. |
(package private) void |
setRepNodeShutdownException(RuntimeException rNSE)
|
void |
setTestDelayMs(int testDelayMs)
|
void |
shutdownFeeder(RepNodeImpl node)
Shuts down a specific feeder. |
(package private) void |
shutdownQueue()
Clears and shuts down the runFeeders by inserting a special EOF marker value into the queue. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
AtomicBoolean shutdown
public static final String FEEDER_SERVICE
Constructor Detail |
---|
FeederManager(RepNode repNode)
Method Detail |
---|
public StatGroup getFeederManagerStats(StatsConfig config)
public StatGroup getProtocolStats(StatsConfig config)
public void resetStats()
void incStats(StatGroup feederStats)
stats
- public int getTestDelayMs()
public void setTestDelayMs(int testDelayMs)
RepNode repNode()
public Feeder getFeeder(String nodeName)
public Feeder putFeeder(String nodeName, Feeder feeder)
void setRepNodeShutdownException(RuntimeException rNSE)
public int activeReplicaCount()
public Set<String> activeReplicas()
void activateFeeder(Feeder feeder) throws InterruptedException
feeder
- the feeder being transitioned.
DuplicateReplicaException
- if the Feeder is already active.
InterruptedException
void removeFeeder(Feeder feeder)
feeder
- void shutdownQueue()
void runFeeders() throws DatabaseException
DatabaseException
public void shutdownFeeder(RepNodeImpl node)
public void ensureReplicasForCommit(MasterTxn txn, Durability.ReplicaAckPolicy ackPolicy, int requiredReplicaCount, int insufficientReplicasTimeout) throws InterruptedException, DatabaseException
requiredReplicaCount
- the total nodes required by the transactioninsufficientReplicasTimeout
- the amount of time (in ms) that the
Feeder will wait for the requiredReplicaCount
InterruptedException
DatabaseException
- if the wait timed out.public String dumpState()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |