Package org.apache.zookeeper.server
Class Request
java.lang.Object
org.apache.zookeeper.server.Request
- Direct Known Subclasses:
LearnerSyncRequest
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 Summary
FieldsModifier and TypeFieldDescriptionfinal ServerCnxnlonglongfinal longfinal intlonglongfinal ByteBufferstatic final Requestlongfinal longlongfinal intlong -
Constructor Summary
ConstructorsConstructorDescriptionRequest(ServerCnxn cnxn, long sessionId, int xid, int type, ByteBuffer bb, List<Id> authInfo) -
Method Summary
Modifier and TypeMethodDescriptiongetHdr()intgetOwner()static booleanstatic booleangetTxn()Returns a formatted, comma-separated list of the user IDs associated with thisRequest, ornullif no user IDs were found.booleanbooleanbooleanisQuorum()booleanisStale()booleanbooleanvoidlogLatency(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) voidvoidvoidsetIsThrottled(boolean val) voidsetLargeRequestSize(int size) voidsetLocalSession(boolean isLocalSession) voidstatic voidsetStaleConnectionCheck(boolean check) static voidsetStaleLatencyCheck(boolean check) voidvoidsetTxnDigest(TxnDigest txnDigest) toString()
-
Field Details
-
requestOfDeath
-
sessionId
public final long sessionId -
cxid
public final int cxid -
type
public final int type -
request
-
cnxn
-
zxid
public long zxid -
authInfo
-
createTime
public final long createTime -
prepQueueStartTime
public long prepQueueStartTime -
prepStartTime
public long prepStartTime -
commitProcQueueStartTime
public long commitProcQueueStartTime -
commitRecvTime
public long commitRecvTime -
syncQueueStartTime
public long syncQueueStartTime -
requestThrottleQueueTime
public long requestThrottleQueueTime -
qv
-
-
Constructor Details
-
Request
public Request(ServerCnxn cnxn, long sessionId, int xid, int type, ByteBuffer bb, List<Id> authInfo) -
Request
-
-
Method Details
-
isThrottled
public boolean isThrottled() -
setIsThrottled
public void setIsThrottled(boolean val) -
isThrottlable
public boolean isThrottlable() -
isLocalSession
public boolean isLocalSession() -
setLocalSession
public void setLocalSession(boolean isLocalSession) -
setLargeRequestSize
public void setLargeRequestSize(int size) -
getLargeRequestSize
public int getLargeRequestSize() -
getOwner
-
setOwner
-
getHdr
-
setHdr
-
getTxn
-
setTxn
-
getConnection
-
getStaleLatencyCheck
public static boolean getStaleLatencyCheck() -
setStaleLatencyCheck
public static void setStaleLatencyCheck(boolean check) -
getStaleConnectionCheck
public static boolean getStaleConnectionCheck() -
setStaleConnectionCheck
public static void setStaleConnectionCheck(boolean check) -
isStale
public boolean isStale() -
mustDrop
public 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. -
isQuorum
public boolean isQuorum() -
op2String
-
toString
-
setException
-
getException
-
logLatency
-
logLatency
-
logLatency
-
logLatency
-
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.
-
getTxnDigest
-
setTxnDigest
-
isFromLearner
public boolean isFromLearner()
-