Class Node


  • public class Node
    extends java.lang.Object
    Metadata about an HttpHost running OpenSearch.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Node.Roles
      Role information about an OpenSearch process.
    • Constructor Summary

      Constructors 
      Constructor Description
      Node​(org.apache.hc.core5.http.HttpHost host)
      Create a Node without any metadata.
      Node​(org.apache.hc.core5.http.HttpHost host, java.util.Set<org.apache.hc.core5.http.HttpHost> boundHosts, java.lang.String name, java.lang.String version, Node.Roles roles, java.util.Map<java.lang.String,​java.util.List<java.lang.String>> attributes)
      Create a Node with metadata.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)
      Compare two nodes for equality
      java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getAttributes()
      Attributes declared on the node.
      java.util.Set<org.apache.hc.core5.http.HttpHost> getBoundHosts()
      Addresses on which the host is listening.
      org.apache.hc.core5.http.HttpHost getHost()
      Contact information for the host.
      java.lang.String getName()
      The node.name of the node.
      Node.Roles getRoles()
      Roles that the OpenSearch process on the host has or null if we don't know what roles the node has.
      java.lang.String getVersion()
      Version of OpenSearch that the node is running or null if we don't know the version.
      int hashCode()
      Calculate the hash code of the node
      java.lang.String toString()
      Convert node to string representation
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Node

        public Node​(org.apache.hc.core5.http.HttpHost host,
                    java.util.Set<org.apache.hc.core5.http.HttpHost> boundHosts,
                    java.lang.String name,
                    java.lang.String version,
                    Node.Roles roles,
                    java.util.Map<java.lang.String,​java.util.List<java.lang.String>> attributes)
        Create a Node with metadata. All parameters except host are nullable and implementations of NodeSelector need to decide what to do in their absence.
        Parameters:
        host - primary host address
        boundHosts - addresses on which the host is listening
        name - name of the node
        version - version of OpenSearch
        roles - roles that the OpenSearch process has on the host
        attributes - attributes declared on the node
      • Node

        public Node​(org.apache.hc.core5.http.HttpHost host)
        Create a Node without any metadata.
        Parameters:
        host - primary host address
    • Method Detail

      • getHost

        public org.apache.hc.core5.http.HttpHost getHost()
        Contact information for the host.
      • getBoundHosts

        public java.util.Set<org.apache.hc.core5.http.HttpHost> getBoundHosts()
        Addresses on which the host is listening. These are useful to have around because they allow you to find a host based on any address it is listening on.
      • getName

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

        public java.lang.String getVersion()
        Version of OpenSearch that the node is running or null if we don't know the version.
      • getRoles

        public Node.Roles getRoles()
        Roles that the OpenSearch process on the host has or null if we don't know what roles the node has.
      • getAttributes

        public java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getAttributes()
        Attributes declared on the node.
      • toString

        public java.lang.String toString()
        Convert node to string representation
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Compare two nodes for equality
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - node instance to compare with
      • hashCode

        public int hashCode()
        Calculate the hash code of the node
        Overrides:
        hashCode in class java.lang.Object