Package com.yahoo.vespa.model
Interface Service
-
- All Superinterfaces:
com.yahoo.config.ConfigInstance.Producer
,ConfigProducer
,NetworkPortRequestor
- All Known Implementing Classes:
AbstractService
,ApplicationContainer
,ClusterControllerContainer
,ConfigProxy
,ConfigSentinel
,Configserver
,Container
,ContentNode
,Distributor
,Logd
,LogForwarder
,Logserver
,LogserverContainer
,MetricsProxyContainer
,SearchNode
,Service
,Slobrok
,StorageNode
,TransactionLogServer
public interface Service extends ConfigProducer, NetworkPortRequestor
Representation of a process which runs a service- Author:
- gjoranv
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Optional<Affinity>
getAffinity()
Return the Affinity of this service if it has.java.util.HashMap<java.lang.String,java.lang.String>
getDefaultMetricDimensions()
int
getHealthPort()
Host
getHost()
java.lang.String
getHostName()
java.lang.String
getJvmOptions()
Optional JVM execution options for this servicePortsMeta
getPortsMeta()
Returns a PortsMeta object, giving access to more information about the different ports of this service.java.util.Optional<java.lang.String>
getPreShutdownCommand()
Services that wish that a command should be run before shutdown should return the command here.int
getRelativePort(int i)
Computes and returns the i'th port for this service, based on this Service's baseport.com.yahoo.config.model.api.ServiceInfo
getServiceInfo()
Get meta information about service.java.lang.String
getServicePropertyString(java.lang.String key, java.lang.String defStr)
Gets a service property value mapped to the given key as a String, or the value indefStr
if no such key exists.java.lang.String
getStartupCommand()
Services that should be started by config-sentinel must return non-null.-
Methods inherited from interface com.yahoo.vespa.model.ConfigProducer
addUserConfig, cascadeConfig, dump, getChildren, getConfigId, getDescendantServices, getUserConfigs, hostSystem, validate
-
Methods inherited from interface com.yahoo.vespa.model.NetworkPortRequestor
allocatePorts, getConfigId, getPortCount, getServiceName, getServiceType, getWantedPort, requiresWantedPort
-
-
-
-
Method Detail
-
getStartupCommand
java.lang.String getStartupCommand()
Services that should be started by config-sentinel must return non-null. The returned value will be used in config-sentinel configuration. TODO: Should change this to Optional of String
-
getPreShutdownCommand
java.util.Optional<java.lang.String> getPreShutdownCommand()
Services that wish that a command should be run before shutdown should return the command here. The command will be executed by the config sentinel before sending SIGTERM to the service. The command is executed without a timeout.
-
getPortsMeta
PortsMeta getPortsMeta()
Returns a PortsMeta object, giving access to more information about the different ports of this service.
-
getHost
Host getHost()
- Returns:
- the physical host on which this service runs.
-
getServiceInfo
com.yahoo.config.model.api.ServiceInfo getServiceInfo()
Get meta information about service.- Returns:
- an instance of
ServiceInfo
-
getHostName
java.lang.String getHostName()
- Returns:
- The hostname on which this service runs.
-
getJvmOptions
java.lang.String getJvmOptions()
Optional JVM execution options for this service
-
getRelativePort
int getRelativePort(int i)
Computes and returns the i'th port for this service, based on this Service's baseport.- Parameters:
i
- The offset from 'basePort' of the port to return- Returns:
- the i'th port relative to the base port.
- Throws:
java.lang.IllegalStateException
- if i is out of range.
-
getServicePropertyString
java.lang.String getServicePropertyString(java.lang.String key, java.lang.String defStr)
Gets a service property value mapped to the given key as a String, or the value indefStr
if no such key exists.- Parameters:
key
- a key used for lookup in the service propertiesdefStr
- default String value returned if no value for key found- Returns:
- the associated String value for the given key, or
-
getHealthPort
int getHealthPort()
-
getDefaultMetricDimensions
java.util.HashMap<java.lang.String,java.lang.String> getDefaultMetricDimensions()
- Returns:
- HashMap of default dimensions for metrics.
-
-