Package alluxio.wire
Class Address
- java.lang.Object
-
- alluxio.wire.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 Summary
Constructors Modifier Constructor Description Address()
Creates a new instance ofAddress
.protected
Address(alluxio.grpc.NetAddress netAddress)
Creates a new instance ofAddress
from proto representation.Address(java.lang.String hostname, int rpcPort)
Creates a new instance ofAddress
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
static Address
fromProto(alluxio.grpc.NetAddress address)
Creates a new instance ofAddress
from proto representation.java.lang.String
getHost()
int
getRpcPort()
int
hashCode()
Address
setHost(java.lang.String host)
Address
setRpcPort(int rpcPort)
alluxio.grpc.NetAddress
toProto()
java.lang.String
toString()
-
-
-
Constructor Detail
-
Address
public Address()
Creates a new instance ofAddress
.
-
Address
public Address(java.lang.String hostname, int rpcPort)
Creates a new instance ofAddress
.- Parameters:
hostname
- the hostname to setrpcPort
- the rpc port to set
-
Address
protected Address(alluxio.grpc.NetAddress netAddress)
Creates a new instance ofAddress
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 ofAddress
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 classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-