Class HostInfo

java.lang.Object
org.apache.kafka.streams.state.HostInfo

public class HostInfo extends Object
Represents a user defined endpoint in a KafkaStreams application. Instances of this class can be obtained by calling one of: KafkaStreams.metadataForAllStreamsClients() KafkaStreams.streamsMetadataForStore(String) The HostInfo is constructed during Partition Assignment see StreamsPartitionAssignor It is extracted from the config StreamsConfig.APPLICATION_SERVER_CONFIG If developers wish to expose an endpoint in their KafkaStreams applications they should provide the above config.
  • Constructor Details

    • HostInfo

      public HostInfo(String host, int port)
  • Method Details

    • buildFromEndpoint

      public static HostInfo buildFromEndpoint(String endPoint)
      Returns:
      a new HostInfo or null if endPoint is null or has no characters
      Throws:
      ConfigException - if the host or port cannot be parsed from the given endpoint string
    • unavailable

      public static HostInfo unavailable()
      Returns:
      a sentinel for cases where the host metadata is currently unavailable, eg during rebalance operations.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • host

      public String host()
    • port

      public int port()
    • toString

      public String toString()
      Overrides:
      toString in class Object