org.elasticsearch.cluster.node
Class DiscoveryNode

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

public class DiscoveryNode
extends Object
implements Streamable, Serializable

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

See Also:
Serialized Form

Field Summary
static com.google.common.collect.ImmutableList<DiscoveryNode> EMPTY_LIST
           
 
Constructor Summary
DiscoveryNode(String nodeName, String nodeId, TransportAddress address, Map<String,String> attributes)
           
DiscoveryNode(String nodeId, TransportAddress address)
           
 
Method Summary
 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 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 isMasterNode()
          Can this node become master or not.
 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()
           
 Version version()
           
 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 com.google.common.collect.ImmutableList<DiscoveryNode> EMPTY_LIST
Constructor Detail

DiscoveryNode

public DiscoveryNode(String nodeId,
                     TransportAddress address)

DiscoveryNode

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

nodeRequiresLocalStorage

public static boolean nodeRequiresLocalStorage(Settings settings)

clientNode

public static boolean clientNode(Settings settings)

masterNode

public static boolean masterNode(Settings settings)

dataNode

public static boolean dataNode(Settings settings)

shouldConnectTo

public boolean shouldConnectTo(DiscoveryNode otherNode)
Should this node form a connection to the provided node.


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 String id()
The unique id of the node.


getId

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


name

public String name()
The name of the node.


getName

public String getName()
The name of the node.


attributes

public com.google.common.collect.ImmutableMap<String,String> attributes()
The node attributes.


getAttributes

public com.google.common.collect.ImmutableMap<String,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.


version

public Version version()

getVersion

public Version getVersion()

readNode

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

readFrom

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

writeTo

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

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2012. All Rights Reserved.