Class MigrationManager
java.lang.Object
org.apache.curator.x.async.migrations.MigrationManager
Manages migrations
-
Constructor Summary
ConstructorDescriptionMigrationManager
(AsyncCuratorFramework client, String lockPath, String metaDataPath, Executor executor, Duration lockMax) -
Method Summary
Modifier and TypeMethodDescriptionfilter
(MigrationSet set, List<byte[]> operationHashesInOrder) Can be overridden to change how the comparison to previous migrations is done.migrate
(MigrationSet set) Process the given migration set
-
Constructor Details
-
MigrationManager
public MigrationManager(AsyncCuratorFramework client, String lockPath, String metaDataPath, Executor executor, Duration lockMax) - Parameters:
client
- the curator clientlockPath
- base path for locks used by the managermetaDataPath
- base path to store the meta dataexecutor
- the executor to uselockMax
- max time to wait for locks
-
-
Method Details
-
migrate
Process the given migration set- Parameters:
set
- the set- Returns:
- completion stage. If there is a migration-specific error, the stage will be completed
exceptionally with
MigrationException
.
-
filter
protected List<Migration> filter(MigrationSet set, List<byte[]> operationHashesInOrder) throws MigrationException Can be overridden to change how the comparison to previous migrations is done. The default version ensures that the meta data from previous migrations matches the current migration set exactly (by order and version). If there is a mismatch,MigrationException
is thrown.- Parameters:
set
- the migration set being appliedoperationHashesInOrder
- previous operation hashes (may be empty)- Returns:
- the list of actual migrations to perform. The filter can return any value here or an empty list.
- Throws:
MigrationException
- errors
-