public class LazyOutputBuffer extends Object implements OutputBuffer
| Constructor and Description |
|---|
LazyOutputBuffer(TaskId taskId,
String taskInstanceId,
Executor executor,
io.airlift.units.DataSize maxBufferSize,
Supplier<LocalMemoryContext> systemMemoryContextSupplier) |
| Modifier and Type | Method and Description |
|---|---|
void |
abort(OutputBuffers.OutputBufferId bufferId)
Closes the specified output buffer.
|
void |
acknowledge(OutputBuffers.OutputBufferId bufferId,
long token)
Acknowledges the previously received pages from the output buffer.
|
void |
addStateChangeListener(StateMachine.StateChangeListener<BufferState> stateChangeListener)
Add a listener which fires anytime the buffer state changes.
|
void |
destroy()
Destroys the buffer, discarding all pages.
|
void |
enqueue(int partition,
List<SerializedPage> pages)
Adds a split-up page to a specific partition.
|
void |
enqueue(List<SerializedPage> pages)
Adds a split-up page to an unpartitioned buffer.
|
void |
fail()
Fail the buffer, discarding all pages, but blocking readers.
|
com.google.common.util.concurrent.ListenableFuture<BufferResult> |
get(OutputBuffers.OutputBufferId bufferId,
long token,
io.airlift.units.DataSize maxSize)
Gets pages from the output buffer, and acknowledges all pages received from the last
request.
|
OutputBufferInfo |
getInfo()
Gets the current state of this buffer.
|
long |
getPeakMemoryUsage() |
double |
getUtilization()
Get the memory utilization percentage.
|
boolean |
isFinished()
A buffer is finished once no-more-pages has been set and all buffers have been closed
with an abort call.
|
com.google.common.util.concurrent.ListenableFuture<?> |
isFull()
Get a future that will be completed when the buffer is not full.
|
boolean |
isOverutilized()
Check if the buffer is blocking producers.
|
void |
setNoMorePages()
Notify buffer that no more pages will be added.
|
void |
setOutputBuffers(OutputBuffers newOutputBuffers)
Updates the buffer configuration.
|
public LazyOutputBuffer(TaskId taskId, String taskInstanceId, Executor executor, io.airlift.units.DataSize maxBufferSize, Supplier<LocalMemoryContext> systemMemoryContextSupplier)
public void addStateChangeListener(StateMachine.StateChangeListener<BufferState> stateChangeListener)
OutputBufferthis when adding a listener in a constructor. Additionally, it is
possible notifications are observed out of order due to the asynchronous execution.addStateChangeListener in interface OutputBufferpublic boolean isFinished()
OutputBufferisFinished in interface OutputBufferpublic double getUtilization()
OutputBuffergetUtilization in interface OutputBufferpublic boolean isOverutilized()
OutputBufferisOverutilized in interface OutputBufferpublic OutputBufferInfo getInfo()
OutputBuffergetInfo in interface OutputBufferpublic void setOutputBuffers(OutputBuffers newOutputBuffers)
OutputBuffersetOutputBuffers in interface OutputBufferpublic com.google.common.util.concurrent.ListenableFuture<BufferResult> get(OutputBuffers.OutputBufferId bufferId, long token, io.airlift.units.DataSize maxSize)
OutputBufferget in interface OutputBufferpublic void acknowledge(OutputBuffers.OutputBufferId bufferId, long token)
OutputBufferacknowledge in interface OutputBufferpublic void abort(OutputBuffers.OutputBufferId bufferId)
OutputBufferabort in interface OutputBufferpublic com.google.common.util.concurrent.ListenableFuture<?> isFull()
OutputBufferisFull in interface OutputBufferpublic void enqueue(List<SerializedPage> pages)
OutputBufferenqueue in interface OutputBufferpublic void enqueue(int partition,
List<SerializedPage> pages)
OutputBufferenqueue in interface OutputBufferpublic void setNoMorePages()
OutputBuffersetNoMorePages in interface OutputBufferpublic void destroy()
OutputBufferdestroy in interface OutputBufferpublic void fail()
OutputBufferfail in interface OutputBufferpublic long getPeakMemoryUsage()
getPeakMemoryUsage in interface OutputBufferCopyright © 2012–2019. All rights reserved.