Package com.yahoo.vespa.model.search
Class SearchNode
- java.lang.Object
-
- com.yahoo.config.model.producer.AbstractConfigProducer<AbstractConfigProducer<?>>
-
- com.yahoo.vespa.model.AbstractService
-
- com.yahoo.vespa.model.search.SearchNode
-
- All Implemented Interfaces:
com.yahoo.cloud.config.filedistribution.FiledistributorrpcConfig.Producer
,com.yahoo.config.ConfigInstance.Producer
,com.yahoo.metrics.MetricsmanagerConfig.Producer
,com.yahoo.searchlib.TranslogserverConfig.Producer
,com.yahoo.vespa.config.search.core.ProtonConfig.Producer
,ConfigProducer
,NetworkPortRequestor
,SearchInterface
,Service
,java.io.Serializable
public class SearchNode extends AbstractService implements SearchInterface, com.yahoo.vespa.config.search.core.ProtonConfig.Producer, com.yahoo.cloud.config.filedistribution.FiledistributorrpcConfig.Producer, com.yahoo.metrics.MetricsmanagerConfig.Producer, com.yahoo.searchlib.TranslogserverConfig.Producer
Represents a search node (proton).Due to the current disconnect between StorageNode and SearchNode, we have to duplicate the set of RestartConfigs classes from StorageNode here, as SearchNode runs in a content/storage node context without this being immediately obvious in the model.
- Author:
- arnej27959, hmusum
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SearchNode.Builder
-
Field Summary
-
Fields inherited from class com.yahoo.vespa.model.AbstractService
portsMeta
-
Fields inherited from class com.yahoo.config.model.producer.AbstractConfigProducer
log
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
allocatePorts(int start, PortAllocBridge from)
allocate the ports you needstatic SearchNode
create(AbstractConfigProducer parent, java.lang.String name, int distributionKey, NodeSpec nodeSpec, java.lang.String clusterName, AbstractService serviceLayerService, boolean flushOnShutdown, java.util.Optional<Tuning> tuning, java.util.Optional<ResourceLimits> resourceLimits, boolean isHostedVespa, boolean combined)
java.lang.String
getClusterName()
void
getConfig(com.yahoo.cloud.config.filedistribution.FiledistributorrpcConfig.Builder builder)
void
getConfig(com.yahoo.metrics.MetricsmanagerConfig.Builder builder)
void
getConfig(com.yahoo.searchlib.TranslogserverConfig.Builder builder)
void
getConfig(com.yahoo.vespa.config.search.core.ProtonConfig.Builder builder)
java.util.HashMap<java.lang.String,java.lang.String>
getDefaultMetricDimensions()
Overridden by subclasses.int
getDistributionKey()
int
getHealthPort()
The service HTTP port for health statusNodeSpec
getNodeSpec()
int
getPortCount()
Returns the number of ports needed by 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
getRpcPort()
Returns the RPC port used by this searchnode.AbstractService
getServiceLayerService()
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.void
setRedundancy(int redundancy)
void
setSearchableCopies(int searchableCopies)
void
setTls(TransactionLogServer tls)
java.lang.String
toString()
-
Methods inherited from class com.yahoo.vespa.model.AbstractService
appendJvmOptions, distributeCpuSocketAffinity, getAffinity, getCoreOnOOM, getCoreOnOOMEnvVariable, getEnvVariables, getHost, getHostName, getHostResource, getId, getIndex, getJvmOptions, getMMapNoCoreEnvVariable, getMMapNoCoreLimit, getNoVespaMalloc, getNoVespaMallocEnvVariable, getNumPortsAllocated, getPortsMeta, getPreLoad, getRelativePort, getServiceInfo, getServiceName, getServicePropertyString, getServicePropertyString, getVespaMalloc, getVespaMallocDebug, getVespaMallocDebugEnvVariable, getVespaMallocDebugStackTrace, getVespaMallocDebugStackTraceEnvVariable, getVespaMallocEnvVariable, getWantedPort, initService, isInitialized, prependJvmOptions, requiresWantedPort, sendFile, sendUri, setAffinity, setBasePort, setCoreOnOOM, setHostResource, setJvmOptions, setMMapNoCoreLimit, setNoVespaMalloc, setPreLoad, setProp, setProp, setVespaMalloc, setVespaMallocDebug, setVespaMallocDebugStackTrace
-
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
-
Methods inherited from interface com.yahoo.vespa.model.search.SearchInterface
getHostName
-
-
-
-
Method Detail
-
create
public static SearchNode create(AbstractConfigProducer parent, java.lang.String name, int distributionKey, NodeSpec nodeSpec, java.lang.String clusterName, AbstractService serviceLayerService, boolean flushOnShutdown, java.util.Optional<Tuning> tuning, java.util.Optional<ResourceLimits> resourceLimits, boolean isHostedVespa, boolean combined)
-
getClusterName
public java.lang.String getClusterName()
-
setSearchableCopies
public void setSearchableCopies(int searchableCopies)
-
setRedundancy
public void setRedundancy(int redundancy)
-
getNodeSpec
public NodeSpec getNodeSpec()
- Specified by:
getNodeSpec
in interfaceSearchInterface
-
allocatePorts
public void allocatePorts(int start, PortAllocBridge from)
Description copied from interface:NetworkPortRequestor
allocate the ports you need- Specified by:
allocatePorts
in interfaceNetworkPortRequestor
-
getPortCount
public int getPortCount()
Returns the number of ports needed by this service.- Specified by:
getPortCount
in interfaceNetworkPortRequestor
- Returns:
- The number of ports.
-
getRpcPort
public int getRpcPort()
Returns the RPC port used by this searchnode.- Returns:
- The port.
-
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
- Returns:
- portnumber
-
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
-
getDistributionKey
public int getDistributionKey()
-
getConfig
public void getConfig(com.yahoo.searchlib.TranslogserverConfig.Builder builder)
- Specified by:
getConfig
in interfacecom.yahoo.searchlib.TranslogserverConfig.Producer
-
toString
public java.lang.String toString()
- Overrides:
toString
in classAbstractService
-
setTls
public void setTls(TransactionLogServer tls)
-
getServiceLayerService
public AbstractService getServiceLayerService()
-
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.
-
getConfig
public void getConfig(com.yahoo.cloud.config.filedistribution.FiledistributorrpcConfig.Builder builder)
- Specified by:
getConfig
in interfacecom.yahoo.cloud.config.filedistribution.FiledistributorrpcConfig.Producer
-
getConfig
public void getConfig(com.yahoo.vespa.config.search.core.ProtonConfig.Builder builder)
- Specified by:
getConfig
in interfacecom.yahoo.vespa.config.search.core.ProtonConfig.Producer
-
getDefaultMetricDimensions
public java.util.HashMap<java.lang.String,java.lang.String> getDefaultMetricDimensions()
Description copied from class:AbstractService
Overridden by subclasses. List of default dimensions to be added to this services metrics- Specified by:
getDefaultMetricDimensions
in interfaceService
- Overrides:
getDefaultMetricDimensions
in classAbstractService
- Returns:
- The default dimensions for this service
-
getConfig
public void getConfig(com.yahoo.metrics.MetricsmanagerConfig.Builder builder)
- Specified by:
getConfig
in interfacecom.yahoo.metrics.MetricsmanagerConfig.Producer
-
getPreShutdownCommand
public java.util.Optional<java.lang.String> getPreShutdownCommand()
Description copied from interface:Service
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.- Specified by:
getPreShutdownCommand
in interfaceService
- Overrides:
getPreShutdownCommand
in classAbstractService
-
-