Package com.yahoo.vespa.model
Class HostResource
java.lang.Object
com.yahoo.vespa.model.HostResource
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionHostResource(Host host) Create a newHostResourcebound to a specificHost.HostResource(Host host, com.yahoo.config.provision.HostSpec spec) -
Method Summary
Modifier and TypeMethodDescriptioncom.yahoo.config.provision.NodeResourcesThe total advertised resources of this node, typically matching what's requested.intCompares by the index of the primary membership, if both hosts are members in at least one cluster at this time.intcompareTo(HostResource other) booleangetHost()Return the currently boundHost.com.yahoo.config.model.api.HostInfogetService(String sentinelName) Returns the service with the given "sentinel name" on this Host, or null if the name does not match any service.Returns a List of all services running on this Host.inthashCode()ports()com.yahoo.config.provision.NodeResourcesThe real resources available for Vespa processes on this node, after subtracting infrastructure overhead.com.yahoo.config.provision.HostSpecspec()toString()
-
Constructor Details
-
HostResource
Create a newHostResourcebound to a specificHost.- Parameters:
host-Hostobject to bind to.
-
HostResource
-
-
Method Details
-
getHost
Return the currently boundHost.- Returns:
- the
Hostif bound, null if not.
-
ports
-
spec
public com.yahoo.config.provision.HostSpec spec() -
getService
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
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
-
getHostname
-
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareToin interfaceComparable<HostResource>
-
comparePrimarilyByIndexTo
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.
-