Package org.apache.cassandra.service
Class QueryState
java.lang.Object
org.apache.cassandra.service.QueryState
Primarily used as a recorder for server-generated timestamps (timestamp, in microseconds, and nowInSeconds - in, well, seconds).
The goal is to be able to use a single consistent server-generated value for both timestamps across the whole request,
and later be able to inspect QueryState for the generated values - for logging or other purposes.
-
Constructor Summary
ConstructorsConstructorDescriptionQueryState(ClientState clientState) QueryState(ClientState clientState, long timestamp, long nowInSeconds) -
Method Summary
Modifier and TypeMethodDescriptionstatic QueryStatelonglonglongGenerate, cache, and record a nowInSeconds value on the server-side.longGenerate, cache, and record a timestamp value on the server-side.
-
Constructor Details
-
QueryState
-
QueryState
-
-
Method Details
-
forInternalCalls
- Returns:
- a QueryState object for internal C* calls (not limited by any kind of auth).
-
getTimestamp
public long getTimestamp()Generate, cache, and record a timestamp value on the server-side. Used in reads for all live and expiring cells, and all kinds of deletion infos. Shouldn't be used directly.QueryOptions.getTimestamp(QueryState)should be used by all consumers.- Returns:
- server-generated, recorded timestamp in seconds
-
getNowInSeconds
public long getNowInSeconds()Generate, cache, and record a nowInSeconds value on the server-side. In writes is used for calculating localDeletionTime for tombstones and expiring cells and other deletion infos. In reads used to determine liveness of expiring cells and rows. Shouldn't be used directly.QueryOptions.getNowInSeconds(QueryState)should be used by all consumers.- Returns:
- server-generated, recorded timestamp in seconds
-
generatedTimestamp
public long generatedTimestamp()- Returns:
- server-generated timestamp value, if one had been requested, or Long.MIN_VALUE otherwise
-
generatedNowInSeconds
public long generatedNowInSeconds()- Returns:
- server-generated nowInSeconds value, if one had been requested, or Integer.MIN_VALUE otherwise
-
getClientState
-
getClientAddress
-