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() |
void |
apply(Mutation mutation,
boolean writeCommitLog) |
void |
apply(Mutation mutation,
boolean writeCommitLog,
boolean updateIndexes) |
void |
apply(Mutation mutation,
boolean writeCommitLog,
boolean updateIndexes,
boolean isDroppable)
If apply is blocking, apply must not be deferred
Otherwise there is a race condition where ALL mutation workers are beeing blocked ending
in a complete deadlock of the mutation stage.
|
java.util.concurrent.CompletableFuture<?> |
applyFuture(Mutation mutation,
boolean writeCommitLog,
boolean updateIndexes) |
java.util.concurrent.CompletableFuture<?> |
applyFuture(Mutation mutation,
boolean writeCommitLog,
boolean updateIndexes,
boolean isDroppable,
boolean isDeferrable) |
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) |
static java.lang.String |
getTimestampedSnapshotNameWithPrefix(java.lang.String clientSuppliedName,
java.lang.String prefix) |
java.lang.Iterable<ColumnFamilyStore> |
getValidColumnFamilies(boolean allowIndexes,
boolean autoAddIndexes,
java.lang.String... cfNames) |
boolean |
hasColumnFamilyStore(java.util.UUID id) |
void |
initCf(CFMetaData metadata,
boolean loadSSTables)
adds a cf to internal structures, ends up creating disk files).
|
void |
initCfCustom(ColumnFamilyStore newCfs)
Registers a custom cf instance with this keyspace.
|
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
|
void |
snapshot(java.lang.String snapshotName,
java.lang.String columnFamilyName,
boolean skipFlush)
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, boolean skipFlush) 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 nullskipFlush
- Skip blocking flush of memtablejava.io.IOException
- if the column family doesn't existpublic 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 static java.lang.String getTimestampedSnapshotNameWithPrefix(java.lang.String clientSuppliedName, java.lang.String prefix)
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 initCfCustom(ColumnFamilyStore newCfs)
public void initCf(CFMetaData metadata, boolean loadSSTables)
public java.util.concurrent.CompletableFuture<?> applyFuture(Mutation mutation, boolean writeCommitLog, boolean updateIndexes)
public java.util.concurrent.CompletableFuture<?> applyFuture(Mutation mutation, boolean writeCommitLog, boolean updateIndexes, boolean isDroppable, boolean isDeferrable)
public void apply(Mutation mutation, boolean writeCommitLog, boolean updateIndexes)
public void apply(Mutation mutation, boolean writeCommitLog)
public void apply(Mutation mutation, boolean writeCommitLog, boolean updateIndexes, boolean isDroppable)
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")isDroppable
- true if this should throw WriteTimeoutException if it does not acquire lock within write_request_timeout_in_msjava.util.concurrent.ExecutionException
public AbstractReplicationStrategy getReplicationStrategy()
public 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 © 2017 The Apache Software Foundation