java.lang.Object
org.elasticsearch.indices.SystemIndices.Feature
- Enclosing class:
SystemIndices
Describes an Elasticsearch system feature that keeps state in protected indices and data streams.
This is an internal class that closely follows the model of SystemIndexPlugin. See that class’s documents for high-level
details about what constitutes a system feature.
This class has a static cleanUpFeature(Collection, Collection, String, ClusterService, Client, ActionListener) method
that is the default implementation for resetting feature state.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceType for the handler that's invoked when all of a feature's system indices have been migrated.static interfaceType for the handler that's invoked prior to migrating a Feature's system indices. -
Constructor Summary
ConstructorsConstructorDescriptionFeature(String name, String description, Collection<SystemIndexDescriptor> indexDescriptors) Construct a Feature using the default clean-up functionFeature(String name, String description, Collection<SystemIndexDescriptor> indexDescriptors, Collection<SystemDataStreamDescriptor> dataStreamDescriptors) Construct a Feature using the default clean-up functionFeature(String name, String description, Collection<SystemIndexDescriptor> indexDescriptors, Collection<SystemDataStreamDescriptor> dataStreamDescriptors, Collection<AssociatedIndexDescriptor> associatedIndexDescriptors, TriConsumer<ClusterService, Client, ActionListener<ResetFeatureStateResponse.ResetFeatureStateStatus>> cleanUpFunction, SystemIndices.Feature.MigrationPreparationHandler preMigrationFunction, SystemIndices.Feature.MigrationCompletionHandler postMigrationFunction) Construct a Feature with a custom cleanup function -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcleanUpFeature(Collection<SystemIndexDescriptor> indexDescriptors, Collection<? extends IndexPatternMatcher> associatedIndexDescriptors, String name, ClusterService clusterService, Client client, ActionListener<ResetFeatureStateResponse.ResetFeatureStateStatus> listener) Clean up the state of a featurestatic SystemIndices.FeaturefromSystemIndexPlugin(SystemIndexPlugin plugin, Settings settings) Creates aSystemIndices.Featurefrom aSystemIndexPlugin.TriConsumer<ClusterService, Client, ActionListener<ResetFeatureStateResponse.ResetFeatureStateStatus>> getName()Returns descriptors of all system resources - indices and data streams.
-
Constructor Details
-
Feature
public Feature(String name, String description, Collection<SystemIndexDescriptor> indexDescriptors, Collection<SystemDataStreamDescriptor> dataStreamDescriptors, Collection<AssociatedIndexDescriptor> associatedIndexDescriptors, TriConsumer<ClusterService, Client, ActionListener<ResetFeatureStateResponse.ResetFeatureStateStatus>> cleanUpFunction, SystemIndices.Feature.MigrationPreparationHandler preMigrationFunction, SystemIndices.Feature.MigrationCompletionHandler postMigrationFunction) Construct a Feature with a custom cleanup function- Parameters:
name- The name of the featuredescription- Description of the featureindexDescriptors- Collection of objects describing system indices for this featuredataStreamDescriptors- Collection of objects describing system data streams for this featureassociatedIndexDescriptors- Collection of objects describing associated indices for this featurecleanUpFunction- A function that will clean up the feature's statepreMigrationFunction- A function that will be called prior to upgrading any of this plugin's system indicespostMigrationFunction- A function that will be called after upgrading all of this plugin's system indices
-
Feature
Construct a Feature using the default clean-up function- Parameters:
name- Name of the feature, used in loggingdescription- Description of the featureindexDescriptors- Patterns describing system indices for this feature
-
Feature
public Feature(String name, String description, Collection<SystemIndexDescriptor> indexDescriptors, Collection<SystemDataStreamDescriptor> dataStreamDescriptors) Construct a Feature using the default clean-up function- Parameters:
name- Name of the feature, used in loggingdescription- Description of the featureindexDescriptors- Patterns describing system indices for this featuredataStreamDescriptors- Collection of objects describing system data streams for this feature
-
-
Method Details
-
fromSystemIndexPlugin
public static SystemIndices.Feature fromSystemIndexPlugin(SystemIndexPlugin plugin, Settings settings) Creates aSystemIndices.Featurefrom aSystemIndexPlugin.- Parameters:
plugin- TheSystemIndexPluginthat adds this feature.settings- Node-level settings, as this may impact the descriptors returned by the plugin.- Returns:
- A
SystemIndices.Featurewhich represents the feature added by the given plugin.
-
getDescription
-
getIndexDescriptors
-
getDataStreamDescriptors
-
getSystemResourceDescriptors
Returns descriptors of all system resources - indices and data streams. Doesn't include associated indicesAssociatedIndexDescriptor. -
getAssociatedIndexDescriptors
-
getCleanUpFunction
public TriConsumer<ClusterService,Client, getCleanUpFunction()ActionListener<ResetFeatureStateResponse.ResetFeatureStateStatus>> -
getName
-
getPreMigrationFunction
-
getPostMigrationFunction
-
cleanUpFeature
public static void cleanUpFeature(Collection<SystemIndexDescriptor> indexDescriptors, Collection<? extends IndexPatternMatcher> associatedIndexDescriptors, String name, ClusterService clusterService, Client client, ActionListener<ResetFeatureStateResponse.ResetFeatureStateStatus> listener) Clean up the state of a feature- Parameters:
indexDescriptors- List of descriptors of a feature's system indicesassociatedIndexDescriptors- List of descriptors of a feature's associated indicesname- Name of the feature, used in loggingclusterService- A clusterService, for retrieving cluster metadataclient- A client, for issuing delete requestslistener- A listener to return success or failure of cleanup
-