Class HostResource

  • All Implemented Interfaces:
    java.lang.Comparable<HostResource>

    public class HostResource
    extends java.lang.Object
    implements java.lang.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
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      com.yahoo.config.provision.NodeResources advertisedResources()
      The total advertised resources of this node, typically matching what's requested.
      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.
      int compareTo​(HostResource other)  
      boolean equals​(java.lang.Object other)  
      java.util.Optional<com.yahoo.config.provision.Flavor> getFlavor()
      Deprecated.
      Host getHost()
      Return the currently bounded Host.
      com.yahoo.config.model.api.HostInfo getHostInfo()  
      java.lang.String getHostname()  
      Service getService​(java.lang.String sentinelName)
      Returns the service with the given "sentinel name" on this Host, or null if the name does not match any service.
      java.util.List<Service> getServices()
      Returns a List of all services running on this Host.
      int hashCode()  
      HostPorts ports()  
      com.yahoo.config.provision.NodeResources realResources()
      The real resources available for Vespa processes on this node, after subtracting infrastructure overhead.
      com.yahoo.config.provision.HostSpec spec()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • 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 Detail

      • getHost

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

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

        public Service getService​(java.lang.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 java.util.List<Service> getServices()
        Returns a List of all services running on this Host.
      • getHostInfo

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

        @Deprecated
        public java.util.Optional<com.yahoo.config.provision.Flavor> getFlavor()
        Deprecated.
        Returns the flavor of this resource. Empty for self-hosted Vespa.
      • 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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getHostname

        public java.lang.String getHostname()
      • hashCode

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

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • compareTo

        public int compareTo​(HostResource other)
        Specified by:
        compareTo in interface java.lang.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.