public class MemoryManagerImpl extends Object implements MemoryManager
MemoryManager.Callback| Constructor and Description |
|---|
MemoryManagerImpl(Configuration conf)
Create the memory manager.
|
MemoryManagerImpl(long poolSize)
Create the memory manager
|
| Modifier and Type | Method and Description |
|---|---|
void |
addedRow(int rows)
Give the memory manager an opportunity for doing a memory check.
|
void |
addWriter(Path path,
long requestedAllocation,
MemoryManager.Callback callback)
Add a new writer's memory allocation to the pool.
|
long |
checkMemory(long previous,
MemoryManager.Callback writer)
As part of adding rows, the writer calls this method to determine
if the scale factor has changed.
|
double |
getAllocationScale()
The scaling factor for each allocation to ensure that the pool isn't
oversubscribed.
|
long |
getTotalMemoryPool()
Get the total pool size that is available for ORC writers.
|
void |
notifyWriters()
Deprecated.
remove this method
|
void |
removeWriter(Path path)
Remove the given writer from the pool.
|
public MemoryManagerImpl(Configuration conf)
conf - use the configuration to find the maximum size of the memory
pool.public MemoryManagerImpl(long poolSize)
poolSize - the size of memory to usepublic void addWriter(Path path, long requestedAllocation, MemoryManager.Callback callback) throws IOException
addWriter in interface MemoryManagerpath - the file that is being writtenrequestedAllocation - the requested buffer sizeIOExceptionpublic void removeWriter(Path path) throws IOException
removeWriter in interface MemoryManagerpath - the file that has been closedIOExceptionpublic long getTotalMemoryPool()
public double getAllocationScale()
public void addedRow(int rows)
throws IOException
MemoryManageraddedRow in interface MemoryManagerrows - number of rows addedIOExceptionpublic void notifyWriters()
throws IOException
IOExceptionpublic long checkMemory(long previous,
MemoryManager.Callback writer)
throws IOException
MemoryManagercheckMemory in interface MemoryManagerprevious - the previous allocationwriter - the callback to call back into if we need toIOExceptionCopyright © 2013–2022 The Apache Software Foundation. All rights reserved.