## org.apache.cassandra.db
Class CompactionManager

    java.lang.Object
      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()`
`static int` `getDefaultGCBefore()`
`int` `getMaximumCompactionThreshold()` Gets the maximum number of sstables in queue before compaction kicks off
`int` `getMinimumCompactionThreshold()` Gets the minimum number of sstables in queue before compaction kicks off
`int` `getPendingTasks()`
`void` `setMaximumCompactionThreshold(int threshold)` Sets the maximum number of sstables in queue before compaction kicks off
`void` `setMinimumCompactionThreshold(int threshold)` Sets the minimum number of sstables in queue before compaction kicks off
`java.util.concurrent.Future<java.util.List<SSTableReader>>` `submitAnticompaction(ColumnFamilyStore cfStore, java.util.Collection<Range> ranges, java.net.InetAddress target)`
`java.util.concurrent.Future<java.lang.Object>` `submitCleanup(ColumnFamilyStore cfStore)`
`java.util.concurrent.Future` `submitMajor(ColumnFamilyStore cfStore)`
`java.util.concurrent.Future` `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` `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

### 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.

### submitCleanup

    public java.util.concurrent.Future<java.lang.Object> submitCleanup(ColumnFamilyStore cfStore)

### submitAnticompaction

    public java.util.concurrent.Future<java.util.List<SSTableReader>> submitAnticompaction(ColumnFamilyStore cfStore,
                                                                                           java.util.Collection<Range> ranges,
                                                                                           java.net.InetAddress target)

### submitMajor

    public java.util.concurrent.Future submitMajor(ColumnFamilyStore cfStore)

### submitMajor

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

### submitValidation

    public java.util.concurrent.Future submitValidation(ColumnFamilyStore cfStore,
                                                        AntiEntropyService.Validator validator)

### getMinimumCompactionThreshold

    public int getMinimumCompactionThreshold()

  Gets the minimum number of sstables in queue before compaction kicks off

  Specified by:
    `getMinimumCompactionThreshold` in interface `CompactionManagerMBean`

### setMinimumCompactionThreshold

    public void setMinimumCompactionThreshold(int threshold)

  Sets the minimum number of sstables in queue before compaction kicks off

  Specified by:
    `setMinimumCompactionThreshold` in interface `CompactionManagerMBean`

### getMaximumCompactionThreshold

    public int getMaximumCompactionThreshold()

  Gets the maximum number of sstables in queue before compaction kicks off

  Specified by:
    `getMaximumCompactionThreshold` in interface `CompactionManagerMBean`

### setMaximumCompactionThreshold

    public void setMaximumCompactionThreshold(int threshold)

  Sets the maximum number of sstables in queue before compaction kicks off

  Specified by:
    `setMaximumCompactionThreshold` in interface `CompactionManagerMBean`

### disableAutoCompaction

    public void disableAutoCompaction()

### getDefaultGCBefore

    public static int getDefaultGCBefore()

### 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

### getPendingTasks

    public int getPendingTasks()

  Specified by:
    `getPendingTasks` in interface `CompactionManagerMBean`
  Returns:
    estimated number of compactions remaining to perform

Copyright © 2010 The Apache Software Foundation