Class RealtimeIndexOffHeapMemoryManager
- java.lang.Object
-
- org.apache.pinot.segment.local.io.readerwriter.RealtimeIndexOffHeapMemoryManager
-
- All Implemented Interfaces:
Closeable,AutoCloseable,PinotDataBufferMemoryManager
- Direct Known Subclasses:
DirectMemoryManager,MmapMemoryManager
public abstract class RealtimeIndexOffHeapMemoryManager extends Object implements PinotDataBufferMemoryManager
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRealtimeIndexOffHeapMemoryManager(ServerMetrics serverMetrics, String segmentName)
-
Method Summary
Modifier and Type Method Description PinotDataBufferallocate(long size, String allocationContext)Allocate memory for use by a column.protected abstract PinotDataBufferallocateInternal(long size, String columnName)voidclose()Close out this memory manager and release all memory and resources.protected abstract voiddoClose()Method to be implemented by inheriting concrete classeslonggetTotalAllocatedBytes()
-
-
-
Constructor Detail
-
RealtimeIndexOffHeapMemoryManager
protected RealtimeIndexOffHeapMemoryManager(ServerMetrics serverMetrics, String segmentName)
-
-
Method Detail
-
allocate
public PinotDataBuffer allocate(long size, String allocationContext)
Allocate memory for use by a column. Sub-classes may implement this method according using different allocation policies. This method can be called multiple times for each column within the segment. Each invocation is guaranteed to return a new block of memory.- Specified by:
allocatein interfacePinotDataBufferMemoryManager- Parameters:
size- size of memoryallocationContext- Name of the column for which memory is being allocated- Returns:
- PinotDataBuffer
-
doClose
protected abstract void doClose() throws IOExceptionMethod to be implemented by inheriting concrete classes- Throws:
IOException
-
allocateInternal
protected abstract PinotDataBuffer allocateInternal(long size, String columnName)
-
close
public void close() throws IOExceptionClose out this memory manager and release all memory and resources. This method must be called when all the memory allocated by this class is not longer in use. The application may choose to call (or not call) PinotDataBuffer.close(), but this.close() MUST be called to release all resources allocated.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getTotalAllocatedBytes
public long getTotalAllocatedBytes()
- Specified by:
getTotalAllocatedBytesin interfacePinotDataBufferMemoryManager
-
-