Class MigrationManager


public class MigrationManager extends Object
Manages migrations
  • Constructor Details

    • MigrationManager

      public MigrationManager(AsyncCuratorFramework client, String lockPath, String metaDataPath, Executor executor, Duration lockMax)
      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
      set - the set
      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.
      set - the migration set being applied
      operationHashesInOrder - previous operation hashes (may be empty)
      the list of actual migrations to perform. The filter can return any value here or an empty list.
      MigrationException - errors