Package com.yahoo.vespa.model
Class ConfigSentinel
- java.lang.Object
-
- com.yahoo.config.model.producer.AbstractConfigProducer<AbstractConfigProducer<?>>
-
- com.yahoo.vespa.model.AbstractService
-
- com.yahoo.vespa.model.ConfigSentinel
-
- All Implemented Interfaces:
com.yahoo.cloud.config.SentinelConfig.Producer
,com.yahoo.config.ConfigInstance.Producer
,ConfigProducer
,NetworkPortRequestor
,Service
,Serializable
public class ConfigSentinel extends AbstractService implements com.yahoo.cloud.config.SentinelConfig.Producer
There is one config-sentinel running on each Vespa host, and one instance of this class is therefore created by each instance of classHost
.- Author:
- gjoranv
- 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 ConfigSentinel(Host host, com.yahoo.config.provision.ApplicationId applicationId, com.yahoo.config.provision.Zone zone, com.yahoo.config.model.api.ModelContext.FeatureFlags featureFlags)
Constructs a new ConfigSentinel for the given host.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
allocatePorts(int start, PortAllocBridge from)
allocate the ports you needvoid
getConfig(com.yahoo.cloud.config.SentinelConfig.Builder builder)
int
getHealthPort()
The service HTTP port for health statusint
getPortCount()
Returns the number of ports needed by this service.String
getServiceType()
Overrides parent method as this is named config-sentinel and not configsentinel all over Vespaint
getWantedPort()
Returns the desired base port for this service.boolean
requiresWantedPort()
The desired base port is the only allowed base port.-
Methods inherited from class com.yahoo.vespa.model.AbstractService
appendJvmOptions, defaultPreload, distributeCpuSocketAffinity, getAffinity, getCoreOnOOM, getCoreOnOOMEnvVariable, getDefaultMetricDimensions, getEnvVariables, getHost, getHostName, getHostResource, getId, getIndex, getJvmOptions, getMMapNoCoreEnvVariable, getMMapNoCoreLimit, getNoVespaMalloc, getNoVespaMallocEnvVariable, getNumPortsAllocated, getOmpNumThreads, getOmpNumThreadsEnvVariable, getPortsMeta, getPreLoad, getPreShutdownCommand, getRelativePort, getServiceInfo, getServiceName, getServicePropertyString, getServicePropertyString, getStartupCommand, getVespaMalloc, getVespaMallocDebug, getVespaMallocDebugEnvVariable, getVespaMallocDebugStackTrace, getVespaMallocDebugStackTraceEnvVariable, getVespaMallocEnvVariable, initService, isInitialized, prependJvmOptions, remove, 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
-
ConfigSentinel
public ConfigSentinel(Host host, com.yahoo.config.provision.ApplicationId applicationId, com.yahoo.config.provision.Zone zone, com.yahoo.config.model.api.ModelContext.FeatureFlags featureFlags)
Constructs a new ConfigSentinel for the given host.- Parameters:
host
- Physical host on which to run.
-
-
Method Detail
-
allocatePorts
public void allocatePorts(int start, PortAllocBridge from)
Description copied from interface:NetworkPortRequestor
allocate the ports you need- Specified by:
allocatePorts
in interfaceNetworkPortRequestor
-
getWantedPort
public int getWantedPort()
Returns the desired base port for this service.- Specified by:
getWantedPort
in interfaceNetworkPortRequestor
- Overrides:
getWantedPort
in classAbstractService
- Returns:
- The desired base port for the first instance of the service type.
-
requiresWantedPort
public boolean requiresWantedPort()
The desired base port is the only allowed base port.- Specified by:
requiresWantedPort
in interfaceNetworkPortRequestor
- Overrides:
requiresWantedPort
in classAbstractService
- Returns:
- false by default
-
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.- Specified by:
getPortCount
in interfaceNetworkPortRequestor
- Returns:
- The number of ports reserved by the Sentinel.
-
getHealthPort
public int getHealthPort()
Description copied from class:AbstractService
The service HTTP port for health status- Specified by:
getHealthPort
in interfaceService
- Overrides:
getHealthPort
in classAbstractService
-
getServiceType
public String getServiceType()
Overrides parent method as this is named config-sentinel and not configsentinel all over Vespa- Specified by:
getServiceType
in interfaceNetworkPortRequestor
- Overrides:
getServiceType
in classAbstractService
- Returns:
- service type for config-sentinel
-
getConfig
public void getConfig(com.yahoo.cloud.config.SentinelConfig.Builder builder)
- Specified by:
getConfig
in interfacecom.yahoo.cloud.config.SentinelConfig.Producer
-
-