public class HsSubpartitionConsumer extends Object implements ResultSubpartitionView, HsSubpartitionConsumerInternalOperations
ResultSubpartitionView.AvailabilityWithBacklog| 构造器和说明 |
|---|
HsSubpartitionConsumer(BufferAvailabilityListener availabilityListener) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
acknowledgeAllDataProcessed() |
ResultSubpartitionView.AvailabilityWithBacklog |
getAvailabilityAndBacklog(int numCreditsAvailable) |
int |
getConsumingOffset(boolean withLock)
Get the latest consuming offset of the subpartition.
|
Throwable |
getFailureCause()
ResultSubpartitionView can decide whether the failure cause should be reported to
consumer as failure (primary failure) or ProducerFailedException (secondary failure). |
ResultSubpartition.BufferAndBacklog |
getNextBuffer()
Returns the next
Buffer instance of this queue iterator. |
int |
getNumberOfQueuedBuffers() |
boolean |
isReleased() |
void |
notifyDataAvailable()
Callback for new data become available.
|
void |
notifyNewBufferSize(int newBufferSize) |
void |
releaseAllResources() |
void |
resumeConsumption() |
int |
unsynchronizedGetNumberOfQueuedBuffers() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitnotifyPriorityEventpublic HsSubpartitionConsumer(BufferAvailabilityListener availabilityListener)
@Nullable public ResultSubpartition.BufferAndBacklog getNextBuffer()
ResultSubpartitionViewBuffer 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 在接口中 ResultSubpartitionViewpublic void notifyDataAvailable()
HsSubpartitionConsumerInternalOperationspublic ResultSubpartitionView.AvailabilityWithBacklog getAvailabilityAndBacklog(int numCreditsAvailable)
public void releaseAllResources()
throws IOException
releaseAllResources 在接口中 ResultSubpartitionViewIOExceptionpublic boolean isReleased()
isReleased 在接口中 ResultSubpartitionViewpublic int getConsumingOffset(boolean withLock)
HsSubpartitionConsumerInternalOperationsgetConsumingOffset 在接口中 HsSubpartitionConsumerInternalOperationswithLock - If true, read the consuming offset outside the guarding of lock. This is
sometimes desired to avoid lock contention, if the caller does not depend on any other
states to change atomically with the consuming offset.public Throwable getFailureCause()
ResultSubpartitionViewResultSubpartitionView can decide whether the failure cause should be reported to
consumer as failure (primary failure) or ProducerFailedException (secondary failure).
Secondary failure can be reported only if producer (upstream task) is guaranteed to failover.
BEWARE: Incorrectly reporting failure cause as primary failure, can hide the root cause of the failure from the user.
getFailureCause 在接口中 ResultSubpartitionViewpublic void resumeConsumption()
resumeConsumption 在接口中 ResultSubpartitionViewpublic void acknowledgeAllDataProcessed()
public int unsynchronizedGetNumberOfQueuedBuffers()
public int getNumberOfQueuedBuffers()
public void notifyNewBufferSize(int newBufferSize)
notifyNewBufferSize 在接口中 ResultSubpartitionViewCopyright © 2014–2023 The Apache Software Foundation. All rights reserved.