java.lang.Object
org.opensearch.client.transport.httpclient5.internal.Node

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

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    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, Set<org.apache.hc.core5.http.HttpHost> boundHosts, String name, String version, Node.Roles roles, Map<String,List<String>> attributes)
    Create a Node with metadata.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Compare two nodes for equality
    Attributes declared on the node.
    Set<org.apache.hc.core5.http.HttpHost>
    Addresses on which the host is listening.
    org.apache.hc.core5.http.HttpHost
    Contact information for the host.
    The node.name of the node.
    Roles that the OpenSearch process on the host has or null if we don't know what roles the node has.
    Version of OpenSearch that the node is running or null if we don't know the version.
    int
    Calculate the hash code of the node
    Convert node to string representation

    Methods inherited from class java.lang.Object

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

    • Node

      public Node(org.apache.hc.core5.http.HttpHost host, Set<org.apache.hc.core5.http.HttpHost> boundHosts, String name, String version, Node.Roles roles, Map<String,List<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 Details

    • getHost

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

      public 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 String getName()
      The node.name of the node.
    • getVersion

      public 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 Map<String,List<String>> getAttributes()
      Attributes declared on the node.
    • toString

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

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

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