Package com.github.ambry.clustermap
Interface DataNodeId
-
- All Superinterfaces:
java.lang.Comparable<DataNodeId>
,Resource
public interface DataNodeId extends Resource, java.lang.Comparable<DataNodeId>
A DataNodeId has many devices. A DataNodeId stores one or moreReplicaId
s upon each device.
-
-
Field Summary
Fields Modifier and Type Field Description static int
UNKNOWN_PORT
Can be used forDataNodeId
objects that represent in-process entities without a real port.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default int
compareTo(DataNodeId o)
java.lang.String
getDatacenterName()
Gets the DataNodeId's datacenterjava.lang.String
getHostname()
Gets the hostname of this DataNodeId.int
getHttp2Port()
Gets the DataNodeId's HTTP2 connection port number.int
getPort()
Gets the DataNodeId's connection port number.Port
getPortToConnectTo()
Returns thePort
of this node to connect to.java.lang.String
getRackId()
Get the DataNodeId's server rack ID.int
getSSLPort()
Gets the DataNodeId's SSL connection port number.HardwareState
getState()
Gets the state of the DataNodeId.long
getXid()
Get the xid associated with this node.boolean
hasHttp2Port()
Returns true if HTTP2 port exists for the DataNodeId.boolean
hasSSLPort()
Returns true if SSL port exists for the DataNodeId.-
Methods inherited from interface com.github.ambry.clustermap.Resource
getSnapshot
-
-
-
-
Field Detail
-
UNKNOWN_PORT
static final int UNKNOWN_PORT
Can be used forDataNodeId
objects that represent in-process entities without a real port.- See Also:
- Constant Field Values
-
-
Method Detail
-
getHostname
java.lang.String getHostname()
Gets the hostname of this DataNodeId.- Returns:
- fully qualified domain name of the DataNodeId.
-
getPort
int getPort()
Gets the DataNodeId's connection port number.- Returns:
- Port number upon which to establish a connection with the DataNodeId, or
UNKNOWN_PORT
if this data node cannot be connected to via a socket. This behavior differs from other "optional" ports since many callers currently require this method to return without throwing exceptions for logging purposes.
-
getSSLPort
int getSSLPort()
Gets the DataNodeId's SSL connection port number.- Returns:
- Port number upon which to establish an SSL encrypted connection with the DataNodeId.
-
hasSSLPort
boolean hasSSLPort()
Returns true if SSL port exists for the DataNodeId.- Returns:
- true if SSL port exists for the datanode, false otherwise.
-
getHttp2Port
int getHttp2Port()
Gets the DataNodeId's HTTP2 connection port number.- Returns:
- Port number upon which to establish an HTTP2 SSL connection with the DataNodeId.
-
hasHttp2Port
boolean hasHttp2Port()
Returns true if HTTP2 port exists for the DataNodeId.- Returns:
- true if HTTP2 port exists for the datanode, false otherwise.
-
getPortToConnectTo
Port getPortToConnectTo()
Returns thePort
of this node to connect to.- Returns:
Port
to which the caller can connect to, or aPort
with numberUNKNOWN_PORT
if this data node cannot be connected to via a socket.
-
getState
HardwareState getState()
Gets the state of the DataNodeId.- Returns:
- state of the DataNodeId.
-
getDatacenterName
java.lang.String getDatacenterName()
Gets the DataNodeId's datacenter- Returns:
- name of the Datacenter
-
getRackId
java.lang.String getRackId()
Get the DataNodeId's server rack ID. This is a unique identifier for a failure zone. If there is no rack ID for this node, null will be returned, so the caller must check that the returned value is non-null- Returns:
- a valid rack ID, or null if no rack ID is assigned
-
getXid
long getXid()
Get the xid associated with this node. The xid marks a change number.- Returns:
- the xid associated with this node.
-
compareTo
default int compareTo(DataNodeId o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<DataNodeId>
-
-