Package org.apache.kafka.streams.state
Class HostInfo
- java.lang.Object
-
- org.apache.kafka.streams.state.HostInfo
-
public class HostInfo extends java.lang.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.
-
-
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 HostInfo
buildFromEndpoint(java.lang.String endPoint)
boolean
equals(java.lang.Object o)
int
hashCode()
java.lang.String
host()
int
port()
java.lang.String
toString()
static HostInfo
unavailable()
-
-
-
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:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
host
public java.lang.String host()
-
port
public int port()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-