Package org.apache.kafka.streams.state
Class HostInfo
- java.lang.Object
-
- org.apache.kafka.streams.state.HostInfo
-
public class HostInfo extends Object
Represents 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.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static HostInfobuildFromEndpoint(String endPoint)booleanequals(Object o)inthashCode()Stringhost()intport()StringtoString()static HostInfounavailable()
-
-
-
Constructor Detail
-
HostInfo
public HostInfo(String host, int port)
-
-
Method Detail
-
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.
-
host
public String host()
-
port
public int port()
-
-