Package org.apache.kafka.streams.query
Class StateQueryResult<R>
java.lang.Object
org.apache.kafka.streams.query.StateQueryResult<R>
- Type Parameters:
- R- The type of the query result.
The response object for interactive queries. This wraps the individual partition results, as well
 as metadata relating to the result as a whole.
 
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddResult(int partition, QueryResult<R> r) Set the result for a partitioned store query.The query's result for global store queries.For queries that are expected to match records in only one partition, returns the result.The query's result for each partition that executed the query.The position of the state store at the moment it executed the query.voidSet the result for a global store query.toString()
- 
Constructor Details- 
StateQueryResultpublic StateQueryResult()
 
- 
- 
Method Details- 
setGlobalResultSet the result for a global store query. Used by Kafka Streams and available for tests.
- 
addResultSet the result for a partitioned store query. Used by Kafka Streams and available for tests.
- 
getPartitionResultsThe query's result for each partition that executed the query. Empty for global store queries.
- 
getOnlyPartitionResultFor queries that are expected to match records in only one partition, returns the result.- Throws:
- IllegalArgumentException- if the results are not for exactly one partition.
 
- 
getGlobalResultThe query's result for global store queries. Isnullfor non-global (partitioned) store queries.
- 
getPositionThe position of the state store at the moment it executed the query. In conjunction withStateQueryRequest.withPositionBound(org.apache.kafka.streams.query.PositionBound), this can be used to achieve a good balance between consistency and availability in which repeated queries are guaranteed to advance in time while allowing reads to be served from any replica that is caught up to that caller's prior observations.
- 
toString
 
-