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 ServerCnxn
long
long
final long
final int
long
long
static final Request
long
final long
long
final int
long
-
Constructor Summary
ConstructorsConstructorDescriptionRequest
(ServerCnxn cnxn, long sessionId, int xid, int type, RequestRecord request, List<Id> authInfo) -
Method Summary
Modifier and TypeMethodDescriptiongetHdr()
int
getOwner()
byte[]
static boolean
static boolean
getTxn()
Returns a formatted, comma-separated list of the user IDs associated with thisRequest
, ornull
if no user IDs were found.boolean
boolean
boolean
isQuorum()
boolean
isStale()
boolean
boolean
void
logLatency
(Summary metric) void
logLatency
(Summary metric, long currentTime) void
logLatency
(SummarySet metric, String key) void
logLatency
(SummarySet metric, String key, long currentTime) 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.static String
op2String
(int op) byte[]
<T extends Record>
TreadRequestRecord
(Supplier<T> constructor) <T extends Record>
TreadRequestRecordNoException
(Supplier<T> constructor) void
void
void
setIsThrottled
(boolean val) void
setLargeRequestSize
(int size) void
setLocalSession
(boolean isLocalSession) void
static void
setStaleConnectionCheck
(boolean check) static void
setStaleLatencyCheck
(boolean check) void
void
setTxnDigest
(TxnDigest txnDigest) toString()
-
Field Details
-
requestOfDeath
-
sessionId
public final long sessionId -
cxid
public final int cxid -
type
public final int type -
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, RequestRecord request, List<Id> authInfo) -
Request
-
-
Method Details
-
readRequestRecord
- Throws:
IOException
-
readRequestRecordNoException
-
readRequestBytes
public byte[] readRequestBytes() -
requestDigest
-
isThrottled
public boolean isThrottled() -
setIsThrottled
public void setIsThrottled(boolean val) -
isThrottlable
public boolean isThrottlable() -
getSerializeData
public byte[] getSerializeData() -
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
, ornull
if 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
null
if no user IDs were found.
-
getTxnDigest
-
setTxnDigest
-
isFromLearner
public boolean isFromLearner()
-