Package org.apache.zookeeper.server
Class Request
- java.lang.Object
- 
- org.apache.zookeeper.server.Request
 
- 
- Direct Known Subclasses:
- LearnerSyncRequest
 
 public class Request extends Object This is the structure that represents a request moving through a chain of RequestProcessors. There are various pieces of information that is tacked onto the request as it is processed.
- 
- 
Field SummaryFields Modifier and Type Field Description List<Id>authInfoServerCnxncnxnlongcommitProcQueueStartTimelongcommitRecvTimelongcreateTimeintcxidlongprepQueueStartTimelongprepStartTimeQuorumVerifierqvByteBufferrequeststatic RequestrequestOfDeathlongrequestThrottleQueueTimelongsessionIdlongsyncQueueStartTimeinttypelongzxid
 - 
Constructor SummaryConstructors Constructor Description Request(long sessionId, int xid, int type, TxnHeader hdr, Record txn, long zxid)Request(ServerCnxn cnxn, long sessionId, int xid, int type, ByteBuffer bb, List<Id> authInfo)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ServerCnxngetConnection()KeeperExceptiongetException()TxnHeadergetHdr()intgetLargeRequestSize()ObjectgetOwner()static booleangetStaleConnectionCheck()static booleangetStaleLatencyCheck()RecordgetTxn()TxnDigestgetTxnDigest()StringgetUsersForAudit()Returns a formatted, comma-separated list of the user IDs associated with thisRequest, ornullif no user IDs were found.booleanisFromLearner()booleanisLocalSession()booleanisQuorum()booleanisStale()booleanisThrottlable()booleanisThrottled()voidlogLatency(Summary metric)voidlogLatency(Summary metric, long currentTime)voidlogLatency(SummarySet metric, String key)voidlogLatency(SummarySet metric, String key, long currentTime)booleanmustDrop()A prior request was dropped on this request's connection and therefore this request must also be dropped to ensure correct ordering semantics.static Stringop2String(int op)voidsetException(KeeperException e)voidsetHdr(TxnHeader hdr)voidsetIsThrottled(boolean val)voidsetLargeRequestSize(int size)voidsetLocalSession(boolean isLocalSession)voidsetOwner(Object owner)static voidsetStaleConnectionCheck(boolean check)static voidsetStaleLatencyCheck(boolean check)voidsetTxn(Record txn)voidsetTxnDigest(TxnDigest txnDigest)StringtoString()
 
- 
- 
- 
Field Detail- 
requestOfDeathpublic static final Request requestOfDeath 
 - 
sessionIdpublic final long sessionId 
 - 
cxidpublic final int cxid 
 - 
typepublic final int type 
 - 
requestpublic final ByteBuffer request 
 - 
cnxnpublic final ServerCnxn cnxn 
 - 
zxidpublic long zxid 
 - 
createTimepublic final long createTime 
 - 
prepQueueStartTimepublic long prepQueueStartTime 
 - 
prepStartTimepublic long prepStartTime 
 - 
commitProcQueueStartTimepublic long commitProcQueueStartTime 
 - 
commitRecvTimepublic long commitRecvTime 
 - 
syncQueueStartTimepublic long syncQueueStartTime 
 - 
requestThrottleQueueTimepublic long requestThrottleQueueTime 
 - 
qvpublic QuorumVerifier qv 
 
- 
 - 
Constructor Detail- 
Requestpublic Request(ServerCnxn cnxn, long sessionId, int xid, int type, ByteBuffer bb, List<Id> authInfo) 
 
- 
 - 
Method Detail- 
isThrottledpublic boolean isThrottled() 
 - 
setIsThrottledpublic void setIsThrottled(boolean val) 
 - 
isThrottlablepublic boolean isThrottlable() 
 - 
isLocalSessionpublic boolean isLocalSession() 
 - 
setLocalSessionpublic void setLocalSession(boolean isLocalSession) 
 - 
setLargeRequestSizepublic void setLargeRequestSize(int size) 
 - 
getLargeRequestSizepublic int getLargeRequestSize() 
 - 
getOwnerpublic Object getOwner() 
 - 
setOwnerpublic void setOwner(Object owner) 
 - 
getHdrpublic TxnHeader getHdr() 
 - 
setHdrpublic void setHdr(TxnHeader hdr) 
 - 
getTxnpublic Record getTxn() 
 - 
setTxnpublic void setTxn(Record txn) 
 - 
getConnectionpublic ServerCnxn getConnection() 
 - 
getStaleLatencyCheckpublic static boolean getStaleLatencyCheck() 
 - 
setStaleLatencyCheckpublic static void setStaleLatencyCheck(boolean check) 
 - 
getStaleConnectionCheckpublic static boolean getStaleConnectionCheck() 
 - 
setStaleConnectionCheckpublic static void setStaleConnectionCheck(boolean check) 
 - 
isStalepublic boolean isStale() 
 - 
mustDroppublic boolean mustDrop() A prior request was dropped on this request's connection and therefore this request must also be dropped to ensure correct ordering semantics.
 - 
isQuorumpublic boolean isQuorum() 
 - 
op2Stringpublic static String op2String(int op) 
 - 
setExceptionpublic void setException(KeeperException e) 
 - 
getExceptionpublic KeeperException getException() 
 - 
logLatencypublic void logLatency(Summary metric) 
 - 
logLatencypublic void logLatency(Summary metric, long currentTime) 
 - 
logLatencypublic void logLatency(SummarySet metric, String key, long currentTime) 
 - 
logLatencypublic void logLatency(SummarySet metric, String key) 
 - 
getUsersForAuditpublic String getUsersForAudit() Returns a formatted, comma-separated list of the user IDs associated with thisRequest, ornullif no user IDs were found. The return value is used for audit logging. While it may be easy on the eyes, it is underspecified: it does not mention the correspondingscheme, nor are its components escaped. This is not a security feature.- Returns:
- a comma-separated list of user IDs, or nullif no user IDs were found.
 
 - 
getTxnDigestpublic TxnDigest getTxnDigest() 
 - 
setTxnDigestpublic void setTxnDigest(TxnDigest txnDigest) 
 - 
isFromLearnerpublic boolean isFromLearner() 
 
- 
 
-