public class Table
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.lang.String |
name |
static java.util.concurrent.locks.ReentrantReadWriteLock |
switchLock
accesses to CFS.memtable should acquire this for thread safety.
|
static java.lang.String |
SYSTEM_KS |
static com.google.common.base.Function<java.lang.String,Table> |
tableTransformer |
Modifier and Type | Method and Description |
---|---|
static java.lang.Iterable<Table> |
all() |
void |
apply(RowMutation mutation,
boolean writeCommitLog) |
void |
apply(RowMutation mutation,
boolean writeCommitLog,
boolean updateIndexes)
This method appends a row to the global CommitLog, then updates memtables and indexes.
|
static Table |
clear(java.lang.String table) |
static Table |
clear(java.lang.String table,
Schema schema) |
void |
clearSnapshot(java.lang.String snapshotName)
Clear all the snapshots for a given table.
|
void |
createReplicationStrategy(KSMetaData ksm) |
void |
dropCf(java.util.UUID cfId) |
java.util.List<java.util.concurrent.Future<?>> |
flush() |
java.util.List<SSTableReader> |
getAllSSTables() |
ColumnFamilyStore |
getColumnFamilyStore(java.lang.String cfName) |
ColumnFamilyStore |
getColumnFamilyStore(java.util.UUID id) |
java.util.Collection<ColumnFamilyStore> |
getColumnFamilyStores() |
AbstractReplicationStrategy |
getReplicationStrategy() |
Row |
getRow(QueryFilter filter) |
static java.lang.String |
getTimestampedSnapshotName(java.lang.String clientSuppliedName) |
static void |
indexRow(DecoratedKey key,
ColumnFamilyStore cfs,
java.util.Set<java.lang.String> idxNames) |
void |
initCf(java.util.UUID cfId,
java.lang.String cfName,
boolean loadSSTables)
adds a cf to internal structures, ends up creating disk files).
|
static java.lang.Iterable<Table> |
nonSystem() |
static Table |
open(java.lang.String table) |
static Table |
openWithoutSSTables(java.lang.String table) |
static void |
removeUnreadableSSTables(java.io.File directory)
Removes every SSTable in the directory from the appropriate DataTracker's view.
|
void |
snapshot(java.lang.String snapshotName,
java.lang.String columnFamilyName)
Take a snapshot of the specific column family, or the entire set of column families
if columnFamily is null with a given timestamp
|
boolean |
snapshotExists(java.lang.String snapshotName)
Check whether snapshots already exists for a given name.
|
static java.lang.Iterable<Table> |
system() |
java.lang.String |
toString() |
public static final java.lang.String SYSTEM_KS
public static final java.util.concurrent.locks.ReentrantReadWriteLock switchLock
public final java.lang.String name
public static final com.google.common.base.Function<java.lang.String,Table> tableTransformer
public static Table open(java.lang.String table)
public static Table openWithoutSSTables(java.lang.String table)
public static Table clear(java.lang.String table) throws java.io.IOException
java.io.IOException
public static Table clear(java.lang.String table, Schema schema) throws java.io.IOException
java.io.IOException
public static void removeUnreadableSSTables(java.io.File directory)
directory
- the unreadable directory, possibly with SSTables in it, but not necessarily.public java.util.Collection<ColumnFamilyStore> getColumnFamilyStores()
public ColumnFamilyStore getColumnFamilyStore(java.lang.String cfName)
public ColumnFamilyStore getColumnFamilyStore(java.util.UUID id)
public void snapshot(java.lang.String snapshotName, java.lang.String columnFamilyName) throws java.io.IOException
snapshotName
- the tag associated with the name of the snapshot. This value may not be nullcolumnFamilyName
- the column family to snapshot or all on nulljava.io.IOException
- if the column family doesn't existpublic static java.lang.String getTimestampedSnapshotName(java.lang.String clientSuppliedName)
clientSuppliedName
- may be null.public boolean snapshotExists(java.lang.String snapshotName)
snapshotName
- the user supplied snapshot namepublic void clearSnapshot(java.lang.String snapshotName)
snapshotName
- the user supplied snapshot name. It empty or null,
all the snapshots will be cleanedpublic java.util.List<SSTableReader> getAllSSTables()
public void createReplicationStrategy(KSMetaData ksm)
public void dropCf(java.util.UUID cfId) throws java.io.IOException
java.io.IOException
public void initCf(java.util.UUID cfId, java.lang.String cfName, boolean loadSSTables)
public Row getRow(QueryFilter filter)
public void apply(RowMutation mutation, boolean writeCommitLog)
public void apply(RowMutation mutation, boolean writeCommitLog, boolean updateIndexes)
mutation
- the row to write. Must not be modified after calling apply, since commitlog append
may happen concurrently, depending on the CL Executor type.writeCommitLog
- false to disable commitlog append entirelyupdateIndexes
- false to disable index updates (used by CollationController "defragmenting")public AbstractReplicationStrategy getReplicationStrategy()
public static void indexRow(DecoratedKey key, ColumnFamilyStore cfs, java.util.Set<java.lang.String> idxNames)
key
- row to indexcfs
- ColumnFamily to index row inidxNames
- columns to index, in comparator orderpublic java.util.List<java.util.concurrent.Future<?>> flush()
public static java.lang.Iterable<Table> all()
public static java.lang.Iterable<Table> nonSystem()
public static java.lang.Iterable<Table> system()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2013 The Apache Software Foundation