public class DiscoveryNode extends Object implements Streamable, ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Modifier and Type | Field and Description |
---|---|
static String |
CLIENT_ATTR |
static String |
DATA_ATTR |
static List<DiscoveryNode> |
EMPTY_LIST |
static String |
INGEST_ATTR |
static String |
MASTER_ATTR |
static Version |
MINIMUM_DISCOVERY_NODE_VERSION
Minimum version of a node to communicate with.
|
EMPTY_PARAMS
Constructor and Description |
---|
DiscoveryNode(String nodeName,
String nodeId,
String hostName,
String hostAddress,
TransportAddress address,
Map<String,String> attributes,
Version version)
Creates a new
DiscoveryNode |
DiscoveryNode(String nodeName,
String nodeId,
TransportAddress address,
Map<String,String> attributes,
Version version)
Creates a new
DiscoveryNode |
DiscoveryNode(String nodeId,
TransportAddress address,
Version version)
Creates a new
DiscoveryNode |
Modifier and Type | Method and Description |
---|---|
TransportAddress |
address()
The address that the node can be communicated with.
|
com.google.common.collect.ImmutableMap<String,String> |
attributes()
The node attributes.
|
boolean |
clientNode()
Is the node a client node or not.
|
static boolean |
clientNode(Settings settings) |
boolean |
dataNode()
Should this node hold data (shards) or not.
|
static boolean |
dataNode(Settings settings) |
boolean |
equals(Object obj) |
TransportAddress |
getAddress()
The address that the node can be communicated with.
|
com.google.common.collect.ImmutableMap<String,String> |
getAttributes()
The node attributes.
|
String |
getHostAddress() |
String |
getHostName() |
String |
getId()
The unique id of the node.
|
String |
getName()
The name of the node.
|
Version |
getVersion() |
int |
hashCode() |
String |
id()
The unique id of the node.
|
boolean |
isClientNode() |
boolean |
isDataNode()
Should this node hold data (shards) or not.
|
boolean |
isIngestNode()
Returns a boolean that tells whether this an ingest node or not
|
boolean |
isMasterNode()
Can this node become master or not.
|
static boolean |
localNode(Settings settings) |
boolean |
masterNode()
Can this node become master or not.
|
static boolean |
masterNode(Settings settings) |
String |
name()
The name of the node.
|
static boolean |
nodeRequiresLocalStorage(Settings settings) |
void |
readFrom(StreamInput in) |
static DiscoveryNode |
readNode(StreamInput in) |
boolean |
shouldConnectTo(DiscoveryNode otherNode)
Should this node form a connection to the provided node.
|
String |
toString() |
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
Version |
version() |
void |
writeTo(StreamOutput out) |
public static final Version MINIMUM_DISCOVERY_NODE_VERSION
public static final String DATA_ATTR
public static final String MASTER_ATTR
public static final String CLIENT_ATTR
public static final String INGEST_ATTR
public static final List<DiscoveryNode> EMPTY_LIST
public DiscoveryNode(String nodeId, TransportAddress address, Version version)
DiscoveryNode
Note: if the version of the node is unknown MINIMUM_DISCOVERY_NODE_VERSION
should be used.
it corresponds to the minimum version this elasticsearch version can communicate with. If a higher version is used
the node might not be able to communicate with the remove node. After initial handshakes node versions will be discovered
and updated.
nodeId
- the nodes unique id.address
- the nodes transport addressversion
- the version of the node.public DiscoveryNode(String nodeName, String nodeId, TransportAddress address, Map<String,String> attributes, Version version)
DiscoveryNode
Note: if the version of the node is unknown MINIMUM_DISCOVERY_NODE_VERSION
should be used.
it corresponds to the minimum version this elasticsearch version can communicate with. If a higher version is used
the node might not be able to communicate with the remove node. After initial handshakes node versions will be discovered
and updated.
nodeName
- the nodes namenodeId
- the nodes unique id.address
- the nodes transport addressattributes
- node attributesversion
- the version of the node.public DiscoveryNode(String nodeName, String nodeId, String hostName, String hostAddress, TransportAddress address, Map<String,String> attributes, Version version)
DiscoveryNode
Note: if the version of the node is unknown MINIMUM_DISCOVERY_NODE_VERSION
should be used.
it corresponds to the minimum version this elasticsearch version can communicate with. If a higher version is used
the node might not be able to communicate with the remove node. After initial handshakes node versions will be discovered
and updated.
nodeName
- the nodes namenodeId
- the nodes unique id.hostName
- the nodes hostnamehostAddress
- the nodes host addressaddress
- the nodes transport addressattributes
- node attributesversion
- the version of the node.public static boolean localNode(Settings settings)
public static boolean nodeRequiresLocalStorage(Settings settings)
public static boolean clientNode(Settings settings)
public static boolean masterNode(Settings settings)
public static boolean dataNode(Settings settings)
public boolean shouldConnectTo(DiscoveryNode otherNode)
public TransportAddress address()
public TransportAddress getAddress()
public String id()
public String getId()
public String name()
public String getName()
public com.google.common.collect.ImmutableMap<String,String> attributes()
public com.google.common.collect.ImmutableMap<String,String> getAttributes()
public boolean dataNode()
public boolean isDataNode()
public boolean clientNode()
public boolean isClientNode()
public boolean masterNode()
public boolean isMasterNode()
public boolean isIngestNode()
public Version version()
public String getHostName()
public String getHostAddress()
public Version getVersion()
public static DiscoveryNode readNode(StreamInput in) throws IOException
IOException
public void readFrom(StreamInput in) throws IOException
readFrom
in interface Streamable
IOException
public void writeTo(StreamOutput out) throws IOException
writeTo
in interface Streamable
IOException
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
toXContent
in interface ToXContent
IOException
Copyright © 2009–2016. All rights reserved.