public class ColumnFamilyStore extends java.lang.Object implements ColumnFamilyStoreMBean, Memtable.Owner
Modifier and Type | Class and Description |
---|---|
static class |
ColumnFamilyStore.FlushReason
Reason for initiating a memtable flush.
|
static class |
ColumnFamilyStore.RefViewFragment |
static class |
ColumnFamilyStore.ViewFragment |
Modifier and Type | Field and Description |
---|---|
long |
additionalWriteLatencyMicros |
SecondaryIndexManager |
indexManager |
Keyspace |
keyspace |
TableMetadataRef |
metadata |
TableMetrics |
metric |
java.lang.String |
name |
OpOrder |
readOrdering |
long |
sampleReadLatencyMicros |
static java.lang.String |
SNAPSHOT_DROP_PREFIX |
static java.lang.String |
SNAPSHOT_TRUNCATE_PREFIX |
TopPartitionTracker |
topPartitions |
TableViews |
viewManager |
Constructor and Description |
---|
ColumnFamilyStore(Keyspace keyspace,
java.lang.String columnFamilyName,
java.util.function.Supplier<? extends SSTableId> sstableIdGenerator,
TableMetadataRef metadata,
Directories directories,
boolean loadSSTables,
boolean registerBookeeping,
boolean offline) |
Modifier and Type | Method and Description |
---|---|
static java.lang.Iterable<Memtable> |
activeMemtables() |
void |
addSSTable(SSTableReader sstable) |
void |
addSSTables(java.util.Collection<SSTableReader> sstables) |
static java.lang.Iterable<ColumnFamilyStore> |
all() |
void |
apply(PartitionUpdate update,
UpdateTransaction indexer,
OpOrder.Group opGroup,
CommitLogPosition commitLogPosition)
Insert/Update the column family for this key.
|
void |
beginLocalSampling(java.lang.String sampler,
int capacity,
int durationMillis)
begin sampling for a specific sampler with a given capacity.
|
void |
cleanupCache() |
protected static void |
clearEphemeralSnapshots(Directories directories) |
void |
clearSnapshot(java.lang.String snapshotName)
Clear all the snapshots for a given column family.
|
void |
clearUnsafe()
For testing.
|
void |
compactionDiskSpaceCheck(boolean enable) |
java.lang.Iterable<ColumnFamilyStore> |
concatWithIndexes() |
boolean |
containsCachedParition(DecoratedKey key) |
static ColumnFamilyStore |
createColumnFamilyStore(Keyspace keyspace,
java.lang.String columnFamily,
TableMetadataRef metadata,
boolean loadSSTables) |
static ColumnFamilyStore |
createColumnFamilyStore(Keyspace keyspace,
java.lang.String columnFamily,
TableMetadataRef metadata,
Directories directories,
boolean loadSSTables,
boolean registerBookkeeping,
boolean offline)
This is only directly used by offline tools
|
static ColumnFamilyStore |
createColumnFamilyStore(Keyspace keyspace,
TableMetadataRef metadata,
boolean loadSSTables) |
AbstractCompactionStrategy |
createCompactionStrategyInstance(CompactionParams compactionParams) |
Memtable |
createMemtable(java.util.concurrent.atomic.AtomicReference<CommitLogPosition> commitLogUpperBound) |
protected TableSnapshot |
createSnapshot(java.lang.String tag,
boolean ephemeral,
DurationSpec.IntSecondsBound ttl,
java.util.Set<SSTableReader> sstables,
java.time.Instant creationTime) |
SSTableMultiWriter |
createSSTableMultiWriter(Descriptor descriptor,
long keyCount,
long repairedAt,
TimeUUID pendingRepair,
boolean isTransient,
int sstableLevel,
SerializationHeader header,
LifecycleNewTracker lifecycleNewTracker) |
SSTableMultiWriter |
createSSTableMultiWriter(Descriptor descriptor,
long keyCount,
long repairedAt,
TimeUUID pendingRepair,
boolean isTransient,
MetadataCollector metadataCollector,
SerializationHeader header,
LifecycleNewTracker lifecycleNewTracker) |
DecoratedKey |
decorateKey(java.nio.ByteBuffer key) |
void |
disableAutoCompaction() |
void |
discardSSTables(long truncatedAt)
Discard all SSTables that were created before given timestamp.
|
Future<CommitLogPosition> |
dumpMemtable()
Drops current memtable without flushing to disk.
|
void |
enableAutoCompaction() |
void |
enableAutoCompaction(boolean waitForFutures)
used for tests - to be able to check things after a minor compaction
|
long |
estimatedKeysForRange(Range<Token> range) |
long |
estimateKeys() |
java.util.List<javax.management.openmbean.CompositeData> |
finishLocalSampling(java.lang.String sampler,
int count) |
CommitLogPosition |
forceBlockingFlush(ColumnFamilyStore.FlushReason reason) |
CompactionManager.AllSSTableOpStatus |
forceCleanup(int jobs) |
void |
forceCompactionForKey(DecoratedKey key) |
void |
forceCompactionForTokenRange(java.util.Collection<Range<Token>> tokenRanges)
Forces a major compaction of specified token ranges in this column family.
|
void |
forceCompactionForTokenRanges(java.lang.String... strings)
Forces a major compaction of specified token ranges in this column family.
|
Future<CommitLogPosition> |
forceFlush(ColumnFamilyStore.FlushReason reason)
Flush if there is unflushed data in the memtables
|
Future<?> |
forceFlush(CommitLogPosition flushIfDirtyBefore)
Flush if there is unflushed data that was written to the CommitLog before @param flushIfDirtyBefore
(inclusive).
|
void |
forceMajorCompaction() |
void |
forceMajorCompaction(boolean splitOutput)
force a major compaction of this column family
|
CompactionManager.AllSSTableOpStatus |
garbageCollect(CompactionParams.TombstoneOption tombstoneOption,
int jobs) |
int |
gcBefore(int nowInSec) |
Refs<SSTableReader> |
getAndReferenceOverlappingLiveSSTables(java.lang.Iterable<SSTableReader> sstables)
like getOverlappingSSTables, but acquires references before returning
|
static java.lang.Runnable |
getBackgroundCompactionTaskSubmitter() |
java.util.List<java.lang.String> |
getBuiltIndexes()
Returns a list of the names of the built column indexes for current store
|
ClockAndCount |
getCachedCounter(java.nio.ByteBuffer partitionKey,
Clustering<?> clustering,
ColumnMetadata column,
CellPath path) |
static java.lang.String |
getColumnFamilieMBeanName(java.lang.String ks,
java.lang.String name,
boolean isIndex) |
java.lang.String |
getColumnFamilyName()
Deprecated.
|
java.util.Map<java.lang.String,java.lang.String> |
getCompactionParameters() |
java.lang.String |
getCompactionParametersJson() |
CompactionStrategyManager |
getCompactionStrategyManager() |
ClusteringComparator |
getComparator() |
java.util.Map<java.lang.String,java.lang.String> |
getCompressionParameters()
Get the compression parameters
|
java.lang.String |
getCompressionParametersJson() |
java.lang.Double |
getCrcCheckChance() |
Memtable |
getCurrentMemtable()
Get the current memtable for this owner.
|
java.util.List<java.lang.String> |
getDataPaths() |
Directories |
getDirectories() |
DiskBoundaries |
getDiskBoundaries() |
double |
getDroppableTombstoneRatio()
Get the ratio of droppable tombstones to real columns (and non-droppable tombstones)
|
long |
getExpectedCompactedFileSize(java.lang.Iterable<SSTableReader> sstables,
OperationType operation)
Calculate expected file size of SSTable after compaction.
|
static ColumnFamilyStore |
getIfExists(java.lang.String ksName,
java.lang.String cfName)
Returns a ColumnFamilyStore by ksname and cfname if it exists, null otherwise
Differently from others, this method does not throw exception if the keyspace or table does not exist.
|
static ColumnFamilyStore |
getIfExists(TableId id)
Returns a ColumnFamilyStore by id if it exists, null otherwise
Differently from others, this method does not throw exception if the table does not exist.
|
java.lang.Iterable<Memtable> |
getIndexMemtables()
Collect the index memtables flushed together with this.
|
int |
getLevelFanoutSize() |
java.util.Set<SSTableReader> |
getLiveSSTables() |
int |
getMaximumCompactionThreshold()
Gets the maximum number of sstables in queue before compaction kicks off
|
SSTableReader |
getMaxSizeFile(java.lang.Iterable<SSTableReader> sstables) |
int |
getMeanEstimatedCellPerPartitionCount() |
double |
getMeanPartitionSize() |
int |
getMeanRowCount() |
int |
getMinimumCompactionThreshold()
Gets the minimum number of sstables in queue before compaction kicks off
|
boolean |
getNeverPurgeTombstones() |
java.util.Collection<SSTableReader> |
getOverlappingLiveSSTables(java.lang.Iterable<SSTableReader> sstables) |
IPartitioner |
getPartitioner() |
PaxosRepairHistory |
getPaxosRepairHistory() |
PaxosRepairHistory |
getPaxosRepairHistoryForRanges(java.util.Collection<Range<Token>> ranges) |
Ballot |
getPaxosRepairLowBound(DecoratedKey key) |
java.util.Map<TimeUUID,PendingStat> |
getPendingRepairStats() |
long[] |
getPerLevelSizeBytes() |
CachedPartition |
getRawCachedPartition(DecoratedKey key) |
TableRepairManager |
getRepairManager() |
Refs<SSTableReader> |
getSnapshotSSTableReaders(java.lang.String tag) |
int[] |
getSSTableCountPerLevel() |
java.lang.Iterable<SSTableReader> |
getSSTables(SSTableSet sstableSet) |
java.util.List<java.lang.String> |
getSSTablesForKey(java.lang.String key)
Returns a list of filenames that contain the given key on this node
|
java.util.List<java.lang.String> |
getSSTablesForKey(java.lang.String key,
boolean hexFormat)
Returns a list of filenames that contain the given key on this node
|
TableStreamManager |
getStreamManager() |
static java.lang.String |
getTableMBeanName(java.lang.String ks,
java.lang.String name,
boolean isIndex) |
java.lang.String |
getTableName() |
java.util.Map<java.lang.String,java.lang.Long> |
getTopSizePartitions() |
java.lang.Long |
getTopSizePartitionsLastUpdate() |
java.util.Map<java.lang.String,java.lang.Long> |
getTopTombstonePartitions() |
java.lang.Long |
getTopTombstonePartitionsLastUpdate() |
Tracker |
getTracker()
Package protected for access from the CompactionManager.
|
java.lang.Iterable<SSTableReader> |
getUncompactingSSTables() |
int |
getUnleveledSSTables() |
TableWriteHandler |
getWriteHandler() |
boolean |
hasMisplacedSSTables()
Check SSTables whether or not they are misplaced.
|
java.util.List<java.lang.String> |
importNewSSTables(java.util.Set<java.lang.String> srcPaths,
boolean resetLevel,
boolean clearRepaired,
boolean verifySSTables,
boolean verifyTokens,
boolean invalidateCaches,
boolean extendedVerify)
Load new sstables from the given directory
|
java.util.List<java.lang.String> |
importNewSSTables(java.util.Set<java.lang.String> srcPaths,
boolean resetLevel,
boolean clearRepaired,
boolean verifySSTables,
boolean verifyTokens,
boolean invalidateCaches,
boolean extendedVerify,
boolean copyData)
#Load new sstables from the given directory
|
void |
invalidate()
call when dropping or renaming a CF.
|
void |
invalidate(boolean expectMBean) |
void |
invalidate(boolean expectMBean,
boolean dropData) |
void |
invalidateCachedPartition(DecoratedKey key) |
void |
invalidateCachedPartition(RowCacheKey key) |
int |
invalidateCounterCache(java.util.Collection<Bounds<Token>> boundsToInvalidate) |
void |
invalidateLocalRanges() |
int |
invalidateRowCache(java.util.Collection<Bounds<Token>> boundsToInvalidate) |
boolean |
isAutoCompactionDisabled() |
boolean |
isCompactionDiskSpaceCheckEnabled() |
boolean |
isCounterCacheEnabled() |
boolean |
isEmpty() |
boolean |
isFilterFullyCoveredBy(ClusteringIndexFilter filter,
DataLimits limits,
CachedPartition cached,
int nowInSec,
boolean enforceStrictLiveness) |
boolean |
isIndex()
true if this CFS contains secondary index data
|
boolean |
isKeyCacheEnabled() |
boolean |
isRowCacheEnabled() |
boolean |
isValid() |
java.lang.Iterable<DecoratedKey> |
keySamples(Range<Token> range) |
java.util.Map<java.lang.String,TableSnapshot> |
listSnapshots() |
void |
loadNewSSTables()
Deprecated.
|
static void |
loadNewSSTables(java.lang.String ksName,
java.lang.String cfName)
See #
StorageService.importNewSSTables for more info |
ShardBoundaries |
localRangeSplits(int shardCount)
Construct a list of boundaries that split the locally-owned ranges into the given number of shards,
splitting the owned space evenly.
|
LifecycleTransaction |
markAllCompacting(OperationType operationType) |
void |
markObsolete(java.util.Collection<SSTableReader> sstables,
OperationType compactionType) |
boolean |
memtableWritesAreDurable() |
TableMetadata |
metadata() |
static TableMetrics |
metricsFor(TableId tableId) |
Descriptor |
newSSTableDescriptor(File directory) |
Descriptor |
newSSTableDescriptor(File directory,
SSTableFormat.Type format) |
Descriptor |
newSSTableDescriptor(File directory,
Version version,
SSTableFormat.Type format) |
void |
onPaxosRepairComplete(java.util.Collection<Range<Token>> ranges,
Ballot highBallot) |
void |
putCachedCounter(java.nio.ByteBuffer partitionKey,
Clustering<?> clustering,
ColumnMetadata column,
CellPath path,
ClockAndCount clockAndCount) |
boolean |
rebuildOnFailedScrub(java.lang.Throwable failure)
CASSANDRA-5174 : For an index cfs we may be able to discard everything and just rebuild
the index when a scrub fails.
|
void |
rebuildSecondaryIndex(java.lang.String idxName) |
static void |
rebuildSecondaryIndex(java.lang.String ksName,
java.lang.String cfName,
java.lang.String... idxNames) |
CleanupSummary |
releaseRepairData(java.util.Collection<TimeUUID> sessions,
boolean force)
promotes (or demotes) data attached to an incremental repair session that has either completed successfully,
or failed
|
void |
reload() |
CompactionManager.AllSSTableOpStatus |
relocateSSTables(int jobs) |
<V> V |
runWithCompactionsDisabled(java.util.concurrent.Callable<V> callable,
boolean interruptValidation,
boolean interruptViews) |
<V> V |
runWithCompactionsDisabled(java.util.concurrent.Callable<V> callable,
com.google.common.base.Predicate<SSTableReader> sstablesPredicate,
boolean interruptValidation,
boolean interruptViews,
boolean interruptIndexes)
Runs callable with compactions paused and compactions including sstables matching sstablePredicate stopped
|
CompactionManager.AllSSTableOpStatus |
scrub(boolean disableSnapshot,
boolean skipCorrupted,
boolean reinsertOverflowedTTL,
boolean alwaysFail,
boolean checkData,
int jobs) |
CompactionManager.AllSSTableOpStatus |
scrub(boolean disableSnapshot,
boolean skipCorrupted,
boolean checkData,
boolean reinsertOverflowedTTL,
int jobs) |
static void |
scrubDataDirectories(TableMetadata metadata)
Removes unnecessary files from the cf directory at startup: these include temp files, orphans, zero-length files
and compacted sstables.
|
ColumnFamilyStore.ViewFragment |
select(com.google.common.base.Function<View,java.lang.Iterable<SSTableReader>> filter) |
ColumnFamilyStore.RefViewFragment |
selectAndReference(com.google.common.base.Function<View,java.lang.Iterable<SSTableReader>> filter) |
void |
setCompactionParameters(java.util.Map<java.lang.String,java.lang.String> options)
Sets the compaction parameters locally for this node
Note that this will be set until an ALTER with compaction = {..} is executed or the node is restarted
|
void |
setCompactionParametersJson(java.lang.String options)
Sets the compaction parameters locally for this node
Note that this will be set until an ALTER with compaction = {..} is executed or the node is restarted
|
void |
setCompactionThresholds(int minThreshold,
int maxThreshold)
Sets the maximum and maximum number of SSTables in queue before compaction kicks off
|
void |
setCompressionParameters(java.util.Map<java.lang.String,java.lang.String> opts)
Set the compression parameters locally for this node
|
void |
setCompressionParametersJson(java.lang.String options) |
void |
setCrcCheckChance(double crcCheckChance)
Set new crc check chance
|
void |
setMaximumCompactionThreshold(int maxCompactionThreshold)
Sets the maximum number of sstables in queue before compaction kicks off
|
void |
setMinimumCompactionThreshold(int minCompactionThreshold)
Sets the minimum number of sstables in queue before compaction kicks off
|
void |
setNeverPurgeTombstones(boolean value) |
static void |
shutdownExecutorsAndWait(long timeout,
java.util.concurrent.TimeUnit unit) |
static void |
shutdownPostFlushExecutor() |
Future<CommitLogPosition> |
signalFlushRequired(Memtable memtable,
ColumnFamilyStore.FlushReason reason)
Signal to the owner that a flush is required (e.g.
|
TableSnapshot |
snapshot(java.lang.String snapshotName)
Take a snap shot of this columnfamily store.
|
TableSnapshot |
snapshot(java.lang.String snapshotName,
boolean skipMemtable,
DurationSpec.IntSecondsBound ttl,
com.google.common.util.concurrent.RateLimiter rateLimiter,
java.time.Instant creationTime)
Take a snap shot of this columnfamily store.
|
TableSnapshot |
snapshot(java.lang.String snapshotName,
DurationSpec.IntSecondsBound ttl) |
TableSnapshot |
snapshot(java.lang.String snapshotName,
com.google.common.base.Predicate<SSTableReader> predicate,
boolean ephemeral,
boolean skipMemtable) |
TableSnapshot |
snapshot(java.lang.String snapshotName,
com.google.common.base.Predicate<SSTableReader> predicate,
boolean ephemeral,
boolean skipMemtable,
DurationSpec.IntSecondsBound ttl,
com.google.common.util.concurrent.RateLimiter rateLimiter,
java.time.Instant creationTime) |
boolean |
snapshotExists(java.lang.String snapshotName) |
TableSnapshot |
snapshotWithoutMemtable(java.lang.String snapshotName) |
TableSnapshot |
snapshotWithoutMemtable(java.lang.String snapshotName,
java.time.Instant creationTime) |
TableSnapshot |
snapshotWithoutMemtable(java.lang.String snapshotName,
com.google.common.base.Predicate<SSTableReader> predicate,
boolean ephemeral,
DurationSpec.IntSecondsBound ttl,
com.google.common.util.concurrent.RateLimiter rateLimiter,
java.time.Instant creationTime) |
CompactionManager.AllSSTableOpStatus |
sstablesRewrite(boolean skipIfCurrentVersion,
long skipIfNewerThanTimestamp,
boolean skipIfCompressionMatches,
int jobs)
Rewrites all SSTables according to specified parameters
|
boolean |
streamFromMemtable() |
boolean |
streamToMemtable() |
boolean |
supportsEarlyOpen() |
Future<CommitLogPosition> |
switchMemtable(ColumnFamilyStore.FlushReason reason) |
Future<CommitLogPosition> |
switchMemtableIfCurrent(Memtable memtable,
ColumnFamilyStore.FlushReason reason)
Switches the memtable iff the live memtable is the one provided
|
void |
syncPaxosRepairHistory(PaxosRepairHistory sync,
boolean flush) |
java.lang.String |
toString() |
long |
trueSnapshotsSize() |
void |
truncateBlocking() |
void |
truncateBlockingWithoutSnapshot() |
void |
unloadCf() |
void |
updateSpeculationThreshold() |
CompactionManager.AllSSTableOpStatus |
verify(Verifier.Options options) |
void |
writeAndAddMemtableRanges(TimeUUID repairSessionID,
java.util.function.Supplier<java.util.Collection<Range<PartitionPosition>>> rangesSupplier,
Refs<SSTableReader> placeIntoRefs) |
boolean |
writesShouldSkipCommitLog() |
public static final java.lang.String SNAPSHOT_TRUNCATE_PREFIX
public static final java.lang.String SNAPSHOT_DROP_PREFIX
public final Keyspace keyspace
public final java.lang.String name
public final TableMetadataRef metadata
public final OpOrder readOrdering
public final SecondaryIndexManager indexManager
public final TableViews viewManager
public final TableMetrics metric
public volatile long sampleReadLatencyMicros
public volatile long additionalWriteLatencyMicros
public final TopPartitionTracker topPartitions
public ColumnFamilyStore(Keyspace keyspace, java.lang.String columnFamilyName, java.util.function.Supplier<? extends SSTableId> sstableIdGenerator, TableMetadataRef metadata, Directories directories, boolean loadSSTables, boolean registerBookeeping, boolean offline)
public static void shutdownPostFlushExecutor() throws java.lang.InterruptedException
java.lang.InterruptedException
public static void shutdownExecutorsAndWait(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException
java.lang.InterruptedException
java.util.concurrent.TimeoutException
public void reload()
public static java.lang.Runnable getBackgroundCompactionTaskSubmitter()
public java.util.Map<java.lang.String,java.lang.String> getCompactionParameters()
getCompactionParameters
in interface ColumnFamilyStoreMBean
public java.lang.String getCompactionParametersJson()
getCompactionParametersJson
in interface ColumnFamilyStoreMBean
public void setCompactionParameters(java.util.Map<java.lang.String,java.lang.String> options)
ColumnFamilyStoreMBean
setCompactionParameters
in interface ColumnFamilyStoreMBean
options
- compaction options mappublic void setCompactionParametersJson(java.lang.String options)
ColumnFamilyStoreMBean
setCompactionParametersJson
in interface ColumnFamilyStoreMBean
options
- compaction options with the same syntax as when doing ALTER ... WITH compaction = {..}public java.util.Map<java.lang.String,java.lang.String> getCompressionParameters()
ColumnFamilyStoreMBean
getCompressionParameters
in interface ColumnFamilyStoreMBean
public java.lang.String getCompressionParametersJson()
getCompressionParametersJson
in interface ColumnFamilyStoreMBean
public void setCompressionParameters(java.util.Map<java.lang.String,java.lang.String> opts)
ColumnFamilyStoreMBean
setCompressionParameters
in interface ColumnFamilyStoreMBean
opts
- map of string names to valuespublic void setCompressionParametersJson(java.lang.String options)
setCompressionParametersJson
in interface ColumnFamilyStoreMBean
public static java.lang.String getTableMBeanName(java.lang.String ks, java.lang.String name, boolean isIndex)
public static java.lang.String getColumnFamilieMBeanName(java.lang.String ks, java.lang.String name, boolean isIndex)
public void updateSpeculationThreshold()
public TableWriteHandler getWriteHandler()
public TableStreamManager getStreamManager()
public TableRepairManager getRepairManager()
public TableMetadata metadata()
public Directories getDirectories()
public java.util.List<java.lang.String> getDataPaths() throws java.io.IOException
getDataPaths
in interface ColumnFamilyStoreMBean
java.io.IOException
public boolean writesShouldSkipCommitLog()
public boolean memtableWritesAreDurable()
public boolean streamToMemtable()
public boolean streamFromMemtable()
public SSTableMultiWriter createSSTableMultiWriter(Descriptor descriptor, long keyCount, long repairedAt, TimeUUID pendingRepair, boolean isTransient, int sstableLevel, SerializationHeader header, LifecycleNewTracker lifecycleNewTracker)
public SSTableMultiWriter createSSTableMultiWriter(Descriptor descriptor, long keyCount, long repairedAt, TimeUUID pendingRepair, boolean isTransient, MetadataCollector metadataCollector, SerializationHeader header, LifecycleNewTracker lifecycleNewTracker)
public boolean supportsEarlyOpen()
public void invalidate()
public void invalidate(boolean expectMBean)
public void invalidate(boolean expectMBean, boolean dropData)
public static ColumnFamilyStore createColumnFamilyStore(Keyspace keyspace, TableMetadataRef metadata, boolean loadSSTables)
public static ColumnFamilyStore createColumnFamilyStore(Keyspace keyspace, java.lang.String columnFamily, TableMetadataRef metadata, boolean loadSSTables)
public static ColumnFamilyStore createColumnFamilyStore(Keyspace keyspace, java.lang.String columnFamily, TableMetadataRef metadata, Directories directories, boolean loadSSTables, boolean registerBookkeeping, boolean offline)
public static void scrubDataDirectories(TableMetadata metadata) throws StartupException
StartupException
public static void loadNewSSTables(java.lang.String ksName, java.lang.String cfName)
StorageService.importNewSSTables
for more infoksName
- The keyspace namecfName
- The columnFamily name@Deprecated public void loadNewSSTables()
loadNewSSTables
in interface ColumnFamilyStoreMBean
public java.util.List<java.lang.String> importNewSSTables(java.util.Set<java.lang.String> srcPaths, boolean resetLevel, boolean clearRepaired, boolean verifySSTables, boolean verifyTokens, boolean invalidateCaches, boolean extendedVerify, boolean copyData)
importNewSSTables
in interface ColumnFamilyStoreMBean
srcPaths
- the path to the new sstables - if it is an empty set, the data directories will be scannedresetLevel
- if the level should be reset to 0 on the new sstablesclearRepaired
- if repaired info should be wiped from the new sstablesverifySSTables
- if the new sstables should be verified that they are not corruptverifyTokens
- if the tokens in the new sstables should be verified that they are owned by the current nodeinvalidateCaches
- if row cache should be invalidated for the keys in the new sstablesextendedVerify
- if we should run an extended verify checking all values in the new sstablescopyData
- if we should copy data from source paths instead of moving thempublic java.util.List<java.lang.String> importNewSSTables(java.util.Set<java.lang.String> srcPaths, boolean resetLevel, boolean clearRepaired, boolean verifySSTables, boolean verifyTokens, boolean invalidateCaches, boolean extendedVerify)
ColumnFamilyStoreMBean
importNewSSTables
in interface ColumnFamilyStoreMBean
srcPaths
- the path to the new sstables - if it is an empty set, the data directories will be scannedresetLevel
- if the level should be reset to 0 on the new sstablesclearRepaired
- if repaired info should be wiped from the new sstablesverifySSTables
- if the new sstables should be verified that they are not corruptverifyTokens
- if the tokens in the new sstables should be verified that they are owned by the current nodeinvalidateCaches
- if row cache should be invalidated for the keys in the new sstablesextendedVerify
- if we should run an extended verify checking all values in the new sstablespublic void rebuildSecondaryIndex(java.lang.String idxName)
public static void rebuildSecondaryIndex(java.lang.String ksName, java.lang.String cfName, java.lang.String... idxNames)
public AbstractCompactionStrategy createCompactionStrategyInstance(CompactionParams compactionParams)
@Deprecated public java.lang.String getColumnFamilyName()
getColumnFamilyName
in interface ColumnFamilyStoreMBean
public java.lang.String getTableName()
getTableName
in interface ColumnFamilyStoreMBean
public Descriptor newSSTableDescriptor(File directory)
public Descriptor newSSTableDescriptor(File directory, SSTableFormat.Type format)
public Descriptor newSSTableDescriptor(File directory, Version version, SSTableFormat.Type format)
public Future<CommitLogPosition> switchMemtableIfCurrent(Memtable memtable, ColumnFamilyStore.FlushReason reason)
memtable
- public Future<CommitLogPosition> switchMemtable(ColumnFamilyStore.FlushReason reason)
public Future<CommitLogPosition> forceFlush(ColumnFamilyStore.FlushReason reason)
public Future<?> forceFlush(CommitLogPosition flushIfDirtyBefore)
public CommitLogPosition forceBlockingFlush(ColumnFamilyStore.FlushReason reason)
public Memtable createMemtable(java.util.concurrent.atomic.AtomicReference<CommitLogPosition> commitLogUpperBound)
public Future<CommitLogPosition> signalFlushRequired(Memtable memtable, ColumnFamilyStore.FlushReason reason)
Memtable.Owner
signalFlushRequired
in interface Memtable.Owner
public Memtable getCurrentMemtable()
Memtable.Owner
getCurrentMemtable
in interface Memtable.Owner
public static java.lang.Iterable<Memtable> activeMemtables()
public java.lang.Iterable<Memtable> getIndexMemtables()
Memtable.Owner
getIndexMemtables
in interface Memtable.Owner
public void apply(PartitionUpdate update, UpdateTransaction indexer, OpOrder.Group opGroup, CommitLogPosition commitLogPosition)
public ShardBoundaries localRangeSplits(int shardCount)
Memtable.Owner
Memtable.shouldSwitch(org.apache.cassandra.db.ColumnFamilyStore.FlushReason)
(OWNED_RANGES_CHANGE) and, should that return false, a
Memtable.localRangesUpdated()
call.localRangeSplits
in interface Memtable.Owner
public java.util.Collection<SSTableReader> getOverlappingLiveSSTables(java.lang.Iterable<SSTableReader> sstables)
sstables
- public Refs<SSTableReader> getAndReferenceOverlappingLiveSSTables(java.lang.Iterable<SSTableReader> sstables)
public void addSSTable(SSTableReader sstable)
public void addSSTables(java.util.Collection<SSTableReader> sstables)
public long getExpectedCompactedFileSize(java.lang.Iterable<SSTableReader> sstables, OperationType operation)
CLEANUP
and we're not dealing with an index sstable,
then we calculate expected file size with checking token range to be eliminated.
Otherwise, we just add up all the files' size, which is the worst case file
size for compaction of all the list of files given.sstables
- SSTables to calculate expected compacted file sizeoperation
- Operation typepublic SSTableReader getMaxSizeFile(java.lang.Iterable<SSTableReader> sstables)
public CompactionManager.AllSSTableOpStatus forceCleanup(int jobs) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
public CompactionManager.AllSSTableOpStatus scrub(boolean disableSnapshot, boolean skipCorrupted, boolean checkData, boolean reinsertOverflowedTTL, int jobs) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
public CompactionManager.AllSSTableOpStatus scrub(boolean disableSnapshot, boolean skipCorrupted, boolean reinsertOverflowedTTL, boolean alwaysFail, boolean checkData, int jobs) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
public boolean rebuildOnFailedScrub(java.lang.Throwable failure)
public CompactionManager.AllSSTableOpStatus verify(Verifier.Options options) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
public CompactionManager.AllSSTableOpStatus sstablesRewrite(boolean skipIfCurrentVersion, long skipIfNewerThanTimestamp, boolean skipIfCompressionMatches, int jobs) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
skipIfCurrentVersion
- - if true
, will rewrite only SSTables that have version older than the current one (BigFormat#latestVersion
)skipIfNewerThanTimestamp
- - max timestamp (local creation time) for SSTable; SSTables created _after_ this timestamp will be excluded from compactionskipIfCompressionMatches
- - if true
, will rewrite only SSTables whose compression parameters are different from CFMetaData#compressionParams()
jobs
- number of jobs for parallel executionjava.util.concurrent.ExecutionException
java.lang.InterruptedException
public CompactionManager.AllSSTableOpStatus relocateSSTables(int jobs) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
public CompactionManager.AllSSTableOpStatus garbageCollect(CompactionParams.TombstoneOption tombstoneOption, int jobs) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
public void markObsolete(java.util.Collection<SSTableReader> sstables, OperationType compactionType)
public boolean isValid()
public Tracker getTracker()
public java.util.Set<SSTableReader> getLiveSSTables()
public java.lang.Iterable<SSTableReader> getSSTables(SSTableSet sstableSet)
public java.lang.Iterable<SSTableReader> getUncompactingSSTables()
public java.util.Map<TimeUUID,PendingStat> getPendingRepairStats()
public CleanupSummary releaseRepairData(java.util.Collection<TimeUUID> sessions, boolean force)
public boolean isFilterFullyCoveredBy(ClusteringIndexFilter filter, DataLimits limits, CachedPartition cached, int nowInSec, boolean enforceStrictLiveness)
public PaxosRepairHistory getPaxosRepairHistory()
public PaxosRepairHistory getPaxosRepairHistoryForRanges(java.util.Collection<Range<Token>> ranges)
public void syncPaxosRepairHistory(PaxosRepairHistory sync, boolean flush)
public void onPaxosRepairComplete(java.util.Collection<Range<Token>> ranges, Ballot highBallot)
public Ballot getPaxosRepairLowBound(DecoratedKey key)
public int gcBefore(int nowInSec)
public ColumnFamilyStore.RefViewFragment selectAndReference(com.google.common.base.Function<View,java.lang.Iterable<SSTableReader>> filter)
public ColumnFamilyStore.ViewFragment select(com.google.common.base.Function<View,java.lang.Iterable<SSTableReader>> filter)
public java.util.List<java.lang.String> getSSTablesForKey(java.lang.String key)
ColumnFamilyStoreMBean
getSSTablesForKey
in interface ColumnFamilyStoreMBean
public java.util.List<java.lang.String> getSSTablesForKey(java.lang.String key, boolean hexFormat)
ColumnFamilyStoreMBean
getSSTablesForKey
in interface ColumnFamilyStoreMBean
hexFormat
- if key is in hex string formatpublic void beginLocalSampling(java.lang.String sampler, int capacity, int durationMillis)
ColumnFamilyStoreMBean
beginLocalSampling
in interface ColumnFamilyStoreMBean
public java.util.List<javax.management.openmbean.CompositeData> finishLocalSampling(java.lang.String sampler, int count) throws javax.management.openmbean.OpenDataException
finishLocalSampling
in interface ColumnFamilyStoreMBean
javax.management.openmbean.OpenDataException
public boolean isCompactionDiskSpaceCheckEnabled()
isCompactionDiskSpaceCheckEnabled
in interface ColumnFamilyStoreMBean
public void compactionDiskSpaceCheck(boolean enable)
compactionDiskSpaceCheck
in interface ColumnFamilyStoreMBean
public void cleanupCache()
public ClusteringComparator getComparator()
public TableSnapshot snapshotWithoutMemtable(java.lang.String snapshotName)
public TableSnapshot snapshotWithoutMemtable(java.lang.String snapshotName, java.time.Instant creationTime)
public TableSnapshot snapshotWithoutMemtable(java.lang.String snapshotName, com.google.common.base.Predicate<SSTableReader> predicate, boolean ephemeral, DurationSpec.IntSecondsBound ttl, com.google.common.util.concurrent.RateLimiter rateLimiter, java.time.Instant creationTime)
ephemeral
- If this flag is set to true, the snapshot will be cleaned during next startupprotected TableSnapshot createSnapshot(java.lang.String tag, boolean ephemeral, DurationSpec.IntSecondsBound ttl, java.util.Set<SSTableReader> sstables, java.time.Instant creationTime)
protected static void clearEphemeralSnapshots(Directories directories)
public Refs<SSTableReader> getSnapshotSSTableReaders(java.lang.String tag) throws java.io.IOException
java.io.IOException
public TableSnapshot snapshot(java.lang.String snapshotName)
snapshotName
- the name of the associated with the snapshotpublic TableSnapshot snapshot(java.lang.String snapshotName, DurationSpec.IntSecondsBound ttl)
public TableSnapshot snapshot(java.lang.String snapshotName, boolean skipMemtable, DurationSpec.IntSecondsBound ttl, com.google.common.util.concurrent.RateLimiter rateLimiter, java.time.Instant creationTime)
snapshotName
- the name of the associated with the snapshotskipMemtable
- Skip flushing the memtablettl
- duration after which the taken snapshot is removed automatically, if supplied with null, it will never be automatically removedrateLimiter
- Rate limiter for hardlinks-per-secondcreationTime
- time when this snapshot was takenpublic TableSnapshot snapshot(java.lang.String snapshotName, com.google.common.base.Predicate<SSTableReader> predicate, boolean ephemeral, boolean skipMemtable)
ephemeral
- If this flag is set to true, the snapshot will be cleaned up during next startupskipMemtable
- Skip flushing the memtablepublic TableSnapshot snapshot(java.lang.String snapshotName, com.google.common.base.Predicate<SSTableReader> predicate, boolean ephemeral, boolean skipMemtable, DurationSpec.IntSecondsBound ttl, com.google.common.util.concurrent.RateLimiter rateLimiter, java.time.Instant creationTime)
ephemeral
- If this flag is set to true, the snapshot will be cleaned up during next startupskipMemtable
- Skip flushing the memtablettl
- duration after which the taken snapshot is removed automatically, if supplied with null, it will never be automatically removedrateLimiter
- Rate limiter for hardlinks-per-secondcreationTime
- time when this snapshot was takenpublic boolean snapshotExists(java.lang.String snapshotName)
public void clearSnapshot(java.lang.String snapshotName)
snapshotName
- the user supplied snapshot name. If left empty,
all the snapshots will be cleaned.public java.util.Map<java.lang.String,TableSnapshot> listSnapshots()
public CachedPartition getRawCachedPartition(DecoratedKey key)
public int invalidateRowCache(java.util.Collection<Bounds<Token>> boundsToInvalidate)
public int invalidateCounterCache(java.util.Collection<Bounds<Token>> boundsToInvalidate)
public boolean containsCachedParition(DecoratedKey key)
public void invalidateCachedPartition(RowCacheKey key)
public void invalidateCachedPartition(DecoratedKey key)
public ClockAndCount getCachedCounter(java.nio.ByteBuffer partitionKey, Clustering<?> clustering, ColumnMetadata column, CellPath path)
public void putCachedCounter(java.nio.ByteBuffer partitionKey, Clustering<?> clustering, ColumnMetadata column, CellPath path, ClockAndCount clockAndCount)
public void forceMajorCompaction()
public void forceMajorCompaction(boolean splitOutput)
ColumnFamilyStoreMBean
forceMajorCompaction
in interface ColumnFamilyStoreMBean
splitOutput
- true if the output of the major compaction should be split in several sstablespublic void forceCompactionForTokenRange(java.util.Collection<Range<Token>> tokenRanges) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
ColumnFamilyStoreMBean
The token ranges will be interpreted as closed intervals to match the closed interval defined by the first and
last keys of a sstable, even though the Range
class is suppossed to be half-open by definition.
forceCompactionForTokenRange
in interface ColumnFamilyStoreMBean
tokenRanges
- The token ranges to be compacted, interpreted as closed intervals.java.util.concurrent.ExecutionException
java.lang.InterruptedException
public void forceCompactionForTokenRanges(java.lang.String... strings)
ColumnFamilyStoreMBean
The token ranges will be interpreted as closed intervals to match the closed interval defined by the first and
last keys of a sstable, even though the Range
class is suppossed to be half-open by definition.
forceCompactionForTokenRanges
in interface ColumnFamilyStoreMBean
public void forceCompactionForKey(DecoratedKey key)
public static java.lang.Iterable<ColumnFamilyStore> all()
public java.lang.Iterable<DecoratedKey> keySamples(Range<Token> range)
public void writeAndAddMemtableRanges(TimeUUID repairSessionID, java.util.function.Supplier<java.util.Collection<Range<PartitionPosition>>> rangesSupplier, Refs<SSTableReader> placeIntoRefs)
public void clearUnsafe()
public void truncateBlocking()
public void truncateBlockingWithoutSnapshot()
public Future<CommitLogPosition> dumpMemtable()
public void unloadCf()
public <V> V runWithCompactionsDisabled(java.util.concurrent.Callable<V> callable, boolean interruptValidation, boolean interruptViews)
public <V> V runWithCompactionsDisabled(java.util.concurrent.Callable<V> callable, com.google.common.base.Predicate<SSTableReader> sstablesPredicate, boolean interruptValidation, boolean interruptViews, boolean interruptIndexes)
callable
- what to do when compactions are pausedsstablesPredicate
- which sstables should we cancel compactions forinterruptValidation
- if we should interrupt validation compactionsinterruptViews
- if we should interrupt view compactionsinterruptIndexes
- if we should interrupt compactions on indexes. NOTE: if you set this to true your sstablePredicate
must be able to handle LocalPartitioner sstables!public LifecycleTransaction markAllCompacting(OperationType operationType)
public java.lang.String toString()
toString
in class java.lang.Object
public void disableAutoCompaction()
public void enableAutoCompaction()
public void enableAutoCompaction(boolean waitForFutures)
waitForFutures
- if we should block until autocompaction is donepublic boolean isAutoCompactionDisabled()
isAutoCompactionDisabled
in interface ColumnFamilyStoreMBean
public CompactionStrategyManager getCompactionStrategyManager()
public void setCrcCheckChance(double crcCheckChance)
ColumnFamilyStoreMBean
setCrcCheckChance
in interface ColumnFamilyStoreMBean
public java.lang.Double getCrcCheckChance()
public void setCompactionThresholds(int minThreshold, int maxThreshold)
ColumnFamilyStoreMBean
setCompactionThresholds
in interface ColumnFamilyStoreMBean
public int getMinimumCompactionThreshold()
ColumnFamilyStoreMBean
getMinimumCompactionThreshold
in interface ColumnFamilyStoreMBean
public void setMinimumCompactionThreshold(int minCompactionThreshold)
ColumnFamilyStoreMBean
setMinimumCompactionThreshold
in interface ColumnFamilyStoreMBean
public int getMaximumCompactionThreshold()
ColumnFamilyStoreMBean
getMaximumCompactionThreshold
in interface ColumnFamilyStoreMBean
public void setMaximumCompactionThreshold(int maxCompactionThreshold)
ColumnFamilyStoreMBean
setMaximumCompactionThreshold
in interface ColumnFamilyStoreMBean
public int getMeanEstimatedCellPerPartitionCount()
public double getMeanPartitionSize()
public int getMeanRowCount()
public long estimateKeys()
estimateKeys
in interface ColumnFamilyStoreMBean
public IPartitioner getPartitioner()
public DecoratedKey decorateKey(java.nio.ByteBuffer key)
public boolean isIndex()
public java.lang.Iterable<ColumnFamilyStore> concatWithIndexes()
public java.util.List<java.lang.String> getBuiltIndexes()
ColumnFamilyStoreMBean
getBuiltIndexes
in interface ColumnFamilyStoreMBean
public int getUnleveledSSTables()
getUnleveledSSTables
in interface ColumnFamilyStoreMBean
public int[] getSSTableCountPerLevel()
getSSTableCountPerLevel
in interface ColumnFamilyStoreMBean
public long[] getPerLevelSizeBytes()
getPerLevelSizeBytes
in interface ColumnFamilyStoreMBean
public int getLevelFanoutSize()
getLevelFanoutSize
in interface ColumnFamilyStoreMBean
public boolean isEmpty()
public boolean isRowCacheEnabled()
public boolean isCounterCacheEnabled()
public boolean isKeyCacheEnabled()
public void discardSSTables(long truncatedAt)
truncatedAt
- The timestamp of the truncation
(all SSTables before that timestamp are going be marked as compacted)public double getDroppableTombstoneRatio()
ColumnFamilyStoreMBean
getDroppableTombstoneRatio
in interface ColumnFamilyStoreMBean
public long trueSnapshotsSize()
trueSnapshotsSize
in interface ColumnFamilyStoreMBean
public static ColumnFamilyStore getIfExists(TableId id)
public static ColumnFamilyStore getIfExists(java.lang.String ksName, java.lang.String cfName)
public static TableMetrics metricsFor(TableId tableId)
public DiskBoundaries getDiskBoundaries()
public void invalidateLocalRanges()
public void setNeverPurgeTombstones(boolean value)
setNeverPurgeTombstones
in interface ColumnFamilyStoreMBean
public boolean getNeverPurgeTombstones()
getNeverPurgeTombstones
in interface ColumnFamilyStoreMBean
public boolean hasMisplacedSSTables()
ColumnFamilyStoreMBean
hasMisplacedSSTables
in interface ColumnFamilyStoreMBean
public java.util.Map<java.lang.String,java.lang.Long> getTopSizePartitions()
getTopSizePartitions
in interface ColumnFamilyStoreMBean
public java.lang.Long getTopSizePartitionsLastUpdate()
getTopSizePartitionsLastUpdate
in interface ColumnFamilyStoreMBean
public java.util.Map<java.lang.String,java.lang.Long> getTopTombstonePartitions()
getTopTombstonePartitions
in interface ColumnFamilyStoreMBean
public java.lang.Long getTopTombstonePartitionsLastUpdate()
getTopTombstonePartitionsLastUpdate
in interface ColumnFamilyStoreMBean
Copyright © 2009-2022 The Apache Software Foundation