public final class SchemaKeyspace
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
SchemaKeyspace.Differ |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AGGREGATES |
static java.util.List<java.lang.String> |
ALL |
static java.util.List<CFMetaData> |
ALL_TABLE_METADATA |
static java.lang.String |
COLUMNS |
static java.lang.String |
DROPPED_COLUMNS |
static java.lang.String |
FUNCTIONS |
static java.lang.String |
INDEXES |
static java.lang.String |
KEYSPACES |
static java.lang.String |
NAME |
static java.lang.String |
TABLES |
static java.lang.String |
TRIGGERS |
static java.lang.String |
TYPES |
static java.lang.String |
VIEWS |
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 CFMetaData |
createTableFromName(java.lang.String keyspace,
java.lang.String table) |
static CFMetaData |
createTableFromTablePartitionAndColumnsPartition(RowIterator tablePartition,
RowIterator columnsPartition) |
static CFMetaData |
createTableFromTableRowAndColumns(UntypedResultSet.Row row,
java.util.List<ColumnDefinition> columns) |
static ViewDefinition |
createViewFromName(java.lang.String keyspace,
java.lang.String view) |
static Mutation |
dropTypeFromSchemaMutation(KeyspaceMetadata keyspace,
UserType type,
long timestamp) |
static java.nio.ByteBuffer |
functionSignatureWithTypes(AbstractFunction fun) |
static Mutation |
makeCreateAggregateMutation(KeyspaceMetadata keyspace,
UDAggregate aggregate,
long timestamp) |
static Mutation |
makeCreateFunctionMutation(KeyspaceMetadata keyspace,
UDFunction function,
long timestamp) |
static Mutation |
makeCreateKeyspaceMutation(KeyspaceMetadata keyspace,
long timestamp) |
static Mutation |
makeCreateKeyspaceMutation(java.lang.String name,
KeyspaceParams params,
long timestamp) |
static Mutation |
makeCreateTableMutation(KeyspaceMetadata keyspace,
CFMetaData table,
long timestamp) |
static Mutation |
makeCreateTypeMutation(KeyspaceMetadata keyspace,
UserType type,
long timestamp) |
static Mutation |
makeCreateViewMutation(KeyspaceMetadata keyspace,
ViewDefinition view,
long timestamp) |
static Mutation |
makeDropAggregateMutation(KeyspaceMetadata keyspace,
UDAggregate aggregate,
long timestamp) |
static Mutation |
makeDropFunctionMutation(KeyspaceMetadata keyspace,
UDFunction function,
long timestamp) |
static Mutation |
makeDropKeyspaceMutation(KeyspaceMetadata keyspace,
long timestamp) |
static Mutation |
makeDropTableMutation(KeyspaceMetadata keyspace,
CFMetaData table,
long timestamp) |
static Mutation |
makeDropViewMutation(KeyspaceMetadata keyspace,
ViewDefinition view,
long timestamp) |
static Mutation |
makeUpdateTableMutation(KeyspaceMetadata keyspace,
CFMetaData oldTable,
CFMetaData newTable,
long timestamp,
boolean fromThrift) |
static Mutation |
makeUpdateViewMutation(KeyspaceMetadata keyspace,
ViewDefinition oldView,
ViewDefinition newView,
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 KeyspaceMetadata |
metadata() |
static java.util.List<KeyspaceMetadata> |
readSchemaFromSystemTables() |
static void |
saveSystemKeyspacesSchema()
Add entries to system_schema.* for the hardcoded system keyspaces
|
static void |
truncate() |
public static final java.lang.String NAME
public static final java.lang.String KEYSPACES
public static final java.lang.String TABLES
public static final java.lang.String COLUMNS
public static final java.lang.String DROPPED_COLUMNS
public static final java.lang.String TRIGGERS
public static final java.lang.String VIEWS
public static final java.lang.String TYPES
public static final java.lang.String FUNCTIONS
public static final java.lang.String AGGREGATES
public static final java.lang.String INDEXES
public static final java.util.List<java.lang.String> ALL
public static final java.util.List<CFMetaData> ALL_TABLE_METADATA
public static KeyspaceMetadata metadata()
public static void saveSystemKeyspacesSchema()
public static java.util.List<KeyspaceMetadata> readSchemaFromSystemTables()
public static void truncate()
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(java.lang.String name, KeyspaceParams params, long timestamp)
public static Mutation makeCreateKeyspaceMutation(KeyspaceMetadata keyspace, long timestamp)
public static Mutation makeDropKeyspaceMutation(KeyspaceMetadata keyspace, long timestamp)
public static Mutation makeCreateTypeMutation(KeyspaceMetadata keyspace, UserType type, long timestamp)
public static Mutation dropTypeFromSchemaMutation(KeyspaceMetadata keyspace, UserType type, long timestamp)
public static Mutation makeCreateTableMutation(KeyspaceMetadata keyspace, CFMetaData table, long timestamp)
public static Mutation makeUpdateTableMutation(KeyspaceMetadata keyspace, CFMetaData oldTable, CFMetaData newTable, long timestamp, boolean fromThrift)
public static Mutation makeDropTableMutation(KeyspaceMetadata keyspace, CFMetaData table, long timestamp)
public static CFMetaData createTableFromName(java.lang.String keyspace, java.lang.String table)
public static CFMetaData createTableFromTablePartitionAndColumnsPartition(RowIterator tablePartition, RowIterator columnsPartition)
public static CFMetaData createTableFromTableRowAndColumns(UntypedResultSet.Row row, java.util.List<ColumnDefinition> columns)
public static Mutation makeCreateViewMutation(KeyspaceMetadata keyspace, ViewDefinition view, long timestamp)
public static Mutation makeDropViewMutation(KeyspaceMetadata keyspace, ViewDefinition view, long timestamp)
public static Mutation makeUpdateViewMutation(KeyspaceMetadata keyspace, ViewDefinition oldView, ViewDefinition newView, long timestamp)
public static ViewDefinition createViewFromName(java.lang.String keyspace, java.lang.String view)
public static Mutation makeCreateFunctionMutation(KeyspaceMetadata keyspace, UDFunction function, long timestamp)
public static Mutation makeDropFunctionMutation(KeyspaceMetadata keyspace, UDFunction function, long timestamp)
public static Mutation makeCreateAggregateMutation(KeyspaceMetadata keyspace, UDAggregate aggregate, long timestamp)
public static Mutation makeDropAggregateMutation(KeyspaceMetadata keyspace, UDAggregate aggregate, long timestamp)
public static java.nio.ByteBuffer functionSignatureWithTypes(AbstractFunction fun)
Copyright © 2015 The Apache Software Foundation