public class SortMergeSubpartitionReader extends Object implements ResultSubpartitionView, BufferRecycler
SortMergeResultPartition
.BufferRecycler.DummyBufferRecycler
Constructor and Description |
---|
SortMergeSubpartitionReader(int subpartitionIndex,
int dataBufferBacklog,
int bufferSize,
SortMergeResultPartition partition,
BufferAvailabilityListener listener,
PartitionedFile partitionedFile) |
Modifier and Type | Method and Description |
---|---|
Throwable |
getFailureCause() |
ResultSubpartition.BufferAndBacklog |
getNextBuffer()
Returns the next
Buffer instance of this queue iterator. |
boolean |
isAvailable(int numCreditsAvailable) |
boolean |
isReleased() |
void |
notifyDataAvailable() |
void |
recycle(MemorySegment segment)
Recycles the
MemorySegment to its original BufferPool instance. |
void |
releaseAllResources() |
void |
resumeConsumption() |
int |
unsynchronizedGetNumberOfQueuedBuffers() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
notifyPriorityEvent
public SortMergeSubpartitionReader(int subpartitionIndex, int dataBufferBacklog, int bufferSize, SortMergeResultPartition partition, BufferAvailabilityListener listener, PartitionedFile partitionedFile) throws IOException
IOException
@Nullable public ResultSubpartition.BufferAndBacklog getNextBuffer()
ResultSubpartitionView
Buffer
instance of this queue iterator.
If there is currently no instance available, it will return null
. This might
happen for example when a pipelined queue producer is slower than the consumer or a spilled
queue needs to read in more data.
Important: The consumer has to make sure that each buffer instance will
eventually be recycled with Buffer.recycleBuffer()
after it has been consumed.
getNextBuffer
in interface ResultSubpartitionView
public void notifyDataAvailable()
notifyDataAvailable
in interface ResultSubpartitionView
public void recycle(MemorySegment segment)
BufferRecycler
MemorySegment
to its original BufferPool
instance.recycle
in interface BufferRecycler
segment
- The memory segment to be recycled.public void releaseAllResources()
releaseAllResources
in interface ResultSubpartitionView
public boolean isReleased()
isReleased
in interface ResultSubpartitionView
public void resumeConsumption()
resumeConsumption
in interface ResultSubpartitionView
public Throwable getFailureCause()
getFailureCause
in interface ResultSubpartitionView
public boolean isAvailable(int numCreditsAvailable)
isAvailable
in interface ResultSubpartitionView
public int unsynchronizedGetNumberOfQueuedBuffers()
unsynchronizedGetNumberOfQueuedBuffers
in interface ResultSubpartitionView
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.