Package com.yahoo.config.model.api
Interface Model
-
public interface Model
AModel
represents the interface towards the model of an entire tenant, and defines methods for querying this model.- Author:
- Ulf Lilleengen
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.Set<java.lang.String>
allConfigIds()
Returns all the config ids available for this model.java.util.Set<com.yahoo.vespa.config.ConfigKey<?>>
allConfigsProduced()
Produces a set of the valid config keys for this model.com.yahoo.config.provision.AllocatedHosts
allocatedHosts()
Gets the allocated hosts for this model.default boolean
allowModelVersionMismatch(java.time.Instant now)
Returns whether this application allows serving config request for a different version.void
distributeFiles(FileDistribution fileDistribution)
Asks theModel
instance to distribute files using provided filedistribution instance.java.util.Set<com.yahoo.config.FileReference>
fileReferences()
The set of files that should be distributed to the hosts in this model.com.yahoo.vespa.config.ConfigPayload
getConfig(com.yahoo.vespa.config.ConfigKey<?> configKey, com.yahoo.vespa.config.buildergen.ConfigDefinition configDefinition)
Resolves config for a given key and config definitionjava.util.Collection<HostInfo>
getHosts()
Returns information about all hosts used in this model.default boolean
skipOldConfigModels(java.time.Instant now)
Returns whether old config models should be loaded (default) or not.default com.yahoo.component.Version
version()
Returns the version of this model
-
-
-
Method Detail
-
getConfig
com.yahoo.vespa.config.ConfigPayload getConfig(com.yahoo.vespa.config.ConfigKey<?> configKey, com.yahoo.vespa.config.buildergen.ConfigDefinition configDefinition)
Resolves config for a given key and config definition- Parameters:
configKey
- The key to resolveconfigDefinition
- The config definition to use for the schema
-
allConfigsProduced
java.util.Set<com.yahoo.vespa.config.ConfigKey<?>> allConfigsProduced()
Produces a set of the valid config keys for this model.
-
getHosts
java.util.Collection<HostInfo> getHosts()
Returns information about all hosts used in this model.
-
allConfigIds
java.util.Set<java.lang.String> allConfigIds()
Returns all the config ids available for this model.
-
distributeFiles
void distributeFiles(FileDistribution fileDistribution)
Asks theModel
instance to distribute files using provided filedistribution instance.- Parameters:
fileDistribution
-FileDistribution
instance that can be called to distribute files.
-
fileReferences
java.util.Set<com.yahoo.config.FileReference> fileReferences()
The set of files that should be distributed to the hosts in this model.
-
allocatedHosts
com.yahoo.config.provision.AllocatedHosts allocatedHosts()
Gets the allocated hosts for this model.- Returns:
AllocatedHosts
instance, if available.
-
allowModelVersionMismatch
default boolean allowModelVersionMismatch(java.time.Instant now)
Returns whether this application allows serving config request for a different version. This is a validation override which is useful when we skip loading old config models due to some problem, or when we need to try a newer version of the platform on some node.
-
skipOldConfigModels
default boolean skipOldConfigModels(java.time.Instant now)
Returns whether old config models should be loaded (default) or not. Skipping old config models is a validation override which is useful when the old model version is known to contain some incompatibility with the application package and it is believed that the latest model version will deliver usable config for old versions requesting config.If a model returns true to this it should also return true to
allowModelVersionMismatch(java.time.Instant)
or clients requesting config for those old models will not get config at all.
-
version
default com.yahoo.component.Version version()
Returns the version of this model
-
-