Module org.elasticsearch.security
Interface SecurityMigrations.SecurityMigration
- All Known Implementing Classes:
SecurityMigrations.CleanupRoleMappingDuplicatesMigration,SecurityMigrations.RoleMetadataFlattenedMigration
- Enclosing class:
SecurityMigrations
public static interface SecurityMigrations.SecurityMigration
Interface for creating SecurityMigrations that will be automatically applied once to existing .security indices
IMPORTANT: A new index version needs to be added to
IndexVersions for the migration to be triggered-
Method Summary
Modifier and TypeMethodDescriptiondefault booleancheckPreConditions(SecurityIndexManager.IndexState securityIndexManagerState) Check that any pre-conditions are met before launching migrationvoidmigrate(SecurityIndexManager indexManager, Client client, ActionListener<Void> listener) Method that will execute the actual migration - needs to be idempotent and non-blockingintThe min mapping version required to support this migration.Any node features that are required for this migration to run.
-
Method Details
-
migrate
Method that will execute the actual migration - needs to be idempotent and non-blocking- Parameters:
indexManager- for the security indexclient- the index clientlistener- listener to provide updates back to caller
-
nodeFeaturesRequired
Set<NodeFeature> nodeFeaturesRequired()Any node features that are required for this migration to run. This makes sure that all nodes in the cluster can handle any changes in behaviour introduced by the migration.- Returns:
- a set of features needed to be supported or an empty set if no change in behaviour is expected
-
checkPreConditions
Check that any pre-conditions are met before launching migration- Parameters:
securityIndexManagerState- current state of the security index- Returns:
- true if pre-conditions met, otherwise false
-
minMappingVersion
int minMappingVersion()The min mapping version required to support this migration. This makes sure that the index has at least the min mapping that is required to support the migration.- Returns:
- the minimum mapping version required to apply this migration
-