Package org.apache.kafka.streams
Class KeyQueryMetadata
java.lang.Object
org.apache.kafka.streams.KeyQueryMetadata
Represents all the metadata related to a key, where a particular key resides in a 
KafkaStreams application.
 It contains the active HostInfo and a set of standby HostInfos, denoting the instances where the key resides.
 It also contains the partition number where the key belongs, which could be useful when used in conjunction with other APIs.
 e.g: Relating with lags for that store partition.
 NOTE: This is a point in time view. It may change as rebalances happen.- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final KeyQueryMetadataSentinel to indicate that the KeyQueryMetadata is currently unavailable.
- 
Constructor SummaryConstructorsConstructorDescriptionKeyQueryMetadata(HostInfo activeHost, Set<HostInfo> standbyHosts, int partition) 
- 
Method SummaryModifier and TypeMethodDescriptionGet the active Kafka Streams instance for given key.booleanDeprecated.intDeprecated.since 2.7.0; usepartition()instead.Deprecated.since 2.7.0; usestandbyHosts()instead.inthashCode()intGet the store partition corresponding to the key.Get the Kafka Streams instances that host the key as standbys.toString()
- 
Field Details- 
NOT_AVAILABLESentinel to indicate that the KeyQueryMetadata is currently unavailable. This can occur during rebalance operations.
 
- 
- 
Constructor Details- 
KeyQueryMetadata
 
- 
- 
Method Details- 
getActiveHostDeprecated.since 2.7.0; useactiveHost()instead.Get the active Kafka Streams instance for given key.- Returns:
- active instance's HostInfo
 
- 
getStandbyHostsDeprecated.since 2.7.0; usestandbyHosts()instead.Get the Kafka Streams instances that host the key as standbys.- Returns:
- set of standby HostInfoor a empty set, if no standbys are configured
 
- 
getPartitionDeprecated.since 2.7.0; usepartition()instead.Get the store partition corresponding to the key.- Returns:
- store partition number
 
- 
activeHostGet the active Kafka Streams instance for given key.- Returns:
- active instance's HostInfo
 
- 
standbyHostsGet the Kafka Streams instances that host the key as standbys.- Returns:
- set of standby HostInfoor a empty set, if no standbys are configured
 
- 
partitionpublic int partition()Get the store partition corresponding to the key.- Returns:
- store partition number
 
- 
equals
- 
toString
- 
hashCodepublic int hashCode()
 
- 
activeHost()instead.