Package com.yahoo.config.model.producer
Class AnyConfigProducer
java.lang.Object
com.yahoo.config.model.producer.AnyConfigProducer
- All Implemented Interfaces:
com.yahoo.config.ConfigInstance.Producer,ConfigProducer,Serializable
- Direct Known Subclasses:
ClusterControllerConfig,DocumentDatabase,TreeConfigProducer,Tuning
public abstract class AnyConfigProducer
extends Object
implements ConfigProducer, com.yahoo.config.ConfigInstance.Producer, Serializable
Superclass for all config producers.
Config producers constructs and returns config instances on request.
- Author:
- gjoranv, arnej
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAnyConfigProducer(TreeConfigProducer parent, String subId) Creates a new AnyConfigProducer with the given parent and subId.AnyConfigProducer(String subId) Create an config producer with a configId only. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddConfigId(String id) Sets the config id for this producer.final booleanaddUserConfig(com.yahoo.config.ConfigInstance.Builder builder) Adds user config override from this ConfigProducer to the existing builderfinal booleancascadeConfig(com.yahoo.config.ConfigInstance.Builder builder) Build config from this and all parent ConfigProducers, such that the root node's config will be added first, and this ConfigProducer's config last in the returned builder.protected final Stringprotected static ClassLoaderfindInheritedClassLoader(Class clazz, String producerName) protected ClassLoadergetConfigClassLoader(String producerName) final StringConfigProducers that must have a special config id should use setConfigId() instead of overloading this method.Returns a List of all Services that are descendants to this ConfigProducerprotected MonitoringReturns a monitoring service if configured, null otherwisegetRoot()final StringgetSubId()Returns the user configs of thisReturns the one and only HostSystem of the root node.voidmergeUserConfigs(UserConfigRepo newRepo) protected voidremove()Removes this from the config modelprotected final voidsetParent(TreeConfigProducer parent) voidsetUserConfigs(UserConfigRepo repo) Sets the user configs for this producer.protected static booleanstateIsHosted(DeployState deployState) voidvalidate()check constraints depending on the state of the vespamodel graph.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.yahoo.vespa.model.ConfigProducer
dump, getChildren
-
Field Details
-
log
-
-
Constructor Details
-
AnyConfigProducer
Creates a new AnyConfigProducer with the given parent and subId. This constructor will add the resulting producer to the children of parent.- Parameters:
parent- the parent of this ConfigProducersubId- the fragment of the config id for the producer
-
AnyConfigProducer
Create an config producer with a configId only. Used e.g. to create root nodes, and producers that are given parents after construction usingTreeConfigProducer.addChild(AnyConfigProducer).- Parameters:
subId- The sub configId. Note that this can be prefixed when calling addChild with this producer as arg.
-
-
Method Details
-
stateIsHosted
-
remove
protected void remove()Removes this from the config model -
setParent
-
getSubId
-
setUserConfigs
Sets the user configs for this producer.- Parameters:
repo- User configs repo.
-
getUserConfigs
Returns the user configs of this- Specified by:
getUserConfigsin interfaceConfigProducer
-
getConfigId
ConfigProducers that must have a special config id should use setConfigId() instead of overloading this method. This is because config IDs must be registered through setConfigId().- Specified by:
getConfigIdin interfaceConfigProducer
-
currentConfigId
-
addConfigId
Sets the config id for this producer. Will also add this service to the root node, so the new config id will be picked up. Note that this producer will be known with both the old and the new config id in the root node after using this method. -
cascadeConfig
public final boolean cascadeConfig(com.yahoo.config.ConfigInstance.Builder builder) Description copied from interface:ConfigProducerBuild config from this and all parent ConfigProducers, such that the root node's config will be added first, and this ConfigProducer's config last in the returned builder.- Specified by:
cascadeConfigin interfaceConfigProducer- Parameters:
builder- The builder implemented by the concrete ConfigInstance class- Returns:
- true if a model config producer was found, so config was applied
-
addUserConfig
public final boolean addUserConfig(com.yahoo.config.ConfigInstance.Builder builder) Description copied from interface:ConfigProducerAdds user config override from this ConfigProducer to the existing builder- Specified by:
addUserConfigin interfaceConfigProducer- Parameters:
builder- The ConfigBuilder to add user config overrides.- Returns:
- true if overrides were added, false if not.
-
hostSystem
Returns the one and only HostSystem of the root node. Must be overridden by root node.- Specified by:
hostSystemin interfaceConfigProducer
-
getRoot
-
getParent
-
findInheritedClassLoader
-
getConfigClassLoader
-
mergeUserConfigs
-
getMonitoringService
Returns a monitoring service if configured, null otherwise -
getDescendantServices
Description copied from interface:ConfigProducerReturns a List of all Services that are descendants to this ConfigProducer- Specified by:
getDescendantServicesin interfaceConfigProducer
-
validate
Description copied from interface:ConfigProducercheck constraints depending on the state of the vespamodel graph. When overriding, you must invoke super.- Specified by:
validatein interfaceConfigProducer- Throws:
Exception
-