Package alluxio.wire

Class Address

  • All Implemented Interfaces:
    java.io.Serializable

    @NotThreadSafe
    public final class Address
    extends java.lang.Object
    implements java.io.Serializable
    The address of a node.
    See Also:
    Serialized Form
    • Constructor Detail

      • Address

        public Address()
        Creates a new instance of Address.
      • Address

        public Address​(java.lang.String hostname,
                       int rpcPort)
        Creates a new instance of Address.
        Parameters:
        hostname - the hostname to set
        rpcPort - the rpc port to set
      • Address

        protected Address​(alluxio.grpc.NetAddress netAddress)
        Creates a new instance of Address from proto representation.
        Parameters:
        netAddress - the proto master address
    • Method Detail

      • getHost

        public java.lang.String getHost()
        Returns:
        the host of this node
      • getRpcPort

        public int getRpcPort()
        Returns:
        the RPC port of this node
      • setHost

        public Address setHost​(java.lang.String host)
        Parameters:
        host - the host to use
        Returns:
        the address
      • setRpcPort

        public Address setRpcPort​(int rpcPort)
        Parameters:
        rpcPort - the rpc port to use
        Returns:
        the address
      • toProto

        public alluxio.grpc.NetAddress toProto()
        Returns:
        a master address of proto construct
      • fromProto

        public static Address fromProto​(alluxio.grpc.NetAddress address)
        Creates a new instance of Address from proto representation.
        Parameters:
        address - the proto representation of a master address
        Returns:
        the instance
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object