Class IndexSummaryManager<T extends SSTableReader & IndexSummarySupport<T>>
java.lang.Object
org.apache.cassandra.io.sstable.indexsummary.IndexSummaryManager<T>
- All Implemented Interfaces:
IndexSummaryManagerMBean
public class IndexSummaryManager<T extends SSTableReader & IndexSummarySupport<T>>
extends 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 -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns a map of SSTable filenames to their current effective index interval.longdoubleReturns the actual space consumed by index summaries for all sstables.intvoidstatic <T extends SSTableReader & IndexSummarySupport>
List<T>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, TimeUnit unit)
-
Field Details
-
MBEAN_NAME
- See Also:
-
instance
-
-
Method Details
-
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
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
- Specified by:
redistributeSummariesin interfaceIndexSummaryManagerMBean- Throws:
IOException
-
redistributeSummaries
public static <T extends SSTableReader & IndexSummarySupport> List<T> redistributeSummaries(IndexSummaryRedistribution redistribution) throws 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:
IOException
-
shutdownAndWait
public void shutdownAndWait(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException - Throws:
InterruptedExceptionTimeoutException
-