org.elasticsearch.cluster.node
Class DiscoveryNode

java.lang.Object
  extended by org.elasticsearch.cluster.node.DiscoveryNode
All Implemented Interfaces:
java.io.Serializable, Streamable

public class DiscoveryNode
extends java.lang.Object
implements Streamable, java.io.Serializable

A discovery node represents a node that is part of the cluster.

See Also:
Serialized Form

Field Summary
static org.elasticsearch.common.collect.ImmutableList<DiscoveryNode> EMPTY_LIST
           
 
Constructor Summary
DiscoveryNode(java.lang.String nodeName, java.lang.String nodeId, TransportAddress address, java.util.Map<java.lang.String,java.lang.String> attributes)
           
DiscoveryNode(java.lang.String nodeId, TransportAddress address)
           
 
Method Summary
 TransportAddress address()
          The address that the node can be communicated with.
 org.elasticsearch.common.collect.ImmutableMap<java.lang.String,java.lang.String> attributes()
          The node attributes.
static java.util.Map<java.lang.String,java.lang.String> buildCommonNodesAttributes(Settings settings)
           
 boolean clientNode()
          Is the node a client node or not.
 boolean dataNode()
          Should this node hold data (shards) or not.
 boolean equals(java.lang.Object obj)
           
 TransportAddress getAddress()
          The address that the node can be communicated with.
 org.elasticsearch.common.collect.ImmutableMap<java.lang.String,java.lang.String> getAttributes()
          The node attributes.
 java.lang.String getId()
          The unique id of the node.
 java.lang.String getName()
          The name of the node.
 int hashCode()
           
 java.lang.String id()
          The unique id of the node.
 boolean isClientNode()
           
 boolean isDataNode()
          Should this node hold data (shards) or not.
 boolean isMasterNode()
          Can this node become master or not.
 boolean masterNode()
          Can this node become master or not.
 java.lang.String name()
          The name of the node.
 void readFrom(StreamInput in)
           
static DiscoveryNode readNode(StreamInput in)
           
 java.lang.String toString()
           
 void writeTo(StreamOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY_LIST

public static final org.elasticsearch.common.collect.ImmutableList<DiscoveryNode> EMPTY_LIST
Constructor Detail

DiscoveryNode

public DiscoveryNode(java.lang.String nodeId,
                     TransportAddress address)

DiscoveryNode

public DiscoveryNode(java.lang.String nodeName,
                     java.lang.String nodeId,
                     TransportAddress address,
                     java.util.Map<java.lang.String,java.lang.String> attributes)
Method Detail

buildCommonNodesAttributes

public static java.util.Map<java.lang.String,java.lang.String> buildCommonNodesAttributes(Settings settings)

address

public TransportAddress address()
The address that the node can be communicated with.


getAddress

public TransportAddress getAddress()
The address that the node can be communicated with.


id

public java.lang.String id()
The unique id of the node.


getId

public java.lang.String getId()
The unique id of the node.


name

public java.lang.String name()
The name of the node.


getName

public java.lang.String getName()
The name of the node.


attributes

public org.elasticsearch.common.collect.ImmutableMap<java.lang.String,java.lang.String> attributes()
The node attributes.


getAttributes

public org.elasticsearch.common.collect.ImmutableMap<java.lang.String,java.lang.String> getAttributes()
The node attributes.


dataNode

public boolean dataNode()
Should this node hold data (shards) or not.


isDataNode

public boolean isDataNode()
Should this node hold data (shards) or not.


clientNode

public boolean clientNode()
Is the node a client node or not.


isClientNode

public boolean isClientNode()

masterNode

public boolean masterNode()
Can this node become master or not.


isMasterNode

public boolean isMasterNode()
Can this node become master or not.


readNode

public static DiscoveryNode readNode(StreamInput in)
                              throws java.io.IOException
Throws:
java.io.IOException

readFrom

public void readFrom(StreamInput in)
              throws java.io.IOException
Specified by:
readFrom in interface Streamable
Throws:
java.io.IOException

writeTo

public void writeTo(StreamOutput out)
             throws java.io.IOException
Specified by:
writeTo in interface Streamable
Throws:
java.io.IOException

equals

public boolean equals(java.lang.Object obj)
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