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 aKafkaStreams
application. 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 seeStreamsPartitionAssignor
It is extracted from the configStreamsConfig.APPLICATION_SERVER_CONFIG
If 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 HostInfo
buildFromEndpoint(String endPoint)
boolean
equals(Object o)
int
hashCode()
String
host()
int
port()
String
toString()
static HostInfo
unavailable()
-
-
-
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()
-
-