Class Node

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class Node
    extends java.lang.Object
    implements java.io.Closeable
    A node represent a node within a cluster (cluster.name). The client() can be used in order to use a Client to perform actions/operations against the cluster.
    • Field Detail

      • WRITE_PORTS_FILE_SETTING

        public static final Setting<java.lang.Boolean> WRITE_PORTS_FILE_SETTING
      • NODE_DATA_SETTING

        public static final Setting<java.lang.Boolean> NODE_DATA_SETTING
      • NODE_MASTER_SETTING

        public static final Setting<java.lang.Boolean> NODE_MASTER_SETTING
      • NODE_INGEST_SETTING

        public static final Setting<java.lang.Boolean> NODE_INGEST_SETTING
      • NODE_LOCAL_STORAGE_SETTING

        public static final Setting<java.lang.Boolean> NODE_LOCAL_STORAGE_SETTING
        controls whether the node is allowed to persist things like metadata to disk Note that this does not control whether the node stores actual indices (see NODE_DATA_SETTING). However, if this is false, NODE_DATA_SETTING and NODE_MASTER_SETTING must also be false.
      • NODE_NAME_SETTING

        public static final Setting<java.lang.String> NODE_NAME_SETTING
      • BREAKER_TYPE_KEY

        public static final Setting<java.lang.String> BREAKER_TYPE_KEY
    • Constructor Detail

      • Node

        public Node​(Settings preparedSettings)
        Constructs a node with the given settings.
        Parameters:
        preparedSettings - Base settings to configure the node with
      • Node

        protected Node​(Environment environment,
                       java.util.Collection<java.lang.Class<? extends Plugin>> classpathPlugins)
    • Method Detail

      • addNodeNameIfNeeded

        public static final Settings addNodeNameIfNeeded​(Settings settings,
                                                         java.lang.String nodeId)
        Adds a default node name to the given setting, if it doesn't already exist
        Returns:
        the given setting if node name is already set, or a new copy with a default node name set.
      • originalSettings

        public Settings originalSettings()
        The original settings that were used to create the node
      • settings

        public Settings settings()
        The settings that are used by this node. Contains original settings as well as additional settings provided by plugins.
      • client

        public Client client()
        A client that can be used to execute actions (operations) against the cluster.
      • getEnvironment

        public Environment getEnvironment()
        Returns the environment of the node
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • isClosed

        public boolean isClosed()
        Returns true if the node is closed.
      • validateNodeBeforeAcceptingRequests

        protected void validateNodeBeforeAcceptingRequests​(BootstrapContext context,
                                                           BoundTransportAddress boundTransportAddress,
                                                           java.util.List<BootstrapCheck> bootstrapChecks)
                                                    throws NodeValidationException
        Hook for validating the node after network services are started but before the cluster service is started and before the network service starts accepting incoming network requests.
        Parameters:
        context - the bootstrap context for this node
        boundTransportAddress - the network addresses the node is bound and publishing to
        Throws:
        NodeValidationException