Module org.elasticsearch.xcore
Class YamlTemplateRegistry
java.lang.Object
org.elasticsearch.xpack.core.template.IndexTemplateRegistry
org.elasticsearch.xpack.core.template.YamlTemplateRegistry
- All Implemented Interfaces:
ClusterStateListener
Creates index templates and ingest pipelines based on YAML files defined in resources.yaml.
-
Field Summary
Fields inherited from class org.elasticsearch.xpack.core.template.IndexTemplateRegistry
client, clusterService, pipelineCreationsInProgress, policyCreationsInProgress, settings, templateCreationsInProgress, threadPool, xContentRegistry -
Constructor Summary
ConstructorsConstructorDescriptionYamlTemplateRegistry(Settings nodeSettings, ClusterService clusterService, ThreadPool threadPool, Client client, org.elasticsearch.xcontent.NamedXContentRegistry xContentRegistry) YamlTemplateRegistry(Settings nodeSettings, ClusterService clusterService, ThreadPool threadPool, Client client, org.elasticsearch.xcontent.NamedXContentRegistry xContentRegistry, Predicate<String> templateFilter) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanAllows registries to opt-in for automatic rollover of "relevant" data streams immediately after a composable index template gets updated, including its initial installation.voidclose()Retrieves return a list ofIndexTemplateConfigthat represents the component templates that should be installed and managed.Retrieves return a list ofIndexTemplateConfigthat represents the composable templates that should be installed and managed.Retrieves a list ofIngestPipelineConfigthat represents the ingest pipelines that should be installed and managed.Retrieves a list ofLifecyclePolicythat represents the ILM policies that should be installed and managed.abstract StringgetName()intprotected abstract Stringbooleanprotected booleanWhether the registry should only apply changes when running on the master node.voidsetEnabled(boolean enabled) Methods inherited from class org.elasticsearch.xpack.core.template.IndexTemplateRegistry
clusterChanged, getLegacyTemplateConfigs, getLifecycleConfigs, getOrigin, initialize, isClusterReady, isUpgradeRequired, onPutPipelineFailure, onPutPolicyFailure, onPutTemplateFailure, parseComposableTemplates
-
Constructor Details
-
YamlTemplateRegistry
public YamlTemplateRegistry(Settings nodeSettings, ClusterService clusterService, ThreadPool threadPool, Client client, org.elasticsearch.xcontent.NamedXContentRegistry xContentRegistry) -
YamlTemplateRegistry
public YamlTemplateRegistry(Settings nodeSettings, ClusterService clusterService, ThreadPool threadPool, Client client, org.elasticsearch.xcontent.NamedXContentRegistry xContentRegistry, Predicate<String> templateFilter)
-
-
Method Details
-
getVersion
public int getVersion() -
getName
- Returns:
- A friendly, human-readable name of the index template registry
-
setEnabled
public void setEnabled(boolean enabled) -
isEnabled
public boolean isEnabled() -
close
public void close() -
requiresMasterNode
protected boolean requiresMasterNode()Description copied from class:IndexTemplateRegistryWhether the registry should only apply changes when running on the master node. This is useful for plugins where certain actions are performed on master nodes and the templates should match the respective version.- Overrides:
requiresMasterNodein classIndexTemplateRegistry
-
getComponentTemplateConfigs
Description copied from class:IndexTemplateRegistryRetrieves return a list ofIndexTemplateConfigthat represents the component templates that should be installed and managed. Component templates are always installed prior composable templates, so they may be referenced by a composable template.- Overrides:
getComponentTemplateConfigsin classIndexTemplateRegistry- Returns:
- The configurations for the templates that should be installed.
-
getComposableTemplateConfigs
Description copied from class:IndexTemplateRegistryRetrieves return a list ofIndexTemplateConfigthat represents the composable templates that should be installed and managed.- Overrides:
getComposableTemplateConfigsin classIndexTemplateRegistry- Returns:
- The configurations for the templates that should be installed.
-
getIngestPipelines
Description copied from class:IndexTemplateRegistryRetrieves a list ofIngestPipelineConfigthat represents the ingest pipelines that should be installed and managed.- Overrides:
getIngestPipelinesin classIndexTemplateRegistry- Returns:
- The configurations for ingest pipelines that should be installed.
-
getLifecyclePolicies
Description copied from class:IndexTemplateRegistryRetrieves a list ofLifecyclePolicythat represents the ILM policies that should be installed and managed. Only called if ILM is enabled.- Overrides:
getLifecyclePoliciesin classIndexTemplateRegistry- Returns:
- The lifecycle policies that should be installed.
-
getVersionProperty
-
applyRolloverAfterTemplateV2Update
protected boolean applyRolloverAfterTemplateV2Update()Description copied from class:IndexTemplateRegistryAllows registries to opt-in for automatic rollover of "relevant" data streams immediately after a composable index template gets updated, including its initial installation. If set totrue, then every time a composable index template is being updated, all data streams of which name matches this template's index patterns AND of all matching templates the upgraded one has the highest priority, will be rolled over.- Overrides:
applyRolloverAfterTemplateV2Updatein classIndexTemplateRegistry- Returns:
trueif this registry wants to apply automatic rollovers after template V2 upgrades
-