public class DiscoveryNode extends java.lang.Object implements Writeable<DiscoveryNode>, ToXContent
Modifier and Type | Class and Description |
---|---|
static class |
DiscoveryNode.Role
Enum that holds all the possible roles that that a node can fulfill in a cluster.
|
Writeable.Reader<R>
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
EMPTY_PARAMS
Constructor and Description |
---|
DiscoveryNode(StreamInput in)
Creates a new
DiscoveryNode by reading from the stream provided as argument |
DiscoveryNode(java.lang.String nodeName,
java.lang.String nodeId,
java.lang.String hostName,
java.lang.String hostAddress,
TransportAddress address,
java.util.Map<java.lang.String,java.lang.String> attributes,
java.util.Set<DiscoveryNode.Role> roles,
Version version)
Creates a new
DiscoveryNode . |
DiscoveryNode(java.lang.String nodeName,
java.lang.String nodeId,
TransportAddress address,
java.util.Map<java.lang.String,java.lang.String> attributes,
java.util.Set<DiscoveryNode.Role> roles,
Version version)
Creates a new
DiscoveryNode |
DiscoveryNode(java.lang.String nodeId,
TransportAddress address,
java.util.Map<java.lang.String,java.lang.String> attributes,
java.util.Set<DiscoveryNode.Role> roles,
Version version)
Creates a new
DiscoveryNode |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
TransportAddress |
getAddress()
The address that the node can be communicated with.
|
java.util.Map<java.lang.String,java.lang.String> |
getAttributes()
The node attributes.
|
java.lang.String |
getHostAddress() |
java.lang.String |
getHostName() |
java.lang.String |
getId()
The unique id of the node.
|
java.lang.String |
getName()
The name of the node.
|
java.util.Set<DiscoveryNode.Role> |
getRoles()
Returns a set of all the roles that the node fulfills.
|
Version |
getVersion() |
int |
hashCode() |
boolean |
isDataNode()
Should this node hold data (shards) or not.
|
static boolean |
isDataNode(Settings settings) |
boolean |
isIngestNode()
Returns a boolean that tells whether this an ingest node or not
|
static boolean |
isIngestNode(Settings settings) |
static boolean |
isLocalNode(Settings settings) |
boolean |
isMasterNode()
Can this node become master or not.
|
static boolean |
isMasterNode(Settings settings) |
static boolean |
nodeRequiresLocalStorage(Settings settings) |
DiscoveryNode |
readFrom(StreamInput in)
Reads an object of this type from the provided StreamInput.
|
java.lang.String |
toString() |
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
void |
writeTo(StreamOutput out)
Write this into the StreamOutput.
|
public DiscoveryNode(StreamInput in) throws java.io.IOException
DiscoveryNode
by reading from the stream provided as argumentin
- the streamjava.io.IOException
- if there is an error while reading from the streampublic DiscoveryNode(java.lang.String nodeId, TransportAddress address, java.util.Map<java.lang.String,java.lang.String> attributes, java.util.Set<DiscoveryNode.Role> roles, Version version)
DiscoveryNode
Note: if the version of the node is unknown Version.minimumCompatibilityVersion()
should be used for the current
version. 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 addressattributes
- node attributesroles
- node rolesversion
- the version of the node.public DiscoveryNode(java.lang.String nodeName, java.lang.String nodeId, TransportAddress address, java.util.Map<java.lang.String,java.lang.String> attributes, java.util.Set<DiscoveryNode.Role> roles, Version version)
DiscoveryNode
Note: if the version of the node is unknown Version.minimumCompatibilityVersion()
should be used for the current
version. 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 attributesroles
- node rolesversion
- the version of the node.public DiscoveryNode(java.lang.String nodeName, java.lang.String nodeId, java.lang.String hostName, java.lang.String hostAddress, TransportAddress address, java.util.Map<java.lang.String,java.lang.String> attributes, java.util.Set<DiscoveryNode.Role> roles, Version version)
DiscoveryNode
.
Note: if the version of the node is unknown Version.minimumCompatibilityVersion()
should be used for the current
version. 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 attributesroles
- node rolesversion
- the version of the node.public static boolean isLocalNode(Settings settings)
public static boolean nodeRequiresLocalStorage(Settings settings)
public static boolean isMasterNode(Settings settings)
public static boolean isDataNode(Settings settings)
public static boolean isIngestNode(Settings settings)
public TransportAddress getAddress()
public java.lang.String getId()
public java.lang.String getName()
public java.util.Map<java.lang.String,java.lang.String> getAttributes()
public boolean isDataNode()
public boolean isMasterNode()
public boolean isIngestNode()
public java.util.Set<DiscoveryNode.Role> getRoles()
public Version getVersion()
public java.lang.String getHostName()
public java.lang.String getHostAddress()
public DiscoveryNode readFrom(StreamInput in) throws java.io.IOException
StreamableReader
readFrom
in interface StreamableReader<DiscoveryNode>
readFrom
in interface Writeable<DiscoveryNode>
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Writeable
writeTo
in interface Writeable<DiscoveryNode>
java.io.IOException
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent
in interface ToXContent
java.io.IOException