public class Keyspace
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static com.google.common.base.Function<java.lang.String,Keyspace> |
keyspaceTransformer |
KeyspaceMetrics |
metric |
OpOrder |
writeOrder |
Modifier and Type | Method and Description |
---|---|
static java.lang.Iterable<Keyspace> |
all() |
void |
apply(Mutation mutation,
boolean writeCommitLog) |
void |
apply(Mutation mutation,
boolean writeCommitLog,
boolean updateIndexes)
This method appends a row to the global CommitLog, then updates memtables and indexes.
|
static Keyspace |
clear(java.lang.String keyspaceName) |
static Keyspace |
clear(java.lang.String keyspaceName,
Schema schema) |
static void |
clearSnapshot(java.lang.String snapshotName,
java.lang.String keyspace)
Clear all the snapshots for a given keyspace.
|
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() |
KSMetaData |
getMetadata() |
java.lang.String |
getName() |
AbstractReplicationStrategy |
getReplicationStrategy() |
Row |
getRow(QueryFilter filter) |
static java.lang.String |
getTimestampedSnapshotName(java.lang.String clientSuppliedName) |
java.lang.Iterable<ColumnFamilyStore> |
getValidColumnFamilies(boolean allowIndexes,
boolean autoAddIndexes,
java.lang.String... cfNames) |
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 Keyspace |
mockKS(KSMetaData metadata) |
static java.lang.Iterable<Keyspace> |
nonSystem() |
static Keyspace |
open(java.lang.String keyspaceName) |
static Keyspace |
openWithoutSSTables(java.lang.String keyspaceName) |
static void |
removeUnreadableSSTables(java.io.File directory)
Removes every SSTable in the directory from the appropriate Tracker's view.
|
static void |
setInitialized() |
void |
setMetadata(KSMetaData ksm) |
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<Keyspace> |
system() |
java.lang.String |
toString() |
public final KeyspaceMetrics metric
public final OpOrder writeOrder
public static final com.google.common.base.Function<java.lang.String,Keyspace> keyspaceTransformer
public static void setInitialized()
public static Keyspace open(java.lang.String keyspaceName)
public static Keyspace openWithoutSSTables(java.lang.String keyspaceName)
public static Keyspace clear(java.lang.String keyspaceName)
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 static void clearSnapshot(java.lang.String snapshotName, java.lang.String keyspace)
snapshotName
- the user supplied snapshot name. It empty or null,
all the snapshots will be cleanedpublic java.util.List<SSTableReader> getAllSSTables()
public static Keyspace mockKS(KSMetaData metadata)
public void setMetadata(KSMetaData ksm)
public KSMetaData getMetadata()
public void dropCf(java.util.UUID cfId)
public void initCf(java.util.UUID cfId, java.lang.String cfName, boolean loadSSTables)
public Row getRow(QueryFilter filter)
public void apply(Mutation mutation, boolean writeCommitLog)
public void apply(Mutation 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 java.lang.Iterable<ColumnFamilyStore> getValidColumnFamilies(boolean allowIndexes, boolean autoAddIndexes, java.lang.String... cfNames) throws java.io.IOException
java.io.IOException
public static java.lang.Iterable<Keyspace> all()
public static java.lang.Iterable<Keyspace> nonSystem()
public static java.lang.Iterable<Keyspace> system()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getName()
Copyright © 2015 The Apache Software Foundation