Package org.apache.kafka.streams
Class KeyQueryMetadata
- java.lang.Object
-
- org.apache.kafka.streams.KeyQueryMetadata
-
public class KeyQueryMetadata extends Object
Represents all the metadata related to a key, where a particular key resides in aKafkaStreamsapplication. It contains the activeHostInfoand a set of standbyHostInfos, 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 Summary
Fields Modifier and Type Field Description static KeyQueryMetadataNOT_AVAILABLESentinel to indicate that the KeyQueryMetadata is currently unavailable.
-
Constructor Summary
Constructors Constructor Description KeyQueryMetadata(HostInfo activeHost, Set<HostInfo> standbyHosts, int partition)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description HostInfoactiveHost()Get the active Kafka Streams instance for given key.booleanequals(Object obj)HostInfogetActiveHost()Deprecated.UseactiveHost()instead.intgetPartition()Deprecated.Usepartition()instead.Set<HostInfo>getStandbyHosts()Deprecated.UsestandbyHosts()instead.inthashCode()intpartition()Get the store partition corresponding to the key.Set<HostInfo>standbyHosts()Get the Kafka Streams instances that host the key as standbys.StringtoString()
-
-
-
Field Detail
-
NOT_AVAILABLE
public static final KeyQueryMetadata NOT_AVAILABLE
Sentinel to indicate that the KeyQueryMetadata is currently unavailable. This can occur during rebalance operations.
-
-
Method Detail
-
getActiveHost
@Deprecated public HostInfo getActiveHost()
Deprecated.UseactiveHost()instead.Get the active Kafka Streams instance for given key.- Returns:
- active instance's
HostInfo
-
getStandbyHosts
@Deprecated public Set<HostInfo> getStandbyHosts()
Deprecated.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
-
getPartition
@Deprecated public int getPartition()
Deprecated.Usepartition()instead.Get the store partition corresponding to the key.- Returns:
- store partition number
-
activeHost
public HostInfo activeHost()
Get the active Kafka Streams instance for given key.- Returns:
- active instance's
HostInfo
-
standbyHosts
public Set<HostInfo> standbyHosts()
Get the Kafka Streams instances that host the key as standbys.- Returns:
- set of standby
HostInfoor a empty set, if no standbys are configured
-
partition
public int partition()
Get the store partition corresponding to the key.- Returns:
- store partition number
-
-