Package org.apache.kafka.streams.query
Class StateQueryRequest<R>
java.lang.Object
org.apache.kafka.streams.query.StateQueryRequest<R>
- Type Parameters:
R
- The type of the query result.
The request object for Interactive Queries. This is an immutable builder class for passing all
required and optional arguments for querying a state store in Kafka Streams.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A progressive builder interface for creatingStoreQueryRequest
s. -
Method Summary
Modifier and TypeMethodDescriptionRequests for stores and the Streams runtime to record any useful details about how the query was executed.boolean
Whether the request includes detailed execution information.If the request is for specific partitions, return the set of partitions to query.The bound that this request places on its query, in terms of the partitions' positions against its inputs.getQuery()
The query this request is meant to run.The name of the store this request is for.static StateQueryRequest.InStore
Specifies the name of the store to query.boolean
Whether this request should fetch from all locally available partitions.boolean
Whether this request requires the query to execute only on active partitions.Specifies that this query should only run on partitions for which this instance is the leader (aka "active").Specifies that the query will run against all locally available partitions.withPartitions
(Set<Integer> partitions) Specifies a set of partitions to run against.withPositionBound
(PositionBound positionBound) Bounds the position of the state store against its input topics.
-
Method Details
-
inStore
Specifies the name of the store to query. -
withPositionBound
Bounds the position of the state store against its input topics. -
withAllPartitions
Specifies that the query will run against all locally available partitions. -
withPartitions
Specifies a set of partitions to run against. If some partitions are not locally available, the response will contain aFailureReason.NOT_PRESENT
for those partitions. If some partitions in this set are not valid partitions for the store, the response will contain aFailureReason.DOES_NOT_EXIST
for those partitions. -
enableExecutionInfo
Requests for stores and the Streams runtime to record any useful details about how the query was executed. -
requireActive
Specifies that this query should only run on partitions for which this instance is the leader (aka "active"). Partitions for which this instance is not the active replica will returnFailureReason.NOT_ACTIVE
. -
getStoreName
The name of the store this request is for. -
getPositionBound
The bound that this request places on its query, in terms of the partitions' positions against its inputs. -
getQuery
The query this request is meant to run. -
isAllPartitions
public boolean isAllPartitions()Whether this request should fetch from all locally available partitions. -
getPartitions
If the request is for specific partitions, return the set of partitions to query.- Throws:
IllegalStateException
- if this is a request for all partitions
-
executionInfoEnabled
public boolean executionInfoEnabled()Whether the request includes detailed execution information. -
isRequireActive
public boolean isRequireActive()Whether this request requires the query to execute only on active partitions.
-