Package com.yahoo.vespa.model.container
Class ContainerCluster<CONTAINER extends Container>
java.lang.Object
com.yahoo.config.model.producer.AnyConfigProducer
com.yahoo.config.model.producer.TreeConfigProducer<AnyConfigProducer>
com.yahoo.vespa.model.container.ContainerCluster<CONTAINER>
- All Implemented Interfaces:
com.yahoo.cloud.config.ClusterInfoConfig.Producer
,com.yahoo.cloud.config.ConfigserverConfig.Producer
,com.yahoo.cloud.config.CuratorConfig.Producer
,com.yahoo.config.ConfigInstance.Producer
,com.yahoo.config.docproc.DocprocConfig.Producer
,com.yahoo.config.docproc.SchemamappingConfig.Producer
,com.yahoo.container.ComponentsConfig.Producer
,com.yahoo.container.core.ApplicationMetadataConfig.Producer
,com.yahoo.container.core.document.ContainerDocumentConfig.Producer
,com.yahoo.container.di.config.PlatformBundlesConfig.Producer
,com.yahoo.container.jdisc.config.HealthMonitorConfig.Producer
,com.yahoo.container.jdisc.JdiscBindingsConfig.Producer
,com.yahoo.container.QrSearchersConfig.Producer
,com.yahoo.document.config.DocumentmanagerConfig.Producer
,com.yahoo.prelude.semantics.SemanticRulesConfig.Producer
,com.yahoo.search.config.IndexInfoConfig.Producer
,com.yahoo.search.config.QrStartConfig.Producer
,com.yahoo.search.config.SchemaInfoConfig.Producer
,com.yahoo.search.pagetemplates.PageTemplatesConfig.Producer
,com.yahoo.search.query.profile.config.QueryProfilesConfig.Producer
,com.yahoo.vespa.configdefinition.IlscriptsConfig.Producer
,ConfigProducer
,Serializable
- Direct Known Subclasses:
ApplicationContainerCluster
,ClusterControllerContainerCluster
,LogserverContainerCluster
,MetricsProxyContainerCluster
public abstract class ContainerCluster<CONTAINER extends Container>
extends TreeConfigProducer<AnyConfigProducer>
implements com.yahoo.container.ComponentsConfig.Producer, com.yahoo.container.jdisc.JdiscBindingsConfig.Producer, com.yahoo.document.config.DocumentmanagerConfig.Producer, com.yahoo.container.core.document.ContainerDocumentConfig.Producer, com.yahoo.container.jdisc.config.HealthMonitorConfig.Producer, com.yahoo.container.core.ApplicationMetadataConfig.Producer, com.yahoo.container.di.config.PlatformBundlesConfig.Producer, com.yahoo.search.config.IndexInfoConfig.Producer, com.yahoo.vespa.configdefinition.IlscriptsConfig.Producer, com.yahoo.config.docproc.SchemamappingConfig.Producer, com.yahoo.container.QrSearchersConfig.Producer, com.yahoo.search.config.QrStartConfig.Producer, com.yahoo.search.query.profile.config.QueryProfilesConfig.Producer, com.yahoo.search.pagetemplates.PageTemplatesConfig.Producer, com.yahoo.prelude.semantics.SemanticRulesConfig.Producer, com.yahoo.config.docproc.DocprocConfig.Producer, com.yahoo.cloud.config.ClusterInfoConfig.Producer, com.yahoo.cloud.config.ConfigserverConfig.Producer, com.yahoo.cloud.config.CuratorConfig.Producer, com.yahoo.search.config.SchemaInfoConfig.Producer
Parent class for all container cluster types.
- Author:
- gjoranv, Einar M R Rosenvinge, Tony Vaagenes
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
protected final boolean
static final String
static final String
static final String
URI prefix used for internal, usually programmatic, APIs.static final BindingPattern
static final String
static final BindingPattern
static final BindingPattern
static final String
static final BindingPattern
Fields inherited from class com.yahoo.config.model.producer.AnyConfigProducer
log
-
Constructor Summary
ConstructorDescriptionContainerCluster
(TreeConfigProducer<?> parent, String configSubId, String clusterId, DeployState deployState, boolean zooKeeperLocalhostAffinity) ContainerCluster
(TreeConfigProducer<?> parent, String configSubId, String clusterId, DeployState deployState, boolean zooKeeperLocalhostAffinity, int defaultPoolNumThreads) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAccessLog
(String clusterName) void
addAccessLog
(String fileNamePattern, String symlinkName) protected void
addAccessLog
(Optional<String> clusterName) void
Add all search/docproc/feed related platform bundles.void
void
Adds the Vespa bundles that are necessary for most container types.final void
addComponent
(Component<?, ?> component) void
addContainer
(CONTAINER container) void
addContainers
(Collection<CONTAINER> containers) final void
void
void
void
final void
addPlatformBundle
(Path bundlePath) Adds a bundle present at a known location at the target container nodes.void
void
addSimpleComponent
(Class<?> clazz) protected void
addSimpleComponent
(String className) final void
addSimpleComponent
(String idSpec, String classSpec, String bundleSpec) void
boolean
protected void
doPrepare
(DeployState deployState) getAdmin()
Collection<Component<?,
?>> Returns all components in this cluster (generic, handlers, chained)void
getConfig
(com.yahoo.cloud.config.ClusterInfoConfig.Builder builder) void
getConfig
(com.yahoo.cloud.config.ConfigserverConfig.Builder builder) Returns a config server config containing the right zone settings (and defaults for the rest).void
getConfig
(com.yahoo.cloud.config.CuratorConfig.Builder builder) void
getConfig
(com.yahoo.config.docproc.DocprocConfig.Builder builder) void
getConfig
(com.yahoo.config.docproc.SchemamappingConfig.Builder builder) void
getConfig
(com.yahoo.container.ComponentsConfig.Builder builder) void
getConfig
(com.yahoo.container.core.ApplicationMetadataConfig.Builder builder) void
getConfig
(com.yahoo.container.core.document.ContainerDocumentConfig.Builder builder) void
getConfig
(com.yahoo.container.di.config.PlatformBundlesConfig.Builder builder) void
getConfig
(com.yahoo.container.jdisc.config.HealthMonitorConfig.Builder builder) void
getConfig
(com.yahoo.container.jdisc.JdiscBindingsConfig.Builder builder) void
getConfig
(com.yahoo.container.QrSearchersConfig.Builder builder) void
getConfig
(com.yahoo.document.config.DocumentmanagerConfig.Builder builder) void
getConfig
(com.yahoo.prelude.semantics.SemanticRulesConfig.Builder builder) void
getConfig
(com.yahoo.search.config.IndexInfoConfig.Builder builder) void
getConfig
(com.yahoo.search.config.QrStartConfig.Builder builder) void
getConfig
(com.yahoo.search.config.SchemaInfoConfig.Builder builder) void
getConfig
(com.yahoo.search.pagetemplates.PageTemplatesConfig.Builder builder) void
getConfig
(com.yahoo.search.query.profile.config.QueryProfilesConfig.Builder builder) void
getConfig
(com.yahoo.vespa.configdefinition.IlscriptsConfig.Builder builder) boolean
Returns the id of the content cluster which hosts this container cluster, if any.getHttp()
Returns the percentage of host physical memory this application has specified for nodes in this cluster, or empty if this is not specified by the application.getName()
com.yahoo.config.provision.Zone
getZone()
com.yahoo.config.provision.ClusterSpec.Id
id()
void
initialize
(Map<String, SearchCluster> clusterMap) boolean
protected abstract boolean
void
prepare
(DeployState deployState) Component<?,
?> removeComponent
(com.yahoo.component.ComponentId componentId) Removes a component by idvoid
removeSimpleComponent
(Class<?> clazz) void
setClients
(boolean legacyMode, List<Client> clients) void
setDeferChangesUntilRestart
(boolean deferChangesUntilRestart) Mark whether the config emitted by this cluster currently should be applied by clients already running with a previous generation of it only by restarting the consuming processes.void
setDocproc
(ContainerDocproc containerDocproc) void
setDocumentApi
(ContainerDocumentApi containerDocumentApi) void
setHostClusterId
(String clusterId) void
void
setHttpServerEnabled
(boolean httpServerEnabled) void
setJvmGCOptions
(String opts) void
setProcessingChains
(ProcessingChains processingChains, BindingPattern... serverBindings) final void
setRpcServerEnabled
(boolean rpcServerEnabled) void
setSearch
(ContainerSearch containerSearch) void
setSecretStore
(SecretStore secretStore) void
setZone
(com.yahoo.config.provision.Zone zone) toString()
Implement in subclasses to avoid installing unnecessary bundles, seePlatformBundles
Should only return constant values, as there is no guarantee for when this is called.Methods inherited from class com.yahoo.config.model.producer.TreeConfigProducer
addChild, addDescendantService, getChildren, getChildrenByTypeRecursive, getConfigClassLoader, getDescendantServices, removeChild, validate
Methods inherited from class com.yahoo.config.model.producer.AnyConfigProducer
addConfigId, addUserConfig, cascadeConfig, currentConfigId, findInheritedClassLoader, getConfigId, getMonitoringService, getParent, getRoot, getSubId, getUserConfigs, hostSystem, mergeUserConfigs, remove, setParent, setUserConfigs, stateIsHosted
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
dump
-
Field Details
-
RESERVED_URI_PREFIX
URI prefix used for internal, usually programmatic, APIs. URIs using this prefix should never be considered available for direct use by customers, and normal compatibility concerns only applies to libraries using the URIs in question, not contents served from the URIs themselves.- See Also:
-
APPLICATION_STATUS_HANDLER_CLASS
- See Also:
-
BINDINGS_OVERVIEW_HANDLER_CLASS
-
LOG_HANDLER_CLASS
-
G1GC
- See Also:
-
PARALLEL_GC
- See Also:
-
STATE_HANDLER_CLASS
- See Also:
-
STATE_HANDLER_BINDING_1
-
STATE_HANDLER_BINDING_2
-
ROOT_HANDLER_PATH
- See Also:
-
ROOT_HANDLER_BINDING
-
VIP_HANDLER_BINDING
-
containers
-
isHostedVespa
protected final boolean isHostedVespa
-
-
Constructor Details
-
ContainerCluster
public ContainerCluster(TreeConfigProducer<?> parent, String configSubId, String clusterId, DeployState deployState, boolean zooKeeperLocalhostAffinity) -
ContainerCluster
public ContainerCluster(TreeConfigProducer<?> parent, String configSubId, String clusterId, DeployState deployState, boolean zooKeeperLocalhostAffinity, int defaultPoolNumThreads)
-
-
Method Details
-
messageBusEnabled
protected abstract boolean messageBusEnabled() -
id
public com.yahoo.config.provision.ClusterSpec.Id id() -
setZone
public void setZone(com.yahoo.config.provision.Zone zone) -
getZone
public com.yahoo.config.provision.Zone getZone() -
getAdmin
-
addDefaultHandlersWithVip
public void addDefaultHandlersWithVip() -
addDefaultHandlersExceptStatus
public final void addDefaultHandlersExceptStatus() -
addMetricStateHandler
public void addMetricStateHandler() -
addDefaultRootHandler
public void addDefaultRootHandler() -
addApplicationStatusHandler
public void addApplicationStatusHandler() -
addVipHandler
public void addVipHandler() -
addComponent
-
addSimpleComponent
-
removeComponent
Removes a component by id- Returns:
- the removed component, or null if it was not present
-
removeSimpleComponent
-
addSimpleComponent
-
addSimpleComponent
-
prepare
-
doPrepare
-
getName
-
getContainers
-
addContainer
-
addContainers
-
setProcessingChains
public void setProcessingChains(ProcessingChains processingChains, BindingPattern... serverBindings) -
getSearchChains
-
getSearch
-
setSearch
-
setHttp
-
getHttp
-
setClients
-
getClients
-
clientsLegacyMode
public boolean clientsLegacyMode() -
getDocproc
-
setDocproc
-
setDocumentApi
-
getDocprocChains
-
getHandlers
-
setSecretStore
-
getSecretStore
-
getComponentsMap
-
getAllComponents
Returns all components in this cluster (generic, handlers, chained) -
getConfig
public void getConfig(com.yahoo.container.ComponentsConfig.Builder builder) - Specified by:
getConfig
in interfacecom.yahoo.container.ComponentsConfig.Producer
-
getConfig
public void getConfig(com.yahoo.container.jdisc.JdiscBindingsConfig.Builder builder) - Specified by:
getConfig
in interfacecom.yahoo.container.jdisc.JdiscBindingsConfig.Producer
-
getConfig
public void getConfig(com.yahoo.document.config.DocumentmanagerConfig.Builder builder) - Specified by:
getConfig
in interfacecom.yahoo.document.config.DocumentmanagerConfig.Producer
-
getConfig
public void getConfig(com.yahoo.container.core.document.ContainerDocumentConfig.Builder builder) - Specified by:
getConfig
in interfacecom.yahoo.container.core.document.ContainerDocumentConfig.Producer
-
getConfig
public void getConfig(com.yahoo.container.jdisc.config.HealthMonitorConfig.Builder builder) - Specified by:
getConfig
in interfacecom.yahoo.container.jdisc.config.HealthMonitorConfig.Producer
-
getConfig
public void getConfig(com.yahoo.container.core.ApplicationMetadataConfig.Builder builder) - Specified by:
getConfig
in interfacecom.yahoo.container.core.ApplicationMetadataConfig.Producer
-
addCommonVespaBundles
public void addCommonVespaBundles()Adds the Vespa bundles that are necessary for most container types. Note that some of these can be removed later by the individual cluster types. -
addAllPlatformBundles
public void addAllPlatformBundles()Add all search/docproc/feed related platform bundles. These are only required for application configured containers as the platform bundle set is not allowed to change between config generations. For standalone container platform bundles can be added on features enabled as an update of application package requires restart. -
addSearchAndDocprocBundles
public void addSearchAndDocprocBundles() -
addPlatformBundle
Adds a bundle present at a known location at the target container nodes. Note that the set of platform bundles cannot change during the jdisc container's lifetime.- Parameters:
bundlePath
- usually an absolute path, e.g. '$VESPA_HOME/lib/jars/foo.jar'
-
unnecessaryPlatformBundles
Implement in subclasses to avoid installing unnecessary bundles, seePlatformBundles
Should only return constant values, as there is no guarantee for when this is called. -
getConfig
public void getConfig(com.yahoo.container.di.config.PlatformBundlesConfig.Builder builder) - Specified by:
getConfig
in interfacecom.yahoo.container.di.config.PlatformBundlesConfig.Producer
-
getConfig
public void getConfig(com.yahoo.container.QrSearchersConfig.Builder builder) - Specified by:
getConfig
in interfacecom.yahoo.container.QrSearchersConfig.Producer
-
getConfig
public void getConfig(com.yahoo.search.config.QrStartConfig.Builder builder) - Specified by:
getConfig
in interfacecom.yahoo.search.config.QrStartConfig.Producer
-
getConfig
public void getConfig(com.yahoo.config.docproc.DocprocConfig.Builder builder) - Specified by:
getConfig
in interfacecom.yahoo.config.docproc.DocprocConfig.Producer
-
getConfig
public void getConfig(com.yahoo.search.pagetemplates.PageTemplatesConfig.Builder builder) - Specified by:
getConfig
in interfacecom.yahoo.search.pagetemplates.PageTemplatesConfig.Producer
-
getConfig
public void getConfig(com.yahoo.prelude.semantics.SemanticRulesConfig.Builder builder) - Specified by:
getConfig
in interfacecom.yahoo.prelude.semantics.SemanticRulesConfig.Producer
-
getConfig
public void getConfig(com.yahoo.search.query.profile.config.QueryProfilesConfig.Builder builder) - Specified by:
getConfig
in interfacecom.yahoo.search.query.profile.config.QueryProfilesConfig.Producer
-
getConfig
public void getConfig(com.yahoo.config.docproc.SchemamappingConfig.Builder builder) - Specified by:
getConfig
in interfacecom.yahoo.config.docproc.SchemamappingConfig.Producer
-
getConfig
public void getConfig(com.yahoo.search.config.IndexInfoConfig.Builder builder) - Specified by:
getConfig
in interfacecom.yahoo.search.config.IndexInfoConfig.Producer
-
getConfig
public void getConfig(com.yahoo.search.config.SchemaInfoConfig.Builder builder) - Specified by:
getConfig
in interfacecom.yahoo.search.config.SchemaInfoConfig.Producer
-
initialize
-
addAccessLog
-
addAccessLog
-
addAccessLog
-
getConfig
public void getConfig(com.yahoo.vespa.configdefinition.IlscriptsConfig.Builder builder) - Specified by:
getConfig
in interfacecom.yahoo.vespa.configdefinition.IlscriptsConfig.Producer
-
getConfig
public void getConfig(com.yahoo.cloud.config.ClusterInfoConfig.Builder builder) - Specified by:
getConfig
in interfacecom.yahoo.cloud.config.ClusterInfoConfig.Producer
-
getConfig
public void getConfig(com.yahoo.cloud.config.ConfigserverConfig.Builder builder) Returns a config server config containing the right zone settings (and defaults for the rest). This is useful to allow applications to find out in which zone they are running by having the Zone object (which is constructed from this config) injected.- Specified by:
getConfig
in interfacecom.yahoo.cloud.config.ConfigserverConfig.Producer
-
getConfig
public void getConfig(com.yahoo.cloud.config.CuratorConfig.Builder builder) - Specified by:
getConfig
in interfacecom.yahoo.cloud.config.CuratorConfig.Producer
-
isHostedVespa
public boolean isHostedVespa() -
concreteDocumentTypes
-
setHostClusterId
-
getHostClusterId
Returns the id of the content cluster which hosts this container cluster, if any. This is only set with hosted clusters where this container cluster is set up to run on the nodes of a content cluster. -
setJvmGCOptions
-
getJvmGCOptions
-
setRpcServerEnabled
public final void setRpcServerEnabled(boolean rpcServerEnabled) -
setHttpServerEnabled
public void setHttpServerEnabled(boolean httpServerEnabled) -
toString
-
setDeferChangesUntilRestart
public void setDeferChangesUntilRestart(boolean deferChangesUntilRestart) Mark whether the config emitted by this cluster currently should be applied by clients already running with a previous generation of it only by restarting the consuming processes. -
getDeferChangesUntilRestart
public boolean getDeferChangesUntilRestart() -
getMemoryPercentage
Returns the percentage of host physical memory this application has specified for nodes in this cluster, or empty if this is not specified by the application.
-