public final class SchemaKeyspace
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AGGREGATES |
static com.google.common.collect.ImmutableList<java.lang.String> |
ALL
The order in this list matters.
|
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 ColumnDefinition |
createColumnFromRow(UntypedResultSet.Row row,
Types types) |
static TableParams |
createTableParamsFromRow(UntypedResultSet.Row row) |
static Mutation |
dropTypeFromSchemaMutation(KeyspaceMetadata keyspace,
UserType type,
long timestamp) |
static Keyspaces |
fetchNonSystemKeyspaces() |
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) |
static Mutation |
makeUpdateViewMutation(KeyspaceMetadata keyspace,
ViewDefinition oldView,
ViewDefinition newView,
long timestamp) |
static void |
mergeSchema(java.util.Collection<Mutation> mutations) |
static void |
mergeSchemaAndAnnounceVersion(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 KeyspaceMetadata |
metadata() |
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 com.google.common.collect.ImmutableList<java.lang.String> ALL
public static final java.util.List<CFMetaData> ALL_TABLE_METADATA
public static KeyspaceMetadata metadata()
public static void saveSystemKeyspacesSchema()
public static void truncate()
public static java.util.UUID calculateSchemaDigest()
public static java.util.Collection<Mutation> convertSchemaToMutations()
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)
public static Mutation makeDropTableMutation(KeyspaceMetadata keyspace, CFMetaData table, long timestamp)
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 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 Keyspaces fetchNonSystemKeyspaces()
public static TableParams createTableParamsFromRow(UntypedResultSet.Row row)
public static ColumnDefinition createColumnFromRow(UntypedResultSet.Row row, Types types)
public static void mergeSchemaAndAnnounceVersion(java.util.Collection<Mutation> mutations) throws ConfigurationException
mutations
- the schema changes to applyConfigurationException
- If one of metadata attributes has invalid valuepublic static void mergeSchema(java.util.Collection<Mutation> mutations)
Copyright © 2017 The Apache Software Foundation