public class LegacySchemaTables
extends java.lang.Object
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 and Description |
---|
LegacySchemaTables() |
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() |
public static final java.lang.String KEYSPACES
public static final java.lang.String COLUMNFAMILIES
public static final java.lang.String COLUMNS
public static final java.lang.String TRIGGERS
public static final java.lang.String USERTYPES
public static final java.lang.String FUNCTIONS
public static final java.lang.String AGGREGATES
public static final java.util.List<java.lang.String> ALL
public static final java.util.List<CFMetaData> All
public static void saveSystemKeyspaceSchema()
public static java.util.Collection<KSMetaData> readSchemaFromSystemTables()
public static void truncateSchemaTables()
public static java.util.UUID calculateSchemaDigest()
public static java.util.Collection<Mutation> convertSchemaToMutations()
public static void mergeSchema(java.util.Collection<Mutation> mutations) throws ConfigurationException, java.io.IOException
mutations
- the schema changes to applyConfigurationException
- If one of metadata attributes has invalid valuejava.io.IOException
- If data was corrupted during transportation or failed to apply fs operationspublic static void mergeSchema(java.util.Collection<Mutation> mutations, boolean doFlush) throws java.io.IOException
java.io.IOException
public static Mutation makeCreateKeyspaceMutation(KSMetaData keyspace, long timestamp)
public static Mutation makeDropKeyspaceMutation(KSMetaData keyspace, long timestamp)
public static KSMetaData createKeyspaceFromName(java.lang.String keyspace)
public static Mutation makeCreateTypeMutation(KSMetaData keyspace, UserType type, long timestamp)
public static Mutation dropTypeFromSchemaMutation(KSMetaData keyspace, UserType type, long timestamp)
public static Mutation makeCreateTableMutation(KSMetaData keyspace, CFMetaData table, long timestamp)
public static Mutation makeUpdateTableMutation(KSMetaData keyspace, CFMetaData oldTable, CFMetaData newTable, long timestamp)
public static Mutation makeDropTableMutation(KSMetaData keyspace, CFMetaData table, long timestamp)
public static CFMetaData createTableFromName(java.lang.String keyspace, java.lang.String table)
public static CFMetaData createTableFromTablePartitionAndColumnsPartition(Row serializedTable, Row serializedColumns)
public static CFMetaData createTableFromTableRowAndColumnRows(UntypedResultSet.Row result, UntypedResultSet serializedColumnDefinitions)
public static Mutation makeCreateFunctionMutation(KSMetaData keyspace, UDFunction function, long timestamp)
public static Mutation makeDropFunctionMutation(KSMetaData keyspace, UDFunction function, long timestamp)
public static Mutation makeCreateAggregateMutation(KSMetaData keyspace, UDAggregate aggregate, long timestamp)
public static Mutation makeDropAggregateMutation(KSMetaData keyspace, UDAggregate aggregate, long timestamp)
public static java.nio.ByteBuffer functionSignatureWithTypes(AbstractFunction fun)
public static java.nio.ByteBuffer functionSignatureWithNameAndTypes(AbstractFunction fun)
Copyright © 2017 The Apache Software Foundation