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
ConstructorDescriptionHostResource
(Host host) Create a newHostResource
bound to a specificHost
.HostResource
(Host host, com.yahoo.config.provision.HostSpec spec) -
Method Summary
Modifier and TypeMethodDescriptioncom.yahoo.config.provision.NodeResources
The total advertised resources of this node, typically matching what's requested.int
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
getHost()
Return the currently boundHost
.com.yahoo.config.model.api.HostInfo
getService
(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.int
hashCode()
ports()
com.yahoo.config.provision.NodeResources
The real resources available for Vespa processes on this node, after subtracting infrastructure overhead.com.yahoo.config.provision.HostSpec
spec()
toString()
-
Constructor Details
-
HostResource
Create a newHostResource
bound to a specificHost
.- Parameters:
host
-Host
object to bind to.
-
HostResource
-
-
Method Details
-
getHost
Return the currently boundHost
.- Returns:
- the
Host
if 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:
compareTo
in 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.
-