org.apache.cassandra.db
Class CompactionManager

java.lang.Object
  extended by org.apache.cassandra.db.CompactionManager
All Implemented Interfaces:
CompactionManagerMBean

public class CompactionManager
extends java.lang.Object
implements CompactionManagerMBean


Field Summary
static CompactionManager instance
           
static java.lang.String MBEAN_OBJECT_NAME
           
 
Constructor Summary
CompactionManager()
           
 
Method Summary
 void checkAllColumnFamilies()
           
 void disableAutoCompaction()
           
 java.lang.Long getBytesCompacted()
           
 java.lang.Long getBytesTotalInProgress()
           
 java.lang.String getColumnFamilyInProgress()
           
 java.util.concurrent.locks.Lock getCompactionLock()
           
 java.lang.String getCompactionType()
           
 long getCompletedTasks()
           
 int getPendingTasks()
           
 void performCleanup(ColumnFamilyStore cfStore)
           
 void performMajor(ColumnFamilyStore cfStore)
           
 java.util.concurrent.Future submitIndexBuild(ColumnFamilyStore cfs, Table.IndexBuilder builder)
           
 java.util.concurrent.Future<java.lang.Object> submitMajor(ColumnFamilyStore cfStore, long skip, int gcBefore)
           
 java.util.concurrent.Future<java.lang.Integer> submitMinorIfNeeded(ColumnFamilyStore cfs)
          Call this whenever a compaction might be needed on the given columnfamily.
 java.util.concurrent.Future<SSTableReader> submitSSTableBuild(Descriptor desc)
           
 java.util.concurrent.Future<java.lang.Object> submitValidation(ColumnFamilyStore cfStore, AntiEntropyService.Validator validator)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MBEAN_OBJECT_NAME

public static final java.lang.String MBEAN_OBJECT_NAME
See Also:
Constant Field Values

instance

public static final CompactionManager instance
Constructor Detail

CompactionManager

public CompactionManager()
Method Detail

getCompactionLock

public java.util.concurrent.locks.Lock getCompactionLock()

submitMinorIfNeeded

public java.util.concurrent.Future<java.lang.Integer> submitMinorIfNeeded(ColumnFamilyStore cfs)
Call this whenever a compaction might be needed on the given columnfamily. It's okay to over-call (within reason) since the compactions are single-threaded, and if a call is unnecessary, it will just be no-oped in the bucketing phase.


performCleanup

public void performCleanup(ColumnFamilyStore cfStore)
                    throws java.lang.InterruptedException,
                           java.util.concurrent.ExecutionException
Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException

performMajor

public void performMajor(ColumnFamilyStore cfStore)
                  throws java.lang.InterruptedException,
                         java.util.concurrent.ExecutionException
Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException

submitMajor

public java.util.concurrent.Future<java.lang.Object> submitMajor(ColumnFamilyStore cfStore,
                                                                 long skip,
                                                                 int gcBefore)

submitValidation

public java.util.concurrent.Future<java.lang.Object> submitValidation(ColumnFamilyStore cfStore,
                                                                      AntiEntropyService.Validator validator)

disableAutoCompaction

public void disableAutoCompaction()

submitIndexBuild

public java.util.concurrent.Future submitIndexBuild(ColumnFamilyStore cfs,
                                                    Table.IndexBuilder builder)

submitSSTableBuild

public java.util.concurrent.Future<SSTableReader> submitSSTableBuild(Descriptor desc)

checkAllColumnFamilies

public void checkAllColumnFamilies()
                            throws java.io.IOException
Throws:
java.io.IOException

getColumnFamilyInProgress

public java.lang.String getColumnFamilyInProgress()
Specified by:
getColumnFamilyInProgress in interface CompactionManagerMBean
Returns:
the columnfamily currently being compacted; null if none

getBytesTotalInProgress

public java.lang.Long getBytesTotalInProgress()
Specified by:
getBytesTotalInProgress in interface CompactionManagerMBean
Returns:
the total (data, not including index and filter) bytes being compacted; null if none

getBytesCompacted

public java.lang.Long getBytesCompacted()
Specified by:
getBytesCompacted in interface CompactionManagerMBean
Returns:
the progress on the current compaction; null if none

getCompactionType

public java.lang.String getCompactionType()
Specified by:
getCompactionType in interface CompactionManagerMBean
Returns:
the type of compaction operation currently in progress; null if none

getPendingTasks

public int getPendingTasks()
Specified by:
getPendingTasks in interface CompactionManagerMBean
Returns:
estimated number of compactions remaining to perform

getCompletedTasks

public long getCompletedTasks()
Specified by:
getCompletedTasks in interface CompactionManagerMBean
Returns:
number of completed compactions since server [re]start


Copyright © 2010 The Apache Software Foundation