NodeIDType
- public class PaxosReplicaCoordinator<NodeIDType> extends AbstractReplicaCoordinator<NodeIDType>
Modifier and Type | Field and Description |
---|---|
protected static java.util.logging.Logger |
log |
app, messenger
Constructor and Description |
---|
PaxosReplicaCoordinator(Replicable app,
NodeIDType myID,
Stringifiable<NodeIDType> unstringer,
Messenger<NodeIDType,?> niot) |
PaxosReplicaCoordinator(Replicable app,
NodeIDType myID,
Stringifiable<NodeIDType> unstringer,
Messenger<NodeIDType,?> niot,
int outOfOrderLimit) |
Modifier and Type | Method and Description |
---|---|
boolean |
coordinateRequest(Request request,
ExecutedCallback callback)
Start of abstract methods
|
boolean |
coordinateRequest(java.lang.String paxosGroupID,
Request request,
ExecutedCallback callback) |
boolean |
createReplicaGroup(java.util.Map<java.lang.String,java.lang.String> nameStates,
java.util.Set<NodeIDType> nodes)
Default implementation that can be overridden for more batching
optimization.
|
boolean |
createReplicaGroup(java.lang.String groupName,
int epoch,
java.lang.String state,
java.util.Set<NodeIDType> nodes)
This method should return true if the replica group is successfully
created or one already exists with the same set of nodes.
|
boolean |
deleteFinalState(java.lang.String name,
int epoch)
Garbage-collects the final state for name, epoch.
|
boolean |
deleteReplicaGroup(java.lang.String serviceName,
int epoch)
This method should result in all state corresponding to serviceName being
deleted
|
boolean |
existsOrHigher(java.lang.String name,
int epoch) |
protected void |
forceCheckpoint(java.lang.String paxosID) |
java.lang.Integer |
getEpoch(java.lang.String name)
Returns the current (unique) epoch for name.
|
java.lang.String |
getFinalState(java.lang.String name,
int epoch)
Return the final checkpointed state for name, epoch.
|
protected StringContainer |
getFinalStateContainer(java.lang.String name,
int epoch)
Used by ActiveReplica and similar to getFinalState but wraps it in a
container so that we can distinguish between null final state (a possibly
legitimate value of the state) and no state at all (because the paxos
group has moved on and deleted the state or never created it in the first
place.
|
java.util.Set<NodeIDType> |
getReplicaGroup(java.lang.String serviceName)
This method must return the replica group that was most recently
successfully created for the serviceName using createReplicaGroup.
|
java.util.Set<IntegerPacketType> |
getRequestTypes() |
ReconfigurableRequest |
getStopRequest(java.lang.String name,
int epoch)
Returns a stop request that when executed by the app ensures that no
subsequent request after the stop is executed in that epoch.
|
void |
putInitialState(java.lang.String name,
int epoch,
java.lang.String state)
Inserts the specified state as the initial state for name, epoch.
|
java.util.Set<NodeIDType> |
removeDead(java.util.Set<NodeIDType> nodes) |
protected PaxosReplicaCoordinator<NodeIDType> |
setOutOfOrderLimit(int limit) |
void |
stop()
End of private helper methods
|
boolean |
stopFailureMonitoring(NodeIDType node) |
java.lang.String |
toString() |
callCallback, checkpoint, execute, execute, execute, getAppRequestTypes, getARARNodesAsString, getARRCNodesAsString, getCallback, getCoordinatorRequestTypes, getMessenger, getMutualAuthAppRequestTypes, getMyID, getRequest, getRequest, getRequest, handleIncoming, hasLargeCheckpoints, registerCoordination, restore, sendAllLazy, setCallback, setLargeCheckpoints, setMessenger, setStopCallback
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getMutualAuthRequestTypes, getServerAuthRequestTypes
public PaxosReplicaCoordinator(Replicable app, NodeIDType myID, Stringifiable<NodeIDType> unstringer, Messenger<NodeIDType,?> niot)
app
- myID
- unstringer
- niot
- public PaxosReplicaCoordinator(Replicable app, NodeIDType myID, Stringifiable<NodeIDType> unstringer, Messenger<NodeIDType,?> niot, int outOfOrderLimit)
app
- myID
- unstringer
- niot
- outOfOrderLimit
- protected PaxosReplicaCoordinator<NodeIDType> setOutOfOrderLimit(int limit)
public java.util.Set<IntegerPacketType> getRequestTypes()
public boolean coordinateRequest(Request request, ExecutedCallback callback) throws java.io.IOException, RequestParseException
AbstractReplicaCoordinator
coordinateRequest
in interface ReplicaCoordinator<NodeIDType>
coordinateRequest
in class AbstractReplicaCoordinator<NodeIDType>
java.io.IOException
RequestParseException
public boolean coordinateRequest(java.lang.String paxosGroupID, Request request, ExecutedCallback callback) throws RequestParseException
paxosGroupID
- request
- callback
- RequestParseException
public boolean createReplicaGroup(java.lang.String groupName, int epoch, java.lang.String state, java.util.Set<NodeIDType> nodes)
ReplicaCoordinator
createReplicaGroup
in interface ReplicaCoordinator<NodeIDType>
createReplicaGroup
in class AbstractReplicaCoordinator<NodeIDType>
public boolean createReplicaGroup(java.util.Map<java.lang.String,java.lang.String> nameStates, java.util.Set<NodeIDType> nodes)
AbstractReplicaCoordinator
createReplicaGroup
in class AbstractReplicaCoordinator<NodeIDType>
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.Set<NodeIDType> getReplicaGroup(java.lang.String serviceName)
ReplicaCoordinator
getReplicaGroup
in interface ReplicaCoordinator<NodeIDType>
getReplicaGroup
in class AbstractReplicaCoordinator<NodeIDType>
serviceName
.public boolean deleteReplicaGroup(java.lang.String serviceName, int epoch)
ReplicaCoordinator
deleteReplicaGroup
in interface ReplicaCoordinator<NodeIDType>
deleteReplicaGroup
in class AbstractReplicaCoordinator<NodeIDType>
protected void forceCheckpoint(java.lang.String paxosID)
public java.lang.Integer getEpoch(java.lang.String name)
Reconfigurable
getEpoch
in interface Reconfigurable
getEpoch
in class AbstractReplicaCoordinator<NodeIDType>
name
.public java.lang.String getFinalState(java.lang.String name, int epoch)
Reconfigurable
getFinalState
in interface Reconfigurable
getFinalState
in class AbstractReplicaCoordinator<NodeIDType>
protected StringContainer getFinalStateContainer(java.lang.String name, int epoch)
name
- epoch
- public void putInitialState(java.lang.String name, int epoch, java.lang.String state)
Reconfigurable
putInitialState
in interface Reconfigurable
putInitialState
in class AbstractReplicaCoordinator<NodeIDType>
public boolean deleteFinalState(java.lang.String name, int epoch)
Reconfigurable
deleteFinalState
in interface Reconfigurable
deleteFinalState
in class AbstractReplicaCoordinator<NodeIDType>
name:epoch
was deleted or did not
exist to begin with.public ReconfigurableRequest getStopRequest(java.lang.String name, int epoch)
Reconfigurable
getStopRequest
in interface Reconfigurable
getStopRequest
in class AbstractReplicaCoordinator<NodeIDType>
name:epoch
.public boolean stopFailureMonitoring(NodeIDType node)
node
- public boolean existsOrHigher(java.lang.String name, int epoch)
name
- epoch
- epoch
or higher version exists for
name
.public java.util.Set<NodeIDType> removeDead(java.util.Set<NodeIDType> nodes)
nodes
- PaxosManager.removeDead(Set)
.public void stop()
AbstractReplicaCoordinator
stop
in class AbstractReplicaCoordinator<NodeIDType>