public class PartitionedOutputBuffer extends Object implements OutputBuffer
Constructor and Description |
---|
PartitionedOutputBuffer(String taskInstanceId,
StateMachine<BufferState> state,
OutputBuffers outputBuffers,
io.airlift.units.DataSize maxBufferSize,
Supplier<LocalMemoryContext> systemMemoryContextSupplier,
Executor notificationExecutor) |
Modifier and Type | Method and Description |
---|---|
void |
abort(OutputBuffers.OutputBufferId bufferId)
Closes the specified output buffer.
|
void |
acknowledge(OutputBuffers.OutputBufferId outputBufferId,
long sequenceId)
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 partitionNumber,
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 outputBufferId,
long startingSequenceId,
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 PartitionedOutputBuffer(String taskInstanceId, StateMachine<BufferState> state, OutputBuffers outputBuffers, io.airlift.units.DataSize maxBufferSize, Supplier<LocalMemoryContext> systemMemoryContextSupplier, Executor notificationExecutor)
public void addStateChangeListener(StateMachine.StateChangeListener<BufferState> stateChangeListener)
OutputBuffer
this
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 OutputBuffer
public boolean isFinished()
OutputBuffer
isFinished
in interface OutputBuffer
public double getUtilization()
OutputBuffer
getUtilization
in interface OutputBuffer
public boolean isOverutilized()
OutputBuffer
isOverutilized
in interface OutputBuffer
public OutputBufferInfo getInfo()
OutputBuffer
getInfo
in interface OutputBuffer
public void setOutputBuffers(OutputBuffers newOutputBuffers)
OutputBuffer
setOutputBuffers
in interface OutputBuffer
public com.google.common.util.concurrent.ListenableFuture<?> isFull()
OutputBuffer
isFull
in interface OutputBuffer
public void enqueue(List<SerializedPage> pages)
OutputBuffer
enqueue
in interface OutputBuffer
public void enqueue(int partitionNumber, List<SerializedPage> pages)
OutputBuffer
enqueue
in interface OutputBuffer
public com.google.common.util.concurrent.ListenableFuture<BufferResult> get(OutputBuffers.OutputBufferId outputBufferId, long startingSequenceId, io.airlift.units.DataSize maxSize)
OutputBuffer
get
in interface OutputBuffer
public void acknowledge(OutputBuffers.OutputBufferId outputBufferId, long sequenceId)
OutputBuffer
acknowledge
in interface OutputBuffer
public void abort(OutputBuffers.OutputBufferId bufferId)
OutputBuffer
abort
in interface OutputBuffer
public void setNoMorePages()
OutputBuffer
setNoMorePages
in interface OutputBuffer
public void destroy()
OutputBuffer
destroy
in interface OutputBuffer
public void fail()
OutputBuffer
fail
in interface OutputBuffer
public long getPeakMemoryUsage()
getPeakMemoryUsage
in interface OutputBuffer
Copyright © 2012–2019. All rights reserved.