public class DefsTable
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.nio.ByteBuffer |
DEFINITION_SCHEMA_COLUMN_NAME |
static java.lang.String |
OLD_MIGRATIONS_CF |
static java.lang.String |
OLD_SCHEMA_CF |
Constructor and Description |
---|
DefsTable() |
Modifier and Type | Method and Description |
---|---|
static <T extends org.apache.avro.specific.SpecificRecord> |
deserializeAvro(org.apache.avro.Schema writer,
java.nio.ByteBuffer bytes,
T ob)
Deserialize a single object based on the given Schema.
|
static void |
fixSchemaNanoTimestamps() |
static java.util.Collection<KSMetaData> |
loadFromStorage(java.util.UUID version)
Loads a version of keyspace definitions from storage (using old SCHEMA_CF as a data source)
Note: If definitions where found in SCHEMA_CF this method would load them into new schema handling table KEYSPACE_CF
|
static java.util.Collection<KSMetaData> |
loadFromTable()
Load keyspace definitions for the system keyspace (system.SCHEMA_KEYSPACES_CF)
|
static void |
mergeSchema(java.util.Collection<RowMutation> mutations)
Merge remote schema in form of row mutations with local and mutate ks/cf metadata objects
(which also involves fs operations on add/drop ks/cf)
|
static void |
save(java.util.Collection<KSMetaData> keyspaces) |
static java.nio.ByteBuffer |
searchComposite(java.lang.String name,
boolean start) |
public static final java.nio.ByteBuffer DEFINITION_SCHEMA_COLUMN_NAME
public static final java.lang.String OLD_MIGRATIONS_CF
public static final java.lang.String OLD_SCHEMA_CF
public static void save(java.util.Collection<KSMetaData> keyspaces)
public static java.util.Collection<KSMetaData> loadFromTable()
public static void fixSchemaNanoTimestamps()
public static java.nio.ByteBuffer searchComposite(java.lang.String name, boolean start)
public static java.util.Collection<KSMetaData> loadFromStorage(java.util.UUID version) throws java.io.IOException
version
- The version of the latest migration.java.io.IOException
- if failed to read SCHEMA_CF or failed to deserialize Avro schemapublic static void mergeSchema(java.util.Collection<RowMutation> 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 <T extends org.apache.avro.specific.SpecificRecord> T deserializeAvro(org.apache.avro.Schema writer, java.nio.ByteBuffer bytes, T ob) throws java.io.IOException
writer
- writer's schemabytes
- Array to deserialize fromob
- An empty object to deserialize into (must not be null).java.io.IOException
- if deserialization failedCopyright © 2014 The Apache Software Foundation