Class MigrationManager


  • public class MigrationManager
    extends java.lang.Object
    • Method Detail

      • announceNewTable

        public static void announceNewTable​(TableMetadata cfm)
      • announceTableUpdate

        public static void announceTableUpdate​(TableMetadata tm)
      • announceTableUpdate

        public static void announceTableUpdate​(TableMetadata updated,
                                               boolean announceLocally)
      • announceTableDrop

        public static void announceTableDrop​(java.lang.String ksName,
                                             java.lang.String cfName,
                                             boolean announceLocally)
      • announce

        public static void announce​(Mutation change)
      • announce

        public static void announce​(java.util.Collection<Mutation> schema)
      • announceWithoutPush

        public static java.util.concurrent.Future<?> announceWithoutPush​(java.util.Collection<Mutation> schema)
      • resetLocalSchema

        public static void resetLocalSchema()
        Clear all locally stored schema information and reset schema to initial state. Called by user (via JMX) who wants to get rid of schema disagreement.
      • evolveSystemKeyspace

        public static java.util.Optional<Mutation> evolveSystemKeyspace​(KeyspaceMetadata keyspace,
                                                                        long generation)
        We have a set of non-local, distributed system keyspaces, e.g. system_traces, system_auth, etc. (see SchemaConstants.REPLICATED_SYSTEM_KEYSPACE_NAMES), that need to be created on cluster initialisation, and later evolved on major upgrades (sometimes minor too). This method compares the current known definitions of the tables (if the keyspace exists) to the expected, most modern ones expected by the running version of C*; if any changes have been detected, a schema Mutation will be created which, when applied, should make cluster's view of that keyspace aligned with the expected modern definition.
        Parameters:
        keyspace - the expected modern definition of the keyspace
        generation - timestamp to use for the table changes in the schema mutation
        Returns:
        empty Optional if the current definition is up to date, or an Optional with the Mutation that would bring the schema in line with the expected definition.