LegacySchemaTables (apache-cassandra API)
Date: 2018-02-12

org.apache.cassandra.schema

## Class LegacySchemaTables

- java.lang.Object
- - org.apache.cassandra.schema.LegacySchemaTables

-     public class LegacySchemaTables
      extends java.lang.Object

  system.schema_* tables used to store keyspace/table/type attributes prior to C* 3.0

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `AGGREGATES`
    `static java.util.List<CFMetaData>` | `All`
    `static java.util.List<java.lang.String>` | `ALL`
    `static java.lang.String` | `COLUMNFAMILIES`
    `static java.lang.String` | `COLUMNS`
    `static java.lang.String` | `FUNCTIONS`
    `static java.lang.String` | `KEYSPACES`
    `static java.lang.String` | `TRIGGERS`
    `static java.lang.String` | `USERTYPES`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LegacySchemaTables()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.util.UUID` | `calculateSchemaDigest()` Read schema from system keyspace and calculate MD5 digest of every row, resulting digest will be converted into UUID which would act as content-based version of the schema.
    `static java.util.Collection<Mutation>` | `convertSchemaToMutations()`
    `static KSMetaData` | `createKeyspaceFromName(java.lang.String keyspace)`
    `static CFMetaData` | `createTableFromName(java.lang.String keyspace, java.lang.String table)`
    `static CFMetaData` | `createTableFromTablePartitionAndColumnsPartition(Row serializedTable, Row serializedColumns)`
    `static CFMetaData` | `createTableFromTableRowAndColumnRows(UntypedResultSet.Row result, UntypedResultSet serializedColumnDefinitions)`
    `static Mutation` | `dropTypeFromSchemaMutation(KSMetaData keyspace, UserType type, long timestamp)`
    `static java.nio.ByteBuffer` | `functionSignatureWithNameAndTypes(AbstractFunction fun)`
    `static java.nio.ByteBuffer` | `functionSignatureWithTypes(AbstractFunction fun)`
    `static Mutation` | `makeCreateAggregateMutation(KSMetaData keyspace, UDAggregate aggregate, long timestamp)`
    `static Mutation` | `makeCreateFunctionMutation(KSMetaData keyspace, UDFunction function, long timestamp)`
    `static Mutation` | `makeCreateKeyspaceMutation(KSMetaData keyspace, long timestamp)`
    `static Mutation` | `makeCreateTableMutation(KSMetaData keyspace, CFMetaData table, long timestamp)`
    `static Mutation` | `makeCreateTypeMutation(KSMetaData keyspace, UserType type, long timestamp)`
    `static Mutation` | `makeDropAggregateMutation(KSMetaData keyspace, UDAggregate aggregate, long timestamp)`
    `static Mutation` | `makeDropFunctionMutation(KSMetaData keyspace, UDFunction function, long timestamp)`
    `static Mutation` | `makeDropKeyspaceMutation(KSMetaData keyspace, long timestamp)`
    `static Mutation` | `makeDropTableMutation(KSMetaData keyspace, CFMetaData table, long timestamp)`
    `static Mutation` | `makeUpdateTableMutation(KSMetaData keyspace, CFMetaData oldTable, CFMetaData newTable, long timestamp)`
    `static void` | `mergeSchema(java.util.Collection<Mutation> mutations)` Merge remote schema in form of mutations with local and mutate ks/cf metadata objects (which also involves fs operations on add/drop ks/cf)
    `static void` | `mergeSchema(java.util.Collection<Mutation> mutations, boolean doFlush)`
    `static java.util.Collection<KSMetaData>` | `readSchemaFromSystemTables()`
    `static void` | `saveSystemKeyspaceSchema()` add entries to system.schema_* for the hardcoded system definitions
    `static void` | `truncateSchemaTables()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### KEYSPACES

          public static final java.lang.String KEYSPACES

      See Also:
        Constant Field Values

    - #### COLUMNFAMILIES

          public static final java.lang.String COLUMNFAMILIES

      See Also:
        Constant Field Values

    - #### COLUMNS

          public static final java.lang.String COLUMNS

      See Also:
        Constant Field Values

    - #### TRIGGERS

          public static final java.lang.String TRIGGERS

      See Also:
        Constant Field Values

    - #### USERTYPES

          public static final java.lang.String USERTYPES

      See Also:
        Constant Field Values

    - #### FUNCTIONS

          public static final java.lang.String FUNCTIONS

      See Also:
        Constant Field Values

    - #### AGGREGATES

          public static final java.lang.String AGGREGATES

      See Also:
        Constant Field Values

    - #### ALL

          public static final java.util.List<java.lang.String> ALL

    - #### All

          public static final java.util.List<CFMetaData> All

  - ### Constructor Detail

    - #### LegacySchemaTables

          public LegacySchemaTables()

  - ### Method Detail

    - #### saveSystemKeyspaceSchema

          public static void saveSystemKeyspaceSchema()

      add entries to system.schema_* for the hardcoded system definitions

    - #### readSchemaFromSystemTables

          public static java.util.Collection<KSMetaData> readSchemaFromSystemTables()

    - #### truncateSchemaTables

          public static void truncateSchemaTables()

    - #### calculateSchemaDigest

          public static java.util.UUID calculateSchemaDigest()

      Read schema from system keyspace and calculate MD5 digest of every row, resulting digest will be converted into UUID which would act as content-based version of the schema.

    - #### convertSchemaToMutations

          public static java.util.Collection<Mutation> convertSchemaToMutations()

    - #### mergeSchema

          public static void mergeSchema(java.util.Collection<Mutation> mutations)
                                  throws ConfigurationException,
                                         java.io.IOException

      Merge remote schema in form of mutations with local and mutate ks/cf metadata objects (which also involves fs operations on add/drop ks/cf)
      Parameters:
        `mutations` - the schema changes to apply
      Throws:
        `ConfigurationException` - If one of metadata attributes has invalid value
        `java.io.IOException` - If data was corrupted during transportation or failed to apply fs operations

    - #### mergeSchema

          public static void mergeSchema(java.util.Collection<Mutation> mutations,
                                         boolean doFlush)
                                  throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### makeCreateKeyspaceMutation

          public static Mutation makeCreateKeyspaceMutation(KSMetaData keyspace,
                                                            long timestamp)

    - #### makeDropKeyspaceMutation

          public static Mutation makeDropKeyspaceMutation(KSMetaData keyspace,
                                                          long timestamp)

    - #### createKeyspaceFromName

          public static KSMetaData createKeyspaceFromName(java.lang.String keyspace)

    - #### makeCreateTypeMutation

          public static Mutation makeCreateTypeMutation(KSMetaData keyspace,
                                                        UserType type,
                                                        long timestamp)

    - #### dropTypeFromSchemaMutation

          public static Mutation dropTypeFromSchemaMutation(KSMetaData keyspace,
                                                            UserType type,
                                                            long timestamp)

    - #### makeCreateTableMutation

          public static Mutation makeCreateTableMutation(KSMetaData keyspace,
                                                         CFMetaData table,
                                                         long timestamp)

    - #### makeUpdateTableMutation

          public static Mutation makeUpdateTableMutation(KSMetaData keyspace,
                                                         CFMetaData oldTable,
                                                         CFMetaData newTable,
                                                         long timestamp)

    - #### makeDropTableMutation

          public static Mutation makeDropTableMutation(KSMetaData keyspace,
                                                       CFMetaData table,
                                                       long timestamp)

    - #### createTableFromName

          public static CFMetaData createTableFromName(java.lang.String keyspace,
                                                       java.lang.String table)

    - #### createTableFromTablePartitionAndColumnsPartition

          public static CFMetaData createTableFromTablePartitionAndColumnsPartition(Row serializedTable,
                                                                                    Row serializedColumns)

    - #### createTableFromTableRowAndColumnRows

          public static CFMetaData createTableFromTableRowAndColumnRows(UntypedResultSet.Row result,
                                                                        UntypedResultSet serializedColumnDefinitions)

    - #### makeCreateFunctionMutation

          public static Mutation makeCreateFunctionMutation(KSMetaData keyspace,
                                                            UDFunction function,
                                                            long timestamp)

    - #### makeDropFunctionMutation

          public static Mutation makeDropFunctionMutation(KSMetaData keyspace,
                                                          UDFunction function,
                                                          long timestamp)

    - #### makeCreateAggregateMutation

          public static Mutation makeCreateAggregateMutation(KSMetaData keyspace,
                                                             UDAggregate aggregate,
                                                             long timestamp)

    - #### makeDropAggregateMutation

          public static Mutation makeDropAggregateMutation(KSMetaData keyspace,
                                                           UDAggregate aggregate,
                                                           long timestamp)

    - #### functionSignatureWithTypes

          public static java.nio.ByteBuffer functionSignatureWithTypes(AbstractFunction fun)

    - #### functionSignatureWithNameAndTypes

          public static java.nio.ByteBuffer functionSignatureWithNameAndTypes(AbstractFunction fun)

Copyright © 2018 The Apache Software Foundation