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 IndexSummaryManager
instance
static java.lang.String
MBEAN_NAME
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getAverageIndexInterval()
java.util.Map<java.lang.String,java.lang.Integer>
getIndexIntervals()
Returns a map of SSTable filenames to their current effective index interval.long
getMemoryPoolCapacityInMB()
double
getMemoryPoolSizeInMB()
Returns the actual space consumed by index summaries for all sstables.int
getResizeIntervalInMinutes()
void
redistributeSummaries()
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.void
setMemoryPoolCapacityInMB(long memoryPoolCapacityInMB)
void
setResizeIntervalInMinutes(int resizeIntervalInMinutes)
void
shutdownAndWait(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:
getResizeIntervalInMinutes
in interfaceIndexSummaryManagerMBean
-
setResizeIntervalInMinutes
public void setResizeIntervalInMinutes(int resizeIntervalInMinutes)
- Specified by:
setResizeIntervalInMinutes
in interfaceIndexSummaryManagerMBean
-
getMemoryPoolCapacityInMB
public long getMemoryPoolCapacityInMB()
- Specified by:
getMemoryPoolCapacityInMB
in interfaceIndexSummaryManagerMBean
-
getIndexIntervals
public java.util.Map<java.lang.String,java.lang.Integer> getIndexIntervals()
Description copied from interface:IndexSummaryManagerMBean
Returns a map of SSTable filenames to their current effective index interval.- Specified by:
getIndexIntervals
in interfaceIndexSummaryManagerMBean
-
getAverageIndexInterval
public double getAverageIndexInterval()
- Specified by:
getAverageIndexInterval
in interfaceIndexSummaryManagerMBean
-
setMemoryPoolCapacityInMB
public void setMemoryPoolCapacityInMB(long memoryPoolCapacityInMB)
- Specified by:
setMemoryPoolCapacityInMB
in interfaceIndexSummaryManagerMBean
-
getMemoryPoolSizeInMB
public double getMemoryPoolSizeInMB()
Returns the actual space consumed by index summaries for all sstables.- Specified by:
getMemoryPoolSizeInMB
in interfaceIndexSummaryManagerMBean
- Returns:
- space currently used in MB
-
redistributeSummaries
public void redistributeSummaries() throws java.io.IOException
- Specified by:
redistributeSummaries
in 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.InterruptedException
java.util.concurrent.TimeoutException
-
-