Package io.airlift.node
Class NodeInfo
- java.lang.Object
-
- io.airlift.node.NodeInfo
-
public class NodeInfo extends Object
-
-
Constructor Summary
Constructors Constructor Description NodeInfo(NodeConfig config)NodeInfo(String environment)NodeInfo(String environment, String pool, String nodeId, String internalAddress, InetAddress bindIp, String externalAddress, String location, String binarySpec, String configSpec, NodeConfig.AddressSource internalAddressSource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetBinarySpec()Binary this JavaVM is running.InetAddressgetBindIp()The IP address the server should use when binding a server socket.StringgetConfigSpec()Configuration this JavaVM is running.StringgetEnvironment()The environment in which this server is running.StringgetExternalAddress()The address to use when contacting this server from an external network.StringgetInstanceId()The unique id of this JavaVM instance.StringgetInternalAddress()The internal network address the server should use when announcing its location to other machines.StringgetLocation()Location of this JavaVM.StringgetNodeId()The unique id of the deployment slot in which this binary is running.StringgetPool()The pool of which this server is a member.longgetStartTime()The time this server was started.StringtoString()
-
-
-
Constructor Detail
-
NodeInfo
public NodeInfo(String environment)
-
NodeInfo
@Inject public NodeInfo(NodeConfig config)
-
NodeInfo
public NodeInfo(String environment, String pool, String nodeId, String internalAddress, InetAddress bindIp, String externalAddress, String location, String binarySpec, String configSpec, NodeConfig.AddressSource internalAddressSource)
-
-
Method Detail
-
getEnvironment
public String getEnvironment()
The environment in which this server is running.
-
getPool
public String getPool()
The pool of which this server is a member.
-
getNodeId
public String getNodeId()
The unique id of the deployment slot in which this binary is running. This id should represents the physical deployment location and should not change.
-
getLocation
public String getLocation()
Location of this JavaVM.
-
getBinarySpec
public String getBinarySpec()
Binary this JavaVM is running.
-
getConfigSpec
public String getConfigSpec()
Configuration this JavaVM is running.
-
getInstanceId
public String getInstanceId()
The unique id of this JavaVM instance. This id will change every time the vm is restarted.
-
getInternalAddress
public String getInternalAddress()
The internal network address the server should use when announcing its location to other machines. This address should available to all machines within the environment, but may not be globally routable. If this is not set, the following algorithm is used to choose the public address:- InetAddress.getLocalHost() if good IPv4
- First good IPv4 address of an up network interface
- First good IPv6 address of an up network interface
- InetAddress.getLocalHost()
-
getExternalAddress
public String getExternalAddress()
The address to use when contacting this server from an external network. If possible, ip address should be globally routable. The address is returned as a string because the name may not be resolvable from the local machine.If this is not set, the internal address is used.
-
getBindIp
public InetAddress getBindIp()
The IP address the server should use when binding a server socket.If this is not set, this will be the IPv4 any local address (e.g., 0.0.0.0).
-
getStartTime
public long getStartTime()
The time this server was started.
-
-