Package org.apache.kafka.common
Class Node
- java.lang.Object
-
- org.apache.kafka.common.Node
-
public class Node extends java.lang.ObjectInformation about a Kafka node
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)inthashCode()booleanhasRack()True if this node has a defined rackjava.lang.Stringhost()The host name for this nodeintid()The node id of this nodejava.lang.StringidString()String representation of the node id.booleanisEmpty()Check whether this node is empty, which may be the case if noNode() is used as a placeholder in a response payload with an error.static NodenoNode()intport()The port for this nodejava.lang.Stringrack()The rack for this nodejava.lang.StringtoString()
-
-
-
Method Detail
-
noNode
public static Node noNode()
-
isEmpty
public boolean isEmpty()
Check whether this node is empty, which may be the case if noNode() is used as a placeholder in a response payload with an error.- Returns:
- true if it is, false otherwise
-
id
public int id()
The node id of this node
-
idString
public java.lang.String idString()
String representation of the node id. Typically the integer id is used to serialize over the wire, the string representation is used as an identifier with NetworkClient code
-
host
public java.lang.String host()
The host name for this node
-
port
public int port()
The port for this node
-
hasRack
public boolean hasRack()
True if this node has a defined rack
-
rack
public java.lang.String rack()
The rack for this node
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-