Class ContainerCluster<CONTAINER extends 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.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 AbstractConfigProducer<AbstractConfigProducer<?>>
    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
    Parent class for all container cluster types.
    Author:
    gjoranv, Einar M R Rosenvinge, Tony Vaagenes
    See Also:
    Serialized Form
    • Field Detail

      • RESERVED_URI_PREFIX

        public static final String RESERVED_URI_PREFIX
        URI prefix used for internal, usually programmatic, APIs. URIs using this prefix should never 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:
        Constant Field Values
      • BINDINGS_OVERVIEW_HANDLER_CLASS

        public static final String BINDINGS_OVERVIEW_HANDLER_CLASS
      • LOG_HANDLER_CLASS

        public static final String LOG_HANDLER_CLASS
      • STATE_HANDLER_BINDING_1

        public static final BindingPattern STATE_HANDLER_BINDING_1
      • STATE_HANDLER_BINDING_2

        public static final BindingPattern STATE_HANDLER_BINDING_2
      • ROOT_HANDLER_BINDING

        public static final BindingPattern ROOT_HANDLER_BINDING
      • VIP_HANDLER_BINDING

        public static final BindingPattern VIP_HANDLER_BINDING
    • Method Detail

      • 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()
      • 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

        public final void addComponent​(Component<?,​?> component)
      • addSimpleComponent

        public final void addSimpleComponent​(String idSpec,
                                             String classSpec,
                                             String bundleSpec)
      • removeComponent

        public Component removeComponent​(com.yahoo.component.ComponentId componentId)
        Removes a component by id
        Returns:
        the removed component, or null if it was not present
      • addSimpleComponent

        protected void addSimpleComponent​(String className)
      • prepare

        public void prepare​(DeployState deployState)
      • doPrepare

        protected abstract void doPrepare​(DeployState deployState)
      • getName

        public String getName()
      • addContainer

        public void addContainer​(CONTAINER container)
      • setHttp

        public void setHttp​(Http http)
      • getHttp

        public Http getHttp()
      • setSecretStore

        public void setSecretStore​(SecretStore secretStore)
      • getComponentsMap

        public Map<com.yahoo.component.ComponentId,​Component<?,​?>> getComponentsMap()
      • getAllComponents

        public Collection<Component<?,​?>> getAllComponents()
        Returns all components in this cluster (generic, handlers, chained)
      • getConfig

        public void getConfig​(com.yahoo.container.ComponentsConfig.Builder builder)
        Specified by:
        getConfig in interface com.yahoo.container.ComponentsConfig.Producer
      • getConfig

        public void getConfig​(com.yahoo.container.jdisc.JdiscBindingsConfig.Builder builder)
        Specified by:
        getConfig in interface com.yahoo.container.jdisc.JdiscBindingsConfig.Producer
      • getConfig

        public void getConfig​(com.yahoo.document.config.DocumentmanagerConfig.Builder builder)
        Specified by:
        getConfig in interface com.yahoo.document.config.DocumentmanagerConfig.Producer
      • getConfig

        public void getConfig​(com.yahoo.container.core.document.ContainerDocumentConfig.Builder builder)
        Specified by:
        getConfig in interface com.yahoo.container.core.document.ContainerDocumentConfig.Producer
      • getConfig

        public void getConfig​(com.yahoo.container.jdisc.config.HealthMonitorConfig.Builder builder)
        Specified by:
        getConfig in interface com.yahoo.container.jdisc.config.HealthMonitorConfig.Producer
      • getConfig

        public void getConfig​(com.yahoo.container.core.ApplicationMetadataConfig.Builder builder)
        Specified by:
        getConfig in interface com.yahoo.container.core.ApplicationMetadataConfig.Producer
      • addCommonVespaBundles

        public void addCommonVespaBundles()
        Adds the Vespa bundles that are necessary for all container types.
      • addPlatformBundle

        public final void addPlatformBundle​(Path bundlePath)
        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'
      • getConfig

        public void getConfig​(com.yahoo.container.di.config.PlatformBundlesConfig.Builder builder)
        Specified by:
        getConfig in interface com.yahoo.container.di.config.PlatformBundlesConfig.Producer
      • getConfig

        public void getConfig​(com.yahoo.container.QrSearchersConfig.Builder builder)
        Specified by:
        getConfig in interface com.yahoo.container.QrSearchersConfig.Producer
      • getConfig

        public void getConfig​(com.yahoo.search.config.QrStartConfig.Builder builder)
        Specified by:
        getConfig in interface com.yahoo.search.config.QrStartConfig.Producer
      • getConfig

        public void getConfig​(com.yahoo.config.docproc.DocprocConfig.Builder builder)
        Specified by:
        getConfig in interface com.yahoo.config.docproc.DocprocConfig.Producer
      • getConfig

        public void getConfig​(com.yahoo.search.pagetemplates.PageTemplatesConfig.Builder builder)
        Specified by:
        getConfig in interface com.yahoo.search.pagetemplates.PageTemplatesConfig.Producer
      • getConfig

        public void getConfig​(com.yahoo.prelude.semantics.SemanticRulesConfig.Builder builder)
        Specified by:
        getConfig in interface com.yahoo.prelude.semantics.SemanticRulesConfig.Producer
      • getConfig

        public void getConfig​(com.yahoo.search.query.profile.config.QueryProfilesConfig.Builder builder)
        Specified by:
        getConfig in interface com.yahoo.search.query.profile.config.QueryProfilesConfig.Producer
      • getConfig

        public void getConfig​(com.yahoo.config.docproc.SchemamappingConfig.Builder builder)
        Specified by:
        getConfig in interface com.yahoo.config.docproc.SchemamappingConfig.Producer
      • getConfig

        public void getConfig​(com.yahoo.search.config.IndexInfoConfig.Builder builder)
        Specified by:
        getConfig in interface com.yahoo.search.config.IndexInfoConfig.Producer
      • addDefaultSearchAccessLog

        public void addDefaultSearchAccessLog()
      • getConfig

        public void getConfig​(com.yahoo.vespa.configdefinition.IlscriptsConfig.Builder builder)
        Specified by:
        getConfig in interface com.yahoo.vespa.configdefinition.IlscriptsConfig.Producer
      • getConfig

        public void getConfig​(com.yahoo.cloud.config.ClusterInfoConfig.Builder builder)
        Specified by:
        getConfig in interface com.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 interface com.yahoo.cloud.config.ConfigserverConfig.Producer
      • getConfig

        public void getConfig​(com.yahoo.cloud.config.CuratorConfig.Builder builder)
        Specified by:
        getConfig in interface com.yahoo.cloud.config.CuratorConfig.Producer
      • isHostedVespa

        public boolean isHostedVespa()
      • concreteDocumentTypes

        public Map<String,​String> concreteDocumentTypes()
      • serviceAliases

        public List<String> serviceAliases()
        The configured service aliases for the service in this cluster
      • endpointAliases

        public List<String> endpointAliases()
        The configured endpoint aliases (fqdn) for the service in this cluster
      • setHostClusterId

        public void setHostClusterId​(String clusterId)
      • getHostClusterId

        public Optional<String> 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

        public void setJvmGCOptions​(String opts)
      • setEnvironmentVars

        public void setEnvironmentVars​(String environmentVars)
      • getEnvironmentVars

        public String getEnvironmentVars()
      • setRpcServerEnabled

        public final void setRpcServerEnabled​(boolean rpcServerEnabled)
      • setHttpServerEnabled

        public void setHttpServerEnabled​(boolean httpServerEnabled)
      • messageBusEnabled

        protected abstract boolean messageBusEnabled()
      • 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

        public Optional<Integer> 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.