Request (Apache ZooKeeper - Server 3.7.0 API)
Date: 2021-03-17

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 Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `List<Id>` | `authInfo`
    `ServerCnxn` | `cnxn`
    `long` | `commitProcQueueStartTime`
    `long` | `commitRecvTime`
    `long` | `createTime`
    `int` | `cxid`
    `long` | `prepQueueStartTime`
    `long` | `prepStartTime`
    `QuorumVerifier` | `qv`
    `ByteBuffer` | `request`
    `static Request` | `requestOfDeath`
    `long` | `requestThrottleQueueTime`
    `long` | `sessionId`
    `long` | `syncQueueStartTime`
    `int` | `type`
    `long` | `zxid`

  - ### Constructor Summary

    Constructors
    Constructor and 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 Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ServerCnxn` | `getConnection()`
    `KeeperException` | `getException()`
    `TxnHeader` | `getHdr()`
    `int` | `getLargeRequestSize()`
    `Object` | `getOwner()`
    `static boolean` | `getStaleConnectionCheck()`
    `static boolean` | `getStaleLatencyCheck()`
    `Record` | `getTxn()`
    `TxnDigest` | `getTxnDigest()`
    `String` | `getUsersForAudit()` Returns a formatted, comma-separated list of the user IDs associated with this `Request`, or `null` if no user IDs were found.
    `boolean` | `isFromLearner()`
    `boolean` | `isLocalSession()`
    `boolean` | `isQuorum()`
    `boolean` | `isStale()`
    `boolean` | `isThrottlable()`
    `boolean` | `isThrottled()`
    `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)`
    `void` | `setException(KeeperException e)`
    `void` | `setHdr(TxnHeader hdr)`
    `void` | `setIsThrottled(boolean val)`
    `void` | `setLargeRequestSize(int size)`
    `void` | `setLocalSession(boolean isLocalSession)`
    `void` | `setOwner(Object owner)`
    `static void` | `setStaleConnectionCheck(boolean check)`
    `static void` | `setStaleLatencyCheck(boolean check)`
    `void` | `setTxn(Record txn)`
    `void` | `setTxnDigest(TxnDigest txnDigest)`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### requestOfDeath

          public static final Request requestOfDeath

    - #### sessionId

          public final long sessionId

    - #### cxid

          public final int cxid

    - #### type

          public final int type

    - #### request

          public final ByteBuffer request

    - #### cnxn

          public final ServerCnxn cnxn

    - #### zxid

          public long zxid

    - #### authInfo

          public final List<Id> 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

          public QuorumVerifier qv

  - ### Constructor Detail

    - #### Request

          public Request(ServerCnxn cnxn,
                         long sessionId,
                         int xid,
                         int type,
                         ByteBuffer bb,
                         List<Id> authInfo)

    - #### Request

          public Request(long sessionId,
                         int xid,
                         int type,
                         TxnHeader hdr,
                         Record txn,
                         long zxid)

  - ### Method Detail

    - #### 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

          public Object getOwner()

    - #### setOwner

          public void setOwner(Object owner)

    - #### getHdr

          public TxnHeader getHdr()

    - #### setHdr

          public void setHdr(TxnHeader hdr)

    - #### getTxn

          public Record getTxn()

    - #### setTxn

          public void setTxn(Record txn)

    - #### getConnection

          public ServerCnxn 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

          public static String op2String(int op)

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### setException

          public void setException(KeeperException e)

    - #### getException

          public KeeperException getException()

    - #### logLatency

          public void logLatency(Summary metric)

    - #### logLatency

          public void logLatency(Summary metric,
                                 long currentTime)

    - #### logLatency

          public void logLatency(SummarySet metric,
                                 String key,
                                 long currentTime)

    - #### logLatency

          public void logLatency(SummarySet metric,
                                 String key)

    - #### getUsersForAudit

          public String getUsersForAudit()

      Returns a formatted, comma-separated list of the user IDs associated with this `Request`, or `null` 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 corresponding `scheme`, 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

          public TxnDigest getTxnDigest()

    - #### setTxnDigest

          public void setTxnDigest(TxnDigest txnDigest)

    - #### isFromLearner

          public boolean isFromLearner()

Copyright © 2008–2021 The Apache Software Foundation. All rights reserved.