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 SummaryNested ClassesModifier and TypeClassDescriptionstatic classA progressive builder interface for creatingStoreQueryRequests.
- 
Method SummaryModifier and TypeMethodDescriptionRequests for stores and the Streams runtime to record any useful details about how the query was executed.booleanWhether 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.InStoreSpecifies the name of the store to query.booleanWhether this request should fetch from all locally available partitions.booleanWhether 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- 
inStoreSpecifies the name of the store to query.
- 
withPositionBoundBounds the position of the state store against its input topics.
- 
withAllPartitionsSpecifies that the query will run against all locally available partitions.
- 
withPartitionsSpecifies a set of partitions to run against. If some partitions are not locally available, the response will contain aFailureReason.NOT_PRESENTfor those partitions. If some partitions in this set are not valid partitions for the store, the response will contain aFailureReason.DOES_NOT_EXISTfor those partitions.
- 
enableExecutionInfoRequests for stores and the Streams runtime to record any useful details about how the query was executed.
- 
requireActiveSpecifies 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.
- 
getStoreNameThe name of the store this request is for.
- 
getPositionBoundThe bound that this request places on its query, in terms of the partitions' positions against its inputs.
- 
getQueryThe query this request is meant to run.
- 
isAllPartitionspublic boolean isAllPartitions()Whether this request should fetch from all locally available partitions.
- 
getPartitionsIf the request is for specific partitions, return the set of partitions to query.- Throws:
- IllegalStateException- if this is a request for all partitions
 
- 
executionInfoEnabledpublic boolean executionInfoEnabled()Whether the request includes detailed execution information.
- 
isRequireActivepublic boolean isRequireActive()Whether this request requires the query to execute only on active partitions.
 
-