public class Keyspace
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
KeyspaceMetrics |
metric |
ViewManager |
viewManager |
static OpOrder |
writeOrder |
Modifier and Type | Method and Description |
---|---|
static java.lang.Iterable<Keyspace> |
all() |
static java.util.stream.Stream<Keyspace> |
allExisting() |
void |
apply(Mutation mutation,
boolean writeCommitLog) |
void |
apply(Mutation mutation,
boolean writeCommitLog,
boolean updateIndexes) |
void |
apply(Mutation mutation,
boolean makeDurable,
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.
|
Future<?> |
applyFuture(Mutation mutation,
boolean writeCommitLog,
boolean updateIndexes) |
Future<?> |
applyFuture(Mutation mutation,
boolean writeCommitLog,
boolean updateIndexes,
boolean isDroppable,
boolean isDeferrable) |
static void |
clearSnapshot(java.lang.String snapshotName,
java.lang.String keyspace)
Clear all the snapshots for a given keyspace.
|
void |
dropCf(TableId tableId,
boolean dropData) |
java.util.List<Future<?>> |
flush(ColumnFamilyStore.FlushReason reason) |
java.util.stream.Stream<TableSnapshot> |
getAllSnapshots() |
java.util.List<SSTableReader> |
getAllSSTables(SSTableSet sstableSet) |
ColumnFamilyStore |
getColumnFamilyStore(java.lang.String cfName) |
ColumnFamilyStore |
getColumnFamilyStore(TableId id) |
java.util.Collection<ColumnFamilyStore> |
getColumnFamilyStores() |
KeyspaceMetadata |
getMetadata() |
java.lang.String |
getName() |
KeyspaceRepairManager |
getRepairManager() |
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) |
KeyspaceWriteHandler |
getWriteHandler() |
boolean |
hasColumnFamilyStore(TableId id) |
void |
initCf(TableMetadataRef 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 boolean |
isInitialized() |
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 Keyspace |
open(java.lang.String keyspaceName,
SchemaProvider schema,
boolean loadSSTables) |
static ColumnFamilyStore |
openAndGetStore(TableMetadata table) |
static ColumnFamilyStore |
openAndGetStore(TableMetadataRef tableRef) |
static Keyspace |
openWithoutSSTables(java.lang.String keyspaceName) |
static void |
removeUnreadableSSTables(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,
DurationSpec.IntSecondsBound ttl,
com.google.common.util.concurrent.RateLimiter rateLimiter,
java.time.Instant creationTime)
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() |
void |
unload(boolean dropData)
Unloads all column family stores and releases metrics.
|
static void |
unsetInitialized()
Never use it in production code.
|
public final KeyspaceMetrics metric
public static final OpOrder writeOrder
public final ViewManager viewManager
public static boolean isInitialized()
public static void setInitialized()
public static void unsetInitialized()
public static Keyspace open(java.lang.String keyspaceName)
public static Keyspace openWithoutSSTables(java.lang.String keyspaceName)
public static Keyspace open(java.lang.String keyspaceName, SchemaProvider schema, boolean loadSSTables)
public static ColumnFamilyStore openAndGetStore(TableMetadataRef tableRef)
public static ColumnFamilyStore openAndGetStore(TableMetadata table)
public static void removeUnreadableSSTables(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(TableId id)
public boolean hasColumnFamilyStore(TableId id)
public void snapshot(java.lang.String snapshotName, java.lang.String columnFamilyName, boolean skipFlush, DurationSpec.IntSecondsBound ttl, com.google.common.util.concurrent.RateLimiter rateLimiter, java.time.Instant creationTime) 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 memtablerateLimiter
- Rate limiter for hardlinks-per-secondjava.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 java.util.stream.Stream<TableSnapshot> getAllSnapshots()
public KeyspaceRepairManager getRepairManager()
public static Keyspace mockKS(KeyspaceMetadata metadata)
public void dropCf(TableId tableId, boolean dropData)
public void unload(boolean dropData)
public void initCfCustom(ColumnFamilyStore newCfs)
public KeyspaceWriteHandler getWriteHandler()
public void initCf(TableMetadataRef metadata, boolean loadSSTables)
public Future<?> applyFuture(Mutation mutation, boolean writeCommitLog, boolean updateIndexes)
public Future<?> 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 makeDurable, 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.makeDurable
- if true, don't return unless write has been made durableupdateIndexes
- 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_timeoutpublic AbstractReplicationStrategy getReplicationStrategy()
public java.util.List<Future<?>> flush(ColumnFamilyStore.FlushReason reason)
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.util.stream.Stream<Keyspace> allExisting()
Stream
of all existing/open Keyspace
instancespublic 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 © 2009-2022 The Apache Software Foundation