public class MetaRequestPacket extends RequestPacket
TESTPaxosClient.RequestPacket.Keys, RequestPacket.ResponseCodesPaxosPacket.NodeIDKeys, PaxosPacket.PaxosPacketTypedigest, NO_OP, NULL_SOCKADDR, requestID, requestValue, SIZE_ESTIMATE, SIZEOF_REQUEST_FIXED, stopCHARSET, packetType, paxosID, SIZEOF_PAXOSPACKET_FIXED, versionPACKET_TYPE, type| Constructor and Description | 
|---|
MetaRequestPacket(byte[] bytes)  | 
MetaRequestPacket(org.json.JSONObject json)  | 
MetaRequestPacket(long id,
                 java.lang.String val,
                 boolean stop)  | 
MetaRequestPacket(RequestPacket req)  | 
MetaRequestPacket(java.lang.String name,
                 java.lang.String val)  | 
| Modifier and Type | Method and Description | 
|---|---|
static MetaRequestPacket | 
getMetaRequestPacket(byte[] bytes)  | 
IntegerPacketType | 
getRequestType()  | 
MetaRequestPacket | 
getResponse()  | 
boolean | 
needsCoordination()  | 
byte[] | 
toBytes()
The implementation of this method is tied to and must be the inverse of
  
AppRequestParser.getRequest(byte[], edu.umass.cs.nio.nioutils.NIOHeader)
 , i.e., invoking getRequest(request.toBytes(), header).equals(request). | 
org.json.JSONObject | 
toJSONObjectImpl()  | 
java.lang.String | 
toString()
Learned the hard way that using org.json to stringify is an order of
 magnitude slower with large request values compared to manually inserting
 the string like below. 
 | 
addDebugInfo, addDebugInfo, addDebugInfo, addDebugInfoDeep, addDebugInfoDeep, batchSize, digestEquals, doubleCheckFields, equals, getACK, getBatched, getByteifiedSelf, getClientAddress, getClientID, getDebugInfo, getDigest, getEntryReplica, getEntryReplicaRequestsAsBatch, getEntryTime, getFirstOnly, getForwardCount, getForwarderID, getListenAddress, getMessageDigest, getNACK, getRandomPValue, getRequestID, getRequestPackets, getRequestValue, getRequestValues, getSamplePValue, getServiceName, getStringifiedSelf, getSummary, getSummaryString, hasRequestValue, isBroadcasted, isMetaValue, isNoop, isPingPonging, isPingPonging, isStopRequest, latchToBatch, lengthEstimate, main, makeNewRequest, makeNoop, printBatched, setBroadcasted, setByteifiedSelf, setDigest, setEntryReplica, setEntryReplicaAndReturnCount, setEntryTime, setForwarderID, setResponse, setReturnRequestValue, setStringifiedSelf, shouldBroadcast, shouldDigest, shouldReturnRequestValue, toBytes, toBytesInstrument, toJSONSmartImplgetPaxosID, getPaxosIDVersion, getPaxosPacket, getPaxosPacket, getPaxosPacketType, getPaxosPacketType, getSummary, getType, getType, getVersion, isParseable, isRecovery, isRecovery, isStatic, markRecovered, putPaxosID, toBytes, toJSONObject, toJSONSmart, toSingletonArraycouldBeJSON, couldBeJSON, couldBeJSON, couldBeJSONArray, couldBeJSONObject, getPacketType, putPacketType, putPacketTypeclone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetSummarypublic MetaRequestPacket(java.lang.String name,
                         java.lang.String val)
name - val - public MetaRequestPacket(long id,
                         java.lang.String val,
                         boolean stop)
id - val - stop - public MetaRequestPacket(byte[] bytes)
                  throws java.io.UnsupportedEncodingException,
                         java.net.UnknownHostException
bytes - java.io.UnsupportedEncodingExceptionjava.net.UnknownHostExceptionpublic MetaRequestPacket(org.json.JSONObject json)
                  throws org.json.JSONException
json - org.json.JSONExceptionpublic MetaRequestPacket(RequestPacket req)
req - public static MetaRequestPacket getMetaRequestPacket(byte[] bytes) throws java.io.UnsupportedEncodingException, java.net.UnknownHostException, org.json.JSONException
bytes - java.io.UnsupportedEncodingExceptionjava.net.UnknownHostExceptionorg.json.JSONExceptionpublic IntegerPacketType getRequestType()
getRequestType in interface RequestgetRequestType in class RequestPacketpublic byte[] toBytes()
RequestAppRequestParser.getRequest(byte[], edu.umass.cs.nio.nioutils.NIOHeader)
 , i.e., invoking getRequest(request.toBytes(), header).equals(request).public org.json.JSONObject toJSONObjectImpl()
                                     throws org.json.JSONException
toJSONObjectImpl in class RequestPacketorg.json.JSONExceptionpublic java.lang.String toString()
RequestPackettoString in interface RequesttoString in class RequestPacketpublic boolean needsCoordination()
public MetaRequestPacket getResponse()
getResponse in interface ClientRequestgetResponse in class RequestPacketAbstractReplicaCoordinator, 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); 
         }