NodeIDType - public class StopEpoch<NodeIDType> extends BasicReconfigurationPacket<NodeIDType> implements ReconfigurableRequest, ReplicableRequest
ReconfigurationPacket.PacketTypeepochNumber, serviceNameclientPacketTypes, HANDLER_METHOD_PREFIX, PACKET_TYPE, serverPacketTypestypeSTOP| Constructor and Description |
|---|
StopEpoch(org.json.JSONObject json,
Stringifiable<NodeIDType> unstringer) |
StopEpoch(NodeIDType initiator,
java.lang.String name,
int epochNumber) |
StopEpoch(NodeIDType initiator,
java.lang.String name,
int epochNumber,
boolean getFinalState,
boolean executeStop) |
| Modifier and Type | Method and Description |
|---|---|
long |
getRequestID()
The uniqueness of this identifier across all requests to a replica group
is important for safety when
PaxosConfig.PC.PREVENT_DOUBLE_EXECUTION is
enabled as gigapaxos may otherwise assume that the duplicate request
identifier corresponds to a retransmission and will send back the
response if any corresponding to the first execution. |
boolean |
isStop() |
boolean |
needsCoordination() |
void |
setNeedsCoordination(boolean b)
After this method returns,
ReplicableRequest.needsCoordination() should
subsequently return b. |
boolean |
shouldExecuteStop() |
boolean |
shouldGetFinalState() |
org.json.JSONObject |
toJSONObjectImpl() |
getEpochNumber, getRequestType, getServiceName, getSummaryassertPacketTypeChecks, assertPacketTypeChecks, assertPacketTypeChecks, assertPacketTypeChecks, concatenate, getMessage, getPacketType, getPacketTypeCanonicalClassName, getPacketTypeClass, getPacketTypeClassName, getReconfigurationPacket, getReconfigurationPacket, getReconfigurationPacketSuppressExceptions, getReconfigurationPacketSuppressExceptions, getReconfigurationPacketType, getReconfigurationPacketType, isReconfigurationPacket, putPacketType, toBytes, toStringflip, getInitiator, getKey, getSender, getType, setKey, setSender, setType, toJSONObjectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetEpochNumber, getSummarygetRequestType, getServiceName, toBytes, toStringgetSummarypublic StopEpoch(NodeIDType initiator, java.lang.String name, int epochNumber, boolean getFinalState, boolean executeStop)
initiator - name - epochNumber - getFinalState - executeStop - public StopEpoch(NodeIDType initiator, java.lang.String name, int epochNumber)
initiator - name - epochNumber - public StopEpoch(org.json.JSONObject json,
Stringifiable<NodeIDType> unstringer)
throws org.json.JSONException
json - unstringer - org.json.JSONExceptionpublic org.json.JSONObject toJSONObjectImpl()
throws org.json.JSONException
toJSONObjectImpl in class BasicReconfigurationPacket<NodeIDType>org.json.JSONExceptionpublic boolean isStop()
isStop in interface ReconfigurableRequestpublic boolean shouldExecuteStop()
public boolean needsCoordination()
needsCoordination in interface ReplicableRequestpublic void setNeedsCoordination(boolean b)
ReplicableRequestReplicableRequest.needsCoordination() should
subsequently return b. This method is invoked by
AbstractReplicaCoordinator with a false argument just
before coordinating the request so that coordinated packets are not
coordinated again infinitely. For example, if a replica coordinator's
coordination strategy is to simply flood the request to all replicas,
there needs to be a way for a recipient of a copy of this already once
coordinated request to know that it should not coordinate it again. This
method provides AbstractReplicaCoordinator a placeholder in the
application request to prevent such infinite coordination loops.
This method is now deprecated and does not need to be overridden by implementing classes. It's original purpose was really only to be able to easily do lazy propagation replica coordination without introducing an additional type (just to distinguish between the original request at the entry replica and the replicated request so as to avoid an infinite propagation loop), but introducing an additional type is the clean way to do this. Paxos for example already has its own types, so it doesn't need this method.
setNeedsCoordination in interface ReplicableRequestb - True if subsequent invocations of ReplicableRequest.needsCoordination()
must return true, false otherwise.public boolean shouldGetFinalState()
public long getRequestID()
RequestIdentifierPaxosConfig.PC.PREVENT_DOUBLE_EXECUTION is
enabled as gigapaxos may otherwise assume that the duplicate request
identifier corresponds to a retransmission and will send back the
response if any corresponding to the first execution. With
PaxosConfig.PC.PREVENT_DOUBLE_EXECUTION
disabled, the uniqueness is important for liveness as duplicate request
identifiers may result in the client not receiving a response for the
latter request; this is because gigapaxos stores request execution
callbacks indexed by the request identifier, so there must be at most one
outstanding request with a given identifier for a given replica group.getRequestID in interface RequestIdentifier