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 aKafkaStreams
application. It contains the activeHostInfo
and a set of standbyHostInfo
s, 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 KeyQueryMetadata
NOT_AVAILABLE
Sentinel 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 Modifier and Type Method Description boolean
equals(Object obj)
HostInfo
getActiveHost()
Get the Active streams instance for given keyint
getPartition()
Get the Store partition corresponding to the key.Set<HostInfo>
getStandbyHosts()
Get the Streams instances that host the key as standbysint
hashCode()
String
toString()
-
-
-
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
public HostInfo getActiveHost()
Get the Active streams instance for given key- Returns:
- active instance's
HostInfo
-
getStandbyHosts
public Set<HostInfo> getStandbyHosts()
Get the Streams instances that host the key as standbys- Returns:
- set of standby
HostInfo
or a empty set, if no standbys are configured
-
getPartition
public int getPartition()
Get the Store partition corresponding to the key.- Returns:
- store partition number
-
-