Class Service
- java.lang.Object
-
- com.yahoo.config.model.producer.AbstractConfigProducer<AbstractConfigProducer<?>>
-
- com.yahoo.vespa.model.AbstractService
-
- com.yahoo.vespa.model.generic.service.Service
-
- All Implemented Interfaces:
com.yahoo.config.ConfigInstance.Producer
,ConfigProducer
,NetworkPortRequestor
,Service
,java.io.Serializable
public class Service extends AbstractService
An application specific generic service- Author:
- vegardh
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.yahoo.vespa.model.AbstractService
portsMeta
-
Fields inherited from class com.yahoo.config.model.producer.AbstractConfigProducer
log
-
-
Constructor Summary
Constructors Constructor Description Service(ServiceCluster parent, java.lang.String id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
allocatePorts(int start, PortAllocBridge from)
allocate the ports you needprotected int
getIndex(HostResource host)
Different services are represented using same class here, so we must take service name into account tooint
getPortCount()
Returns the number of ports needed by this service.java.lang.String
getServiceType()
Returns the type of service.java.lang.String
getStartupCommand()
Must be overridden by services that should be started by config-sentinel.-
Methods inherited from class com.yahoo.vespa.model.AbstractService
appendJvmOptions, defaultPreload, distributeCpuSocketAffinity, getAffinity, getCoreOnOOM, getCoreOnOOMEnvVariable, getDefaultMetricDimensions, getEnvVariables, getHealthPort, getHost, getHostName, getHostResource, getId, getJvmOptions, getMMapNoCoreEnvVariable, getMMapNoCoreLimit, getNoVespaMalloc, getNoVespaMallocEnvVariable, getNumPortsAllocated, getOmpNumThreads, getOmpNumThreadsEnvVariable, getPortsMeta, getPreLoad, getPreShutdownCommand, getRelativePort, getServiceInfo, getServiceName, getServicePropertyString, getServicePropertyString, getVespaMalloc, getVespaMallocDebug, getVespaMallocDebugEnvVariable, getVespaMallocDebugStackTrace, getVespaMallocDebugStackTraceEnvVariable, getVespaMallocEnvVariable, getWantedPort, initService, isInitialized, prependJvmOptions, remove, requiresWantedPort, send, setAffinity, setBasePort, setCoreOnOOM, setHostResource, setJvmOptions, setMMapNoCoreLimit, setNoVespaMalloc, setOmpNumThreads, setPreLoad, setProp, setProp, setVespaMalloc, setVespaMallocDebug, setVespaMallocDebugStackTrace, toString
-
Methods inherited from class com.yahoo.config.model.producer.AbstractConfigProducer
addChild, addConfigId, addDescendantService, addUserConfig, cascadeConfig, dump, getChildren, getChildrenByTypeRecursive, getConfigClassLoader, getConfigId, getDescendantServices, getMonitoringService, getParent, getRoot, getSubId, getUserConfigs, hostSystem, mergeUserConfigs, removeChild, setParent, setUserConfigs, stateIsHosted, validate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
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
getConfigId
-
-
-
-
Constructor Detail
-
Service
public Service(ServiceCluster parent, java.lang.String id)
-
-
Method Detail
-
getPortCount
public int getPortCount()
Description copied from interface:NetworkPortRequestor
Returns the number of ports needed by this service. User-defined ports for container http servers should not be counted, as those ports are required to be outside Vespa's port range.
-
allocatePorts
public void allocatePorts(int start, PortAllocBridge from)
Description copied from interface:NetworkPortRequestor
allocate the ports you need
-
getStartupCommand
public java.lang.String getStartupCommand()
Description copied from class:AbstractService
Must be overridden by services that should be started by config-sentinel. The returned value will be used in config-sentinel configuration. Returns null by default.- Specified by:
getStartupCommand
in interfaceService
- Overrides:
getStartupCommand
in classAbstractService
- Returns:
- null by default.
-
getIndex
protected int getIndex(HostResource host)
Different services are represented using same class here, so we must take service name into account too- Overrides:
getIndex
in classAbstractService
- Parameters:
host
- a host- Returns:
- the index of the host
-
getServiceType
public java.lang.String getServiceType()
Description copied from class:AbstractService
Returns the type of service. This is the class name without the package prefix by default, never null- Specified by:
getServiceType
in interfaceNetworkPortRequestor
- Overrides:
getServiceType
in classAbstractService
-
-