| Modifier and Type | Field and Description |
|---|---|
(package private) BlockingQueue<ByteBuffer> |
bufferPool |
(package private) double |
lastRateSampleMBps |
private Calendar |
lastRateSampleTime |
private long |
lastTotalBytesExtracted |
private static org.slf4j.Logger |
LOGGER |
(package private) double |
maxRateMBps |
private static double |
ONE_MB |
(package private) double |
overallMBps |
private Calendar |
startTime |
private long |
totalBytesExtracted |
| Constructor and Description |
|---|
BufferPool(int bufferCount,
int bufferCapacity,
boolean allocateDirect,
double maxRateMBps) |
| Modifier and Type | Method and Description |
|---|---|
private void |
computeRate() |
static List<ByteBuffer> |
createBuffers(int bufferCount,
int bufferCapacity,
boolean allocateDirect) |
private void |
logChannelReadRates() |
ByteBuffer |
poll() |
boolean |
returnBuffer(ByteBuffer buffer,
int bytesProcessed)
Returns the given buffer to the pool - and clears it.
|
void |
run() |
int |
size() |
private static final org.slf4j.Logger LOGGER
final BlockingQueue<ByteBuffer> bufferPool
private static final double ONE_MB
private Calendar lastRateSampleTime
private final Calendar startTime
double lastRateSampleMBps
double overallMBps
private long totalBytesExtracted
private long lastTotalBytesExtracted
final double maxRateMBps
public BufferPool(int bufferCount,
int bufferCapacity,
boolean allocateDirect,
double maxRateMBps)
public boolean returnBuffer(ByteBuffer buffer, int bytesProcessed)
buffer - buffer to returnbytesProcessed - bytes processed for this buffer being returnedpublic ByteBuffer poll()
public int size()
private void computeRate()
public static List<ByteBuffer> createBuffers(int bufferCount, int bufferCapacity, boolean allocateDirect)
private void logChannelReadRates()
Copyright © 2023 Apache NiFi Project. All rights reserved.