Class StreamsMetadata


  • public class StreamsMetadata
    extends java.lang.Object
    Represents the state of an instance (process) in a KafkaStreams application. It contains the user supplied HostInfo 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 of TopicPartitions 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, java.util.Set<java.lang.String> stateStoreNames, java.util.Set<org.apache.kafka.common.TopicPartition> topicPartitions, java.util.Set<java.lang.String> standbyStateStoreNames, java.util.Set<org.apache.kafka.common.TopicPartition> standbyTopicPartitions)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      int hashCode()  
      java.lang.String host()  
      HostInfo hostInfo()
      The value of StreamsConfig.APPLICATION_SERVER_CONFIG configured for the streams instance, which is typically host/port
      int port()  
      java.util.Set<java.lang.String> standbyStateStoreNames()
      State stores owned by the instance as a standby replica
      java.util.Set<org.apache.kafka.common.TopicPartition> standbyTopicPartitions()
      (Source) Topic partitions for which the instance acts as standby.
      java.util.Set<java.lang.String> stateStoreNames()
      State stores owned by the instance as an active replica
      java.util.Set<org.apache.kafka.common.TopicPartition> topicPartitions()
      Topic partitions consumed by the instance as an active replica
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • 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,
                               java.util.Set<java.lang.String> stateStoreNames,
                               java.util.Set<org.apache.kafka.common.TopicPartition> topicPartitions,
                               java.util.Set<java.lang.String> standbyStateStoreNames,
                               java.util.Set<org.apache.kafka.common.TopicPartition> standbyTopicPartitions)
    • Method Detail

      • stateStoreNames

        public java.util.Set<java.lang.String> stateStoreNames()
        State stores owned by the instance as an active replica
        Returns:
        set of active state store names
      • topicPartitions

        public java.util.Set<org.apache.kafka.common.TopicPartition> topicPartitions()
        Topic partitions consumed by the instance as an active replica
        Returns:
        set of active topic partitions
      • standbyTopicPartitions

        public java.util.Set<org.apache.kafka.common.TopicPartition> standbyTopicPartitions()
        (Source) Topic partitions for which the instance acts as standby.
        Returns:
        set of standby topic partitions
      • standbyStateStoreNames

        public java.util.Set<java.lang.String> standbyStateStoreNames()
        State stores owned by the instance as a standby replica
        Returns:
        set of standby state store names
      • host

        public java.lang.String host()
      • port

        public int port()
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object