|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.cassandra.config.Schema
public class Schema
| Field Summary | |
|---|---|
static java.util.UUID |
INITIAL_VERSION
|
static Schema |
instance
|
| Constructor Summary | |
|---|---|
Schema(java.util.UUID initialVersion)
Initialize empty schema object with given version |
|
| Method Summary | |
|---|---|
void |
addSystemTable(KSMetaData systemTable)
Add a new system table |
void |
clearTableDefinition(KSMetaData ksm,
java.util.UUID newVersion)
Remove table definition from system and update schema version |
void |
fixCFMaxId()
This gets called after initialization to make sure that id generation happens properly. |
Pair<java.lang.String,java.lang.String> |
getCF(java.lang.Integer cfId)
|
CFMetaData |
getCFMetaData(Descriptor descriptor)
|
CFMetaData |
getCFMetaData(java.lang.Integer cfId)
Get ColumnFamily metadata by its identifier |
CFMetaData |
getCFMetaData(java.lang.String tableName,
java.lang.String cfName)
Given a table name & column family name, get the column family meta data. |
ColumnFamilyType |
getColumnFamilyType(java.lang.String ksName,
java.lang.String cfName)
Get type of the ColumnFamily but it's keyspace/name |
AbstractType |
getComparator(java.lang.String ksName,
java.lang.String cfName)
Get column comparator for ColumnFamily but it's keyspace/name |
java.lang.Integer |
getId(java.lang.String ksName,
java.lang.String cfName)
Lookup keyspace/ColumnFamily identifier |
KSMetaData |
getKSMetaData(java.lang.String table)
Get metadata about table by its name |
java.util.List<java.lang.String> |
getNonSystemTables()
|
AbstractType |
getSubComparator(java.lang.String ksName,
java.lang.String cfName)
Get subComparator of the ColumnFamily |
KSMetaData |
getTableDefinition(java.lang.String table)
Get metadata about table by its name |
java.util.Collection<KSMetaData> |
getTableDefinitions()
|
Table |
getTableInstance(java.lang.String tableName)
Get table instance by name |
java.util.Map<java.lang.String,CFMetaData> |
getTableMetaData(java.lang.String tableName)
Get metadata about table inner ColumnFamilies |
java.util.Set<java.lang.String> |
getTables()
|
AbstractType |
getValueValidator(java.lang.String ksName,
java.lang.String cfName,
java.nio.ByteBuffer column)
Get value validator for specific column |
java.util.UUID |
getVersion()
|
void |
load(CFMetaData cfm)
Load individual ColumnFamily Definition to the schema (to make ColumnFamily lookup faster) |
Schema |
load(java.util.Collection<KSMetaData> tableDefs,
java.util.UUID version)
Load up non-system tables and set schema version to the given value |
int |
nextCFId()
|
void |
purge(CFMetaData cfm)
Used for ColumnFamily data eviction out from the schema |
Table |
removeTableInstance(java.lang.String tableName)
Remove table from schema |
void |
setTableDefinition(KSMetaData ksm,
java.util.UUID newVersion)
Update (or insert) new table definition and change schema version |
void |
setVersion(java.util.UUID newVersion)
Set new version of the schema |
void |
storeTableInstance(Table table)
Store given Table instance to the schema |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.util.UUID INITIAL_VERSION
public static final Schema instance
| Constructor Detail |
|---|
public Schema(java.util.UUID initialVersion)
initialVersion - The initial version of the schema| Method Detail |
|---|
public Schema load(java.util.Collection<KSMetaData> tableDefs,
java.util.UUID version)
tableDefs - The non-system table definitionsversion - The version of the schema
public Table getTableInstance(java.lang.String tableName)
tableName - The name of the table
public void storeTableInstance(Table table)
table - The Table instance to store
java.lang.IllegalArgumentException - if Table is already storedpublic Table removeTableInstance(java.lang.String tableName)
tableName - The name of the table to remove
public void clearTableDefinition(KSMetaData ksm,
java.util.UUID newVersion)
ksm - The table definition to removenewVersion - New version of the system
public CFMetaData getCFMetaData(java.lang.String tableName,
java.lang.String cfName)
tableName - The table namecfName - The ColumnFamily name
public CFMetaData getCFMetaData(java.lang.Integer cfId)
cfId - The ColumnFamily identifier
public CFMetaData getCFMetaData(Descriptor descriptor)
public ColumnFamilyType getColumnFamilyType(java.lang.String ksName,
java.lang.String cfName)
ksName - The keyspace namecfName - The ColumnFamily name
public AbstractType getComparator(java.lang.String ksName,
java.lang.String cfName)
ksName - The keyspace namecfName - The ColumnFamily name
public AbstractType getSubComparator(java.lang.String ksName,
java.lang.String cfName)
ksName - The keyspace namecfName - The ColumnFamily name
public AbstractType getValueValidator(java.lang.String ksName,
java.lang.String cfName,
java.nio.ByteBuffer column)
ksName - The keyspace namecfName - The ColumnFamily namecolumn - The name of the column
public KSMetaData getKSMetaData(java.lang.String table)
table - The name of the table
public java.util.List<java.lang.String> getNonSystemTables()
public KSMetaData getTableDefinition(java.lang.String table)
table - The name of the table
public java.util.Map<java.lang.String,CFMetaData> getTableMetaData(java.lang.String tableName)
tableName - The name of the table
public java.util.Set<java.lang.String> getTables()
public java.util.Collection<KSMetaData> getTableDefinitions()
public void setTableDefinition(KSMetaData ksm,
java.util.UUID newVersion)
ksm - The metadata about tablenewVersion - New schema versionpublic void addSystemTable(KSMetaData systemTable)
systemTable - The metadata describing new system tablepublic Pair<java.lang.String,java.lang.String> getCF(java.lang.Integer cfId)
cfId - The identifier of the ColumnFamily to lookup
public java.lang.Integer getId(java.lang.String ksName,
java.lang.String cfName)
ksName - The keyspace namecfName - The ColumnFamily name
public void load(CFMetaData cfm)
throws ConfigurationException
cfm - The ColumnFamily definition to load
ConfigurationException - if ColumnFamily was already loadedpublic void purge(CFMetaData cfm)
cfm - The ColumnFamily Definition to evictpublic void fixCFMaxId()
public int nextCFId()
public java.util.UUID getVersion()
public void setVersion(java.util.UUID newVersion)
newVersion - New version of the schema
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||