Class HostResource

java.lang.Object
com.yahoo.vespa.model.HostResource
All Implemented Interfaces:
Comparable<HostResource>

public class HostResource extends Object implements Comparable<HostResource>
A host representation. The identity of this is the identity of its Host. TODO: Merge with Host Host resources are ordered by their host order.
Author:
Ulf Lilleengen
  • Constructor Details

    • HostResource

      public HostResource(Host host)
      Create a new HostResource bound to a specific Host.
      Parameters:
      host - Host object to bind to.
    • HostResource

      public HostResource(Host host, com.yahoo.config.provision.HostSpec spec)
  • Method Details

    • getHost

      public Host getHost()
      Return the currently bound Host.
      Returns:
      the Host if bound, null if not.
    • ports

      public HostPorts ports()
    • spec

      public com.yahoo.config.provision.HostSpec spec()
    • getService

      public Service getService(String sentinelName)
      Returns the service with the given "sentinel name" on this Host, or null if the name does not match any service.
      Parameters:
      sentinelName - the sentinel name of the service we want to return
      Returns:
      the service with the given sentinel name
    • getServices

      public List<Service> getServices()
      Returns a List of all services running on this Host.
    • getHostInfo

      public com.yahoo.config.model.api.HostInfo getHostInfo()
    • realResources

      public com.yahoo.config.provision.NodeResources realResources()
      The real resources available for Vespa processes on this node, after subtracting infrastructure overhead.
    • advertisedResources

      public com.yahoo.config.provision.NodeResources advertisedResources()
      The total advertised resources of this node, typically matching what's requested.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getHostname

      public String getHostname()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • compareTo

      public int compareTo(HostResource other)
      Specified by:
      compareTo in interface Comparable<HostResource>
    • comparePrimarilyByIndexTo

      public int comparePrimarilyByIndexTo(HostResource other)
      Compares by the index of the primary membership, if both hosts are members in at least one cluster at this time. Compare by hostname otherwise.