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 |
ViewManager |
viewManager |
static OpOrder |
writeOrder |
Modifier and Type | Method and Description |
---|---|
static java.lang.Iterable<Keyspace> |
all() |
java.util.concurrent.CompletableFuture<?> |
apply(Mutation mutation,
boolean writeCommitLog) |
java.util.concurrent.CompletableFuture<?> |
apply(Mutation mutation,
boolean writeCommitLog,
boolean updateIndexes) |
java.util.concurrent.CompletableFuture<?> |
apply(Mutation mutation,
boolean writeCommitLog,
boolean updateIndexes,
boolean isClReplay,
java.util.concurrent.CompletableFuture<?> future)
This method appends a row to the global CommitLog, then updates memtables and indexes.
|
java.util.concurrent.CompletableFuture<?> |
applyFromCommitLog(Mutation mutation) |
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(SSTableSet sstableSet) |
ColumnFamilyStore |
getColumnFamilyStore(java.lang.String cfName) |
ColumnFamilyStore |
getColumnFamilyStore(java.util.UUID id) |
java.util.Collection<ColumnFamilyStore> |
getColumnFamilyStores() |
KeyspaceMetadata |
getMetadata() |
java.lang.String |
getName() |
AbstractReplicationStrategy |
getReplicationStrategy() |
static java.lang.String |
getTimestampedSnapshotName(java.lang.String clientSuppliedName) |
java.lang.Iterable<ColumnFamilyStore> |
getValidColumnFamilies(boolean allowIndexes,
boolean autoAddIndexes,
java.lang.String... cfNames) |
boolean |
hasColumnFamilyStore(java.util.UUID id) |
static void |
indexPartition(DecoratedKey key,
ColumnFamilyStore cfs,
java.util.Set<Index> indexes) |
void |
initCf(CFMetaData metadata,
boolean loadSSTables)
adds a cf to internal structures, ends up creating disk files).
|
static Keyspace |
mockKS(KeyspaceMetadata metadata) |
static java.lang.Iterable<Keyspace> |
nonLocalStrategy() |
static java.lang.Iterable<Keyspace> |
nonSystem() |
static Keyspace |
open(java.lang.String keyspaceName) |
static ColumnFamilyStore |
openAndGetStore(CFMetaData cfm) |
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(KeyspaceMetadata metadata) |
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 static final OpOrder writeOrder
public final ViewManager viewManager
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 ColumnFamilyStore openAndGetStore(CFMetaData cfm)
public static void removeUnreadableSSTables(java.io.File directory)
directory
- the unreadable directory, possibly with SSTables in it, but not necessarily.public void setMetadata(KeyspaceMetadata metadata)
public KeyspaceMetadata getMetadata()
public java.util.Collection<ColumnFamilyStore> getColumnFamilyStores()
public ColumnFamilyStore getColumnFamilyStore(java.lang.String cfName)
public ColumnFamilyStore getColumnFamilyStore(java.util.UUID id)
public boolean hasColumnFamilyStore(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(SSTableSet sstableSet)
public static Keyspace mockKS(KeyspaceMetadata metadata)
public void dropCf(java.util.UUID cfId)
public void initCf(CFMetaData metadata, boolean loadSSTables)
public java.util.concurrent.CompletableFuture<?> apply(Mutation mutation, boolean writeCommitLog)
public java.util.concurrent.CompletableFuture<?> apply(Mutation mutation, boolean writeCommitLog, boolean updateIndexes)
public java.util.concurrent.CompletableFuture<?> applyFromCommitLog(Mutation mutation)
public java.util.concurrent.CompletableFuture<?> apply(Mutation mutation, boolean writeCommitLog, boolean updateIndexes, boolean isClReplay, java.util.concurrent.CompletableFuture<?> future)
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")isClReplay
- true if caller is the commitlog replayerpublic AbstractReplicationStrategy getReplicationStrategy()
public static void indexPartition(DecoratedKey key, ColumnFamilyStore cfs, java.util.Set<Index> indexes)
key
- row to indexcfs
- ColumnFamily to index partition inindexes
- the indexes to submit the row topublic 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> nonLocalStrategy()
public static java.lang.Iterable<Keyspace> system()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getName()
Copyright © 2016 The Apache Software Foundation