public class EchoRequest extends BasicReconfigurationPacket<java.net.InetSocketAddress> implements ClientRequest
ReconfigurationPacket.PacketType| Modifier and Type | Field and Description |
|---|---|
java.net.InetSocketAddress |
myReceiver |
long |
requestID |
long |
sentTime |
epochNumber, serviceNameclientPacketTypes, HANDLER_METHOD_PREFIX, PACKET_TYPE, serverPacketTypestype| Constructor and Description |
|---|
EchoRequest(java.net.InetSocketAddress initiator) |
EchoRequest(java.net.InetSocketAddress initiator,
java.util.Map<java.net.InetAddress,java.lang.Long> closest) |
EchoRequest(org.json.JSONObject json) |
EchoRequest(org.json.JSONObject json,
Stringifiable<?> unstringer) |
| Modifier and Type | Method and Description |
|---|---|
java.net.InetSocketAddress |
getClientAddress() |
java.util.Map<java.net.InetAddress,java.lang.Long> |
getClosest() |
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. |
ClientRequest |
getResponse() |
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.
|
boolean |
hasClosest() |
boolean |
isRequest() |
EchoRequest |
makeResponse(java.net.InetSocketAddress address) |
org.json.JSONObject |
toJSONObjectImpl() |
getEpochNumber, getRequestType, getServiceNameassertPacketTypeChecks, 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, waitgetRequestType, getServiceName, toBytes, toStringgetSummarypublic final long requestID
public final long sentTime
public final java.net.InetSocketAddress myReceiver
public EchoRequest(java.net.InetSocketAddress initiator,
java.util.Map<java.net.InetAddress,java.lang.Long> closest)
initiator - closest - public EchoRequest(java.net.InetSocketAddress initiator)
initiator - public EchoRequest(org.json.JSONObject json,
Stringifiable<?> unstringer)
throws org.json.JSONException,
java.net.UnknownHostException
json - unstringer - org.json.JSONExceptionjava.net.UnknownHostExceptionpublic EchoRequest(org.json.JSONObject json)
throws org.json.JSONException,
java.net.UnknownHostException
json - org.json.JSONExceptionjava.net.UnknownHostExceptionpublic org.json.JSONObject toJSONObjectImpl()
throws org.json.JSONException
toJSONObjectImpl in class BasicReconfigurationPacket<java.net.InetSocketAddress>org.json.JSONExceptionpublic boolean isRequest()
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 RequestIdentifierpublic java.net.InetSocketAddress getClientAddress()
getClientAddress in interface ClientRequestAbstractReplicaCoordinator already knows the sending client's
address anyway.public ClientRequest getResponse()
getResponse in interface ClientRequestAbstractReplicaCoordinator, e.g.,
PaxosManager, will invoke this method immediately after
Application.execute(Request) and, if the returned response
is non-null, will send it back to the client that issued that
request. Applications are expected to internally implement logic
that sets the response at the end of
Application.execute(Request) as follows:
public boolean Replicable.execute(Request request)} {
// execute request to obtain response
request.setResponse(response);
}
public boolean hasClosest()
public EchoRequest makeResponse(java.net.InetSocketAddress address)
address - this.public java.lang.String getSummary()
SummarizablegetSummary in interface RequestgetSummary in interface SummarizablegetSummary in class BasicReconfigurationPacket<java.net.InetSocketAddress>public java.util.Map<java.net.InetAddress,java.lang.Long> getClosest()