Package org.apache.kafka.streams.state
Class StreamsMetadata
- java.lang.Object
-
- org.apache.kafka.streams.state.StreamsMetadata
-
public class StreamsMetadata extends Object
Represents the state of an instance (process) in aKafkaStreams
application. It contains the user suppliedHostInfo
that can be used by developers to build APIs and services to connect to other instances, the Set of state stores available on the instance and the Set ofTopicPartition
s available on the instance. NOTE: This is a point in time view. It may change when rebalances happen.
-
-
Field Summary
Fields Modifier and Type Field Description static StreamsMetadata
NOT_AVAILABLE
Sentinel to indicate that the StreamsMetadata is currently unavailable.
-
Constructor Summary
Constructors Constructor Description StreamsMetadata(HostInfo hostInfo, Set<String> stateStoreNames, Set<TopicPartition> topicPartitions, Set<String> standbyStateStoreNames, Set<TopicPartition> standbyTopicPartitions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
int
hashCode()
String
host()
HostInfo
hostInfo()
The value ofStreamsConfig.APPLICATION_SERVER_CONFIG
configured for the streams instance, which is typically host/portint
port()
Set<String>
standbyStateStoreNames()
State stores owned by the instance as a standby replicaSet<TopicPartition>
standbyTopicPartitions()
(Source) Topic partitions for which the instance acts as standby.Set<String>
stateStoreNames()
State stores owned by the instance as an active replicaSet<TopicPartition>
topicPartitions()
Topic partitions consumed by the instance as an active replicaString
toString()
-
-
-
Field Detail
-
NOT_AVAILABLE
public static final StreamsMetadata NOT_AVAILABLE
Sentinel to indicate that the StreamsMetadata is currently unavailable. This can occur during rebalance operations.
-
-
Constructor Detail
-
StreamsMetadata
public StreamsMetadata(HostInfo hostInfo, Set<String> stateStoreNames, Set<TopicPartition> topicPartitions, Set<String> standbyStateStoreNames, Set<TopicPartition> standbyTopicPartitions)
-
-
Method Detail
-
hostInfo
public HostInfo hostInfo()
The value ofStreamsConfig.APPLICATION_SERVER_CONFIG
configured for the streams instance, which is typically host/port- Returns:
HostInfo
corresponding to the streams instance
-
stateStoreNames
public Set<String> stateStoreNames()
State stores owned by the instance as an active replica- Returns:
- set of active state store names
-
topicPartitions
public Set<TopicPartition> topicPartitions()
Topic partitions consumed by the instance as an active replica- Returns:
- set of active topic partitions
-
standbyTopicPartitions
public Set<TopicPartition> standbyTopicPartitions()
(Source) Topic partitions for which the instance acts as standby.- Returns:
- set of standby topic partitions
-
standbyStateStoreNames
public Set<String> standbyStateStoreNames()
State stores owned by the instance as a standby replica- Returns:
- set of standby state store names
-
host
public String host()
-
port
public int port()
-
-