Class MigrationManager

java.lang.Object
org.apache.curator.x.async.migrations.MigrationManager

public class MigrationManager extends Object
Manages migrations
  • Constructor Details

    • MigrationManager

      public MigrationManager(AsyncCuratorFramework client, String lockPath, String metaDataPath, Executor executor, Duration lockMax)
      Parameters:
      client - the curator client
      lockPath - base path for locks used by the manager
      metaDataPath - base path to store the meta data
      executor - the executor to use
      lockMax - max time to wait for locks
  • Method Details

    • migrate

      public CompletionStage<Void> migrate(MigrationSet set)
      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 applied
      operationHashesInOrder - 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