Package com.yahoo.vespa.model
Class HostResource
- java.lang.Object
-
- com.yahoo.vespa.model.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 withHost
Host resources are ordered by their host order.- Author:
- Ulf Lilleengen
-
-
Constructor Summary
Constructors Constructor Description HostResource(Host host)
Create a newHostResource
bound to a specificHost
.HostResource(Host host, com.yahoo.config.provision.HostSpec spec)
-
Method Summary
All Methods Instance Methods Concrete 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)
Host
getHost()
Return the currently boundHost
.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()
-
-
-
Constructor Detail
-
HostResource
public HostResource(Host host)
Create a newHostResource
bound to a specificHost
.- 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 boundHost
.- Returns:
- the
Host
if bound, null if not.
-
ports
public HostPorts ports()
-
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()
-
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 classjava.lang.Object
-
getHostname
public java.lang.String getHostname()
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
compareTo
public int compareTo(HostResource other)
- Specified by:
compareTo
in interfacejava.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.
-
-