R
- The type of the query result.@InterfaceStability.Evolving public class StateQueryResult<R> extends Object
Constructor and Description |
---|
StateQueryResult() |
Modifier and Type | Method and Description |
---|---|
void |
addResult(int partition,
QueryResult<R> r)
Set the result for a partitioned store query.
|
QueryResult<R> |
getGlobalResult()
The query's result for global store queries.
|
QueryResult<R> |
getOnlyPartitionResult()
For queries that are expected to match records in only one partition, returns the result.
|
Map<Integer,QueryResult<R>> |
getPartitionResults()
The query's result for each partition that executed the query.
|
Position |
getPosition()
The position of the state store at the moment it executed the query.
|
void |
setGlobalResult(QueryResult<R> r)
Set the result for a global store query.
|
String |
toString() |
public void setGlobalResult(QueryResult<R> r)
public void addResult(int partition, QueryResult<R> r)
public Map<Integer,QueryResult<R>> getPartitionResults()
public QueryResult<R> getOnlyPartitionResult()
IllegalArgumentException
- if the results are not for exactly one partition.public QueryResult<R> getGlobalResult()
null
for non-global (partitioned)
store queries.public Position getPosition()
StateQueryRequest.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.