Package org.apache.cassandra.io.sstable
Class IndexSummaryManager
- java.lang.Object
-
- org.apache.cassandra.io.sstable.IndexSummaryManager
-
- All Implemented Interfaces:
IndexSummaryManagerMBean
public class IndexSummaryManager extends java.lang.Object implements IndexSummaryManagerMBean
Manages the fixed-size memory pool for index summaries, periodically resizing them in order to give more memory to hot sstables and less memory to cold sstables.
-
-
Field Summary
Fields Modifier and Type Field Description static IndexSummaryManagerinstancestatic java.lang.StringMBEAN_NAME
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetAverageIndexInterval()java.util.Map<java.lang.String,java.lang.Integer>getIndexIntervals()Returns a map of SSTable filenames to their current effective index interval.longgetMemoryPoolCapacityInMB()doublegetMemoryPoolSizeInMB()Returns the actual space consumed by index summaries for all sstables.intgetResizeIntervalInMinutes()voidredistributeSummaries()static java.util.List<SSTableReader>redistributeSummaries(IndexSummaryRedistribution redistribution)Attempts to fairly distribute a fixed pool of memory for index summaries across a set of SSTables based on their recent read rates.voidsetMemoryPoolCapacityInMB(long memoryPoolCapacityInMB)voidsetResizeIntervalInMinutes(int resizeIntervalInMinutes)Set resizeIntervalInMinutes = -1 for disabled; This is the equivalent of index_summary_resize_interval being set to null in cassandra.yamlvoidshutdownAndWait(long timeout, java.util.concurrent.TimeUnit unit)
-
-
-
Field Detail
-
MBEAN_NAME
public static final java.lang.String MBEAN_NAME
- See Also:
- Constant Field Values
-
instance
public static final IndexSummaryManager instance
-
-
Method Detail
-
getResizeIntervalInMinutes
public int getResizeIntervalInMinutes()
- Specified by:
getResizeIntervalInMinutesin interfaceIndexSummaryManagerMBean
-
setResizeIntervalInMinutes
public void setResizeIntervalInMinutes(int resizeIntervalInMinutes)
Description copied from interface:IndexSummaryManagerMBeanSet resizeIntervalInMinutes = -1 for disabled; This is the equivalent of index_summary_resize_interval being set to null in cassandra.yaml- Specified by:
setResizeIntervalInMinutesin interfaceIndexSummaryManagerMBean
-
getMemoryPoolCapacityInMB
public long getMemoryPoolCapacityInMB()
- Specified by:
getMemoryPoolCapacityInMBin interfaceIndexSummaryManagerMBean
-
getIndexIntervals
public java.util.Map<java.lang.String,java.lang.Integer> getIndexIntervals()
Description copied from interface:IndexSummaryManagerMBeanReturns a map of SSTable filenames to their current effective index interval.- Specified by:
getIndexIntervalsin interfaceIndexSummaryManagerMBean
-
getAverageIndexInterval
public double getAverageIndexInterval()
- Specified by:
getAverageIndexIntervalin interfaceIndexSummaryManagerMBean
-
setMemoryPoolCapacityInMB
public void setMemoryPoolCapacityInMB(long memoryPoolCapacityInMB)
- Specified by:
setMemoryPoolCapacityInMBin interfaceIndexSummaryManagerMBean
-
getMemoryPoolSizeInMB
public double getMemoryPoolSizeInMB()
Returns the actual space consumed by index summaries for all sstables.- Specified by:
getMemoryPoolSizeInMBin interfaceIndexSummaryManagerMBean- Returns:
- space currently used in MB
-
redistributeSummaries
public void redistributeSummaries() throws java.io.IOException- Specified by:
redistributeSummariesin interfaceIndexSummaryManagerMBean- Throws:
java.io.IOException
-
redistributeSummaries
public static java.util.List<SSTableReader> redistributeSummaries(IndexSummaryRedistribution redistribution) throws java.io.IOException
Attempts to fairly distribute a fixed pool of memory for index summaries across a set of SSTables based on their recent read rates.- Parameters:
redistribution- encapsulating the transactions containing the sstables we are to redistribute the memory pool across and a size (in bytes) that the total index summary space usage should stay close to or under, if possible- Returns:
- a list of new SSTableReader instances
- Throws:
java.io.IOException
-
shutdownAndWait
public void shutdownAndWait(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException- Throws:
java.lang.InterruptedExceptionjava.util.concurrent.TimeoutException
-
-