Package org.apache.kafka.streams.state
Class HostInfo
- java.lang.Object
-
- org.apache.kafka.streams.state.HostInfo
-
public class HostInfo extends java.lang.ObjectRepresents a user defined endpoint in aKafkaStreamsapplication. Instances of this class can be obtained by calling one of:KafkaStreams.allMetadata()KafkaStreams.allMetadataForStore(String)KafkaStreams.metadataForKey(String, Object, StreamPartitioner)KafkaStreams.metadataForKey(String, Object, Serializer)The HostInfo is constructed during Partition Assignment seeStreamsPartitionAssignorIt is extracted from the configStreamsConfig.APPLICATION_SERVER_CONFIGIf developers wish to expose an endpoint in their KafkaStreams applications they should provide the above config.
-
-
Constructor Summary
Constructors Constructor Description HostInfo(java.lang.String host, int port)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static HostInfobuildFromEndpoint(java.lang.String endPoint)booleanequals(java.lang.Object o)inthashCode()java.lang.Stringhost()intport()java.lang.StringtoString()static HostInfounavailable()
-
-
-
Method Detail
-
buildFromEndpoint
public static HostInfo buildFromEndpoint(java.lang.String endPoint)
- Returns:
- a new HostInfo or null if endPoint is null or has no characters
- Throws:
org.apache.kafka.common.config.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(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
host
public java.lang.String host()
-
port
public int port()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-