NodeIDType
- public class DemandReport<NodeIDType> extends BasicReconfigurationPacket<NodeIDType> implements ReplicableRequest
ReconfigurationPacket.PacketType
epochNumber, serviceName
clientPacketTypes, HANDLER_METHOD_PREFIX, PACKET_TYPE, serverPacketTypes
type
Constructor and Description |
---|
DemandReport(org.json.JSONObject json,
Stringifiable<NodeIDType> unstringer) |
DemandReport(NodeIDType initiator,
java.lang.String name,
int epochNumber,
AbstractDemandProfile demand) |
DemandReport(NodeIDType initiator,
java.lang.String name,
int epochNumber,
org.json.JSONObject stats) |
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. |
IntegerPacketType |
getRequestType() |
org.json.JSONObject |
getStats() |
static void |
main(java.lang.String[] args) |
boolean |
needsCoordination() |
void |
setNeedsCoordination(boolean b)
After this method returns,
ReplicableRequest.needsCoordination() should
subsequently return b . |
org.json.JSONObject |
toJSONObjectImpl() |
getEpochNumber, getServiceName, getSummary
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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getServiceName, getSummary, toBytes, toString
getSummary
public DemandReport(NodeIDType initiator, java.lang.String name, int epochNumber, org.json.JSONObject stats)
initiator
- name
- epochNumber
- stats
- public DemandReport(NodeIDType initiator, java.lang.String name, int epochNumber, AbstractDemandProfile demand)
initiator
- name
- epochNumber
- demand
- public DemandReport(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 org.json.JSONObject getStats()
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 static void main(java.lang.String[] args)
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