public class CompactionManager extends java.lang.Object implements CompactionManagerMBean
| Modifier and Type | Class and Description |
|---|---|
static interface |
CompactionManager.CompactionExecutorStatsCollector |
| Modifier and Type | Field and Description |
|---|---|
static int |
GC_ALL |
static CompactionManager |
instance |
static java.lang.ThreadLocal<java.lang.Boolean> |
isCompactionManager |
static java.lang.String |
MBEAN_OBJECT_NAME |
static int |
NO_GC |
| Constructor and Description |
|---|
CompactionManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
disableAutoCompaction() |
void |
forceUserDefinedCompaction(java.lang.String ksname,
java.lang.String dataFiles)
Triggers the compaction of user specified sstables.
|
int |
getActiveCompactions() |
java.util.concurrent.locks.Lock |
getCompactionLock() |
java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
getCompactions()
List of running compaction objects.
|
java.util.List<java.lang.String> |
getCompactionSummary()
List of running compaction summary strings.
|
long |
getCompletedTasks() |
int |
getCoreCompactorThreads()
Returns core size of compaction thread pool
|
int |
getCoreValidationThreads()
Returns core size of validation thread pool
|
int |
getMaximumCompactorThreads()
Returns maximum size of compaction thread pool
|
int |
getMaximumValidatorThreads()
Returns size of validator thread pool
|
int |
getPendingTasks() |
com.google.common.util.concurrent.RateLimiter |
getRateLimiter()
Gets compaction rate limiter.
|
long |
getTotalBytesCompacted() |
long |
getTotalCompactionsCompleted() |
static SSTableWriter |
maybeCreateWriter(ColumnFamilyStore cfs,
java.io.File compactionFileLocation,
int expectedBloomFilterSize,
SSTableWriter writer,
java.util.Collection<SSTableReader> sstables) |
void |
performCleanup(ColumnFamilyStore cfStore,
CounterId.OneShotRenewer renewer) |
void |
performMaximal(ColumnFamilyStore cfStore) |
void |
performScrub(ColumnFamilyStore cfStore) |
void |
performSSTableRewrite(ColumnFamilyStore cfStore,
boolean excludeCurrentVersion) |
void |
setCoreCompactorThreads(int number)
Allows user to resize maximum size of the compaction thread pool.
|
void |
setCoreValidationThreads(int number)
Allows user to resize maximum size of the compaction thread pool.
|
void |
setMaximumCompactorThreads(int number)
Allows user to resize maximum size of the compaction thread pool.
|
void |
setMaximumValidatorThreads(int number)
Allows user to resize maximum size of the validator thread pool.
|
void |
stopCompaction(java.lang.String type)
Stop all running compaction-like tasks having the provided
type. |
void |
stopCompactionFor(java.util.Collection<CFMetaData> columnFamilies)
Try to stop all of the compactions for given ColumnFamilies.
|
java.util.List<java.util.concurrent.Future<?>> |
submitBackground(ColumnFamilyStore cfs)
Call this whenever a compaction might be needed on the given columnfamily.
|
java.util.concurrent.Future<?> |
submitCacheWrite(AutoSavingCache.Writer writer) |
java.util.concurrent.Future<?> |
submitIndexBuild(SecondaryIndexBuilder builder)
Is not scheduled, because it is performing disjoint work from sstable compaction.
|
java.util.concurrent.Future<?> |
submitMaximal(ColumnFamilyStore cfStore,
int gcBefore) |
java.util.concurrent.Future<?> |
submitTruncate(ColumnFamilyStore main,
long truncatedAt) |
java.util.concurrent.Future<?> |
submitUserDefined(ColumnFamilyStore cfs,
java.util.Collection<Descriptor> dataFiles,
int gcBefore) |
java.util.concurrent.Future<java.lang.Object> |
submitValidation(ColumnFamilyStore cfStore,
AntiEntropyService.Validator validator)
Does not mutate data, so is not scheduled.
|
public static final java.lang.String MBEAN_OBJECT_NAME
public static final CompactionManager instance
public static final int NO_GC
public static final int GC_ALL
public static final java.lang.ThreadLocal<java.lang.Boolean> isCompactionManager
public com.google.common.util.concurrent.RateLimiter getRateLimiter()
public java.util.concurrent.locks.Lock getCompactionLock()
public java.util.List<java.util.concurrent.Future<?>> submitBackground(ColumnFamilyStore cfs)
public void performScrub(ColumnFamilyStore cfStore) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
java.lang.InterruptedExceptionjava.util.concurrent.ExecutionExceptionpublic void performSSTableRewrite(ColumnFamilyStore cfStore, boolean excludeCurrentVersion) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
java.lang.InterruptedExceptionjava.util.concurrent.ExecutionExceptionpublic void performCleanup(ColumnFamilyStore cfStore, CounterId.OneShotRenewer renewer) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
java.lang.InterruptedExceptionjava.util.concurrent.ExecutionExceptionpublic void performMaximal(ColumnFamilyStore cfStore) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
java.lang.InterruptedExceptionjava.util.concurrent.ExecutionExceptionpublic java.util.concurrent.Future<?> submitMaximal(ColumnFamilyStore cfStore, int gcBefore)
public void forceUserDefinedCompaction(java.lang.String ksname,
java.lang.String dataFiles)
CompactionManagerMBeanforceUserDefinedCompaction in interface CompactionManagerMBeanksname - the keyspace for the sstables to compactdataFiles - a comma separated list of sstable filename to compactpublic java.util.concurrent.Future<?> submitUserDefined(ColumnFamilyStore cfs, java.util.Collection<Descriptor> dataFiles, int gcBefore)
public java.util.concurrent.Future<java.lang.Object> submitValidation(ColumnFamilyStore cfStore, AntiEntropyService.Validator validator)
public void disableAutoCompaction()
public static SSTableWriter maybeCreateWriter(ColumnFamilyStore cfs, java.io.File compactionFileLocation, int expectedBloomFilterSize, SSTableWriter writer, java.util.Collection<SSTableReader> sstables)
public java.util.concurrent.Future<?> submitIndexBuild(SecondaryIndexBuilder builder)
public java.util.concurrent.Future<?> submitCacheWrite(AutoSavingCache.Writer writer)
public java.util.concurrent.Future<?> submitTruncate(ColumnFamilyStore main, long truncatedAt)
public int getActiveCompactions()
public java.util.List<java.util.Map<java.lang.String,java.lang.String>> getCompactions()
CompactionManagerMBeangetCompactions in interface CompactionManagerMBeanpublic java.util.List<java.lang.String> getCompactionSummary()
CompactionManagerMBeangetCompactionSummary in interface CompactionManagerMBeanpublic long getTotalBytesCompacted()
getTotalBytesCompacted in interface CompactionManagerMBeanCompactionMetrics.bytesCompactedpublic long getTotalCompactionsCompleted()
getTotalCompactionsCompleted in interface CompactionManagerMBeanCompactionMetrics.totalCompactionsCompletedpublic int getPendingTasks()
getPendingTasks in interface CompactionManagerMBeanCompactionMetrics.pendingTaskspublic long getCompletedTasks()
getCompletedTasks in interface CompactionManagerMBeanCompactionMetrics.completedTaskspublic void stopCompaction(java.lang.String type)
CompactionManagerMBeantype.stopCompaction in interface CompactionManagerMBeantype - the type of compaction to stop. Can be one of:
- COMPACTION
- VALIDATION
- CLEANUP
- SCRUB
- INDEX_BUILDpublic int getCoreCompactorThreads()
CompactionManagerMBeangetCoreCompactorThreads in interface CompactionManagerMBeanpublic void setCoreCompactorThreads(int number)
CompactionManagerMBeansetCoreCompactorThreads in interface CompactionManagerMBeannumber - New maximum of compaction threadspublic int getMaximumCompactorThreads()
CompactionManagerMBeangetMaximumCompactorThreads in interface CompactionManagerMBeanpublic void setMaximumCompactorThreads(int number)
CompactionManagerMBeansetMaximumCompactorThreads in interface CompactionManagerMBeannumber - New maximum of compaction threadspublic int getCoreValidationThreads()
CompactionManagerMBeangetCoreValidationThreads in interface CompactionManagerMBeanpublic void setCoreValidationThreads(int number)
CompactionManagerMBeansetCoreValidationThreads in interface CompactionManagerMBeannumber - New maximum of compaction threadspublic int getMaximumValidatorThreads()
CompactionManagerMBeangetMaximumValidatorThreads in interface CompactionManagerMBeanpublic void setMaximumValidatorThreads(int number)
CompactionManagerMBeansetMaximumValidatorThreads in interface CompactionManagerMBeannumber - New maximum of validator threadspublic void stopCompactionFor(java.util.Collection<CFMetaData> columnFamilies)
columnFamilies - The ColumnFamilies to try to stop compaction upon.Copyright © 2014 The Apache Software Foundation