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 more ReplicaIds upon each device.
    • Field Detail

      • UNKNOWN_PORT

        static final int UNKNOWN_PORT
        Can be used for DataNodeId 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 the Port of this node to connect to.
        Returns:
        Port to which the caller can connect to, or a Port with number UNKNOWN_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 interface java.lang.Comparable<DataNodeId>