public class RCRecordRequest<NodeIDType> extends BasicReconfigurationPacket<NodeIDType> implements ReplicableRequest, ReconfigurableRequest, SummarizableRequest
Modifier and Type | Class and Description |
---|---|
static class |
RCRecordRequest.RequestTypes
RCRecordRequest sub-types.
|
ReconfigurationPacket.PacketType
Modifier and Type | Field and Description |
---|---|
StartEpoch<NodeIDType> |
startEpoch
The start epoch request that started this reconfiguration.
|
epochNumber, serviceName
clientPacketTypes, HANDLER_METHOD_PREFIX, PACKET_TYPE, serverPacketTypes
type
STOP
Constructor and Description |
---|
RCRecordRequest(org.json.JSONObject json,
Stringifiable<NodeIDType> unstringer) |
RCRecordRequest(NodeIDType initiator,
StartEpoch<NodeIDType> startEpoch,
RCRecordRequest.RequestTypes reqType) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
RCRecordRequest.RequestTypes |
getRCRequestType() |
static java.lang.String |
getRCRequestTypeCompact(RCRecordRequest.RequestTypes rType) |
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. |
IntegerPacketType |
getRequestType() |
java.lang.String |
getSummary()
Implementations are encouraged to return an inline created new Object()
whose toString() method will return the actual String instead of just
returning the String directly.
|
java.lang.String |
getSummary(java.util.logging.Level level) |
int |
hashCode() |
boolean |
isActiveNodeConfigChange() |
boolean |
isDeleteIntent() |
boolean |
isDeleteIntentOrPrevDropComplete() |
boolean |
isNodeConfigChange() |
boolean |
isReconfigurationComplete() |
boolean |
isReconfigurationIntent() |
boolean |
isReconfigurationMerge() |
boolean |
isReconfigurationPrevDropComplete() |
boolean |
isSplitIntent() |
boolean |
isStop() |
boolean |
lessThan(RCRecordRequest<NodeIDType> req2) |
boolean |
needsCoordination() |
void |
setNeedsCoordination(boolean b)
After this method returns,
ReplicableRequest.needsCoordination() should
subsequently return b . |
org.json.JSONObject |
toJSONObjectImpl() |
getEpochNumber, getServiceName
assertPacketTypeChecks, assertPacketTypeChecks, assertPacketTypeChecks, assertPacketTypeChecks, concatenate, getMessage, getPacketType, getPacketTypeCanonicalClassName, getPacketTypeClass, getPacketTypeClassName, getReconfigurationPacket, getReconfigurationPacket, getReconfigurationPacketSuppressExceptions, getReconfigurationPacketSuppressExceptions, getReconfigurationPacketType, getReconfigurationPacketType, isReconfigurationPacket, putPacketType, toBytes, toString
flip, getInitiator, getKey, getSender, getType, setKey, setSender, setType, toJSONObject
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getEpochNumber
getServiceName, toBytes, toString
getSummary
public final StartEpoch<NodeIDType> startEpoch
public RCRecordRequest(NodeIDType initiator, StartEpoch<NodeIDType> startEpoch, RCRecordRequest.RequestTypes reqType)
initiator
- startEpoch
- reqType
- public RCRecordRequest(org.json.JSONObject json, Stringifiable<NodeIDType> unstringer) throws org.json.JSONException
json
- unstringer
- org.json.JSONException
public org.json.JSONObject toJSONObjectImpl() throws org.json.JSONException
toJSONObjectImpl
in class BasicReconfigurationPacket<NodeIDType>
org.json.JSONException
public boolean isReconfigurationIntent()
public boolean isReconfigurationMerge()
public boolean isReconfigurationComplete()
public boolean isReconfigurationPrevDropComplete()
public boolean isDeleteIntent()
public boolean isDeleteIntentOrPrevDropComplete()
public boolean isSplitIntent()
public IntegerPacketType getRequestType()
getRequestType
in interface Request
getRequestType
in class BasicReconfigurationPacket<NodeIDType>
public boolean needsCoordination()
needsCoordination
in interface ReplicableRequest
public void setNeedsCoordination(boolean b)
ReplicableRequest
ReplicableRequest.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 ReplicableRequest
b
- True if subsequent invocations of ReplicableRequest.needsCoordination()
must return true, false otherwise.public boolean isNodeConfigChange()
public RCRecordRequest.RequestTypes getRCRequestType()
public boolean isStop()
isStop
in interface ReconfigurableRequest
public static java.lang.String getRCRequestTypeCompact(RCRecordRequest.RequestTypes rType)
public java.lang.String getSummary()
Summarizable
getSummary
in interface Request
getSummary
in interface SummarizableRequest
getSummary
in interface ReconfigurableRequest
getSummary
in interface Summarizable
getSummary
in class BasicReconfigurationPacket<NodeIDType>
public java.lang.String getSummary(java.util.logging.Level level)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean lessThan(RCRecordRequest<NodeIDType> req2)
public long getRequestID()
RequestIdentifier
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. 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
public boolean isActiveNodeConfigChange()