public class BatchShuffleReadBufferPool extends Object
MemorySegment
pool used by batch shuffle for shuffle data read (currently
only used by sort-merge blocking shuffle).Modifier and Type | Field and Description |
---|---|
static int |
NUM_BYTES_PER_REQUEST
Memory size in bytes can be allocated from this buffer pool for a single request (4M is for
better sequential read).
|
Constructor and Description |
---|
BatchShuffleReadBufferPool(long totalBytes,
int bufferSize) |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Destroys this buffer pool and after which, no buffer can be allocated any more.
|
int |
getAvailableBuffers() |
int |
getAverageBuffersPerRequester() |
int |
getBufferSize() |
long |
getLastBufferOperationTimestamp() |
int |
getMaxConcurrentRequests() |
int |
getNumBuffersPerRequest() |
int |
getNumTotalBuffers() |
void |
initialize()
Initializes this buffer pool which allocates all the buffers.
|
boolean |
isDestroyed() |
void |
recycle(Collection<MemorySegment> segments)
Recycles a collection of buffers to this buffer pool.
|
void |
recycle(MemorySegment segment)
Recycles the target buffer to this buffer pool.
|
void |
registerRequester(Object requester) |
List<MemorySegment> |
requestBuffers()
Requests a collection of buffers (determined by
numBuffersPerRequest ) from this
buffer pool. |
void |
unregisterRequester(Object requester) |
public static final int NUM_BYTES_PER_REQUEST
public BatchShuffleReadBufferPool(long totalBytes, int bufferSize)
@VisibleForTesting public int getNumTotalBuffers()
@VisibleForTesting public int getAvailableBuffers()
public int getNumBuffersPerRequest()
public int getMaxConcurrentRequests()
public int getBufferSize()
public void initialize()
public void registerRequester(Object requester)
public void unregisterRequester(Object requester)
public int getAverageBuffersPerRequester()
public List<MemorySegment> requestBuffers() throws Exception
numBuffersPerRequest
) from this
buffer pool.Exception
public void recycle(MemorySegment segment)
public void recycle(Collection<MemorySegment> segments)
public long getLastBufferOperationTimestamp()
public void destroy()
public boolean isDestroyed()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.