public class HsResultPartition extends ResultPartition
HsResultPartition appends records and events to HsMemoryDataManager, the shuffle
data maybe spilled to disk according to the HsSpillingStrategy, and the downstream can
consume data from memory or disk.AvailabilityProvider.AvailabilityHelper| 限定符和类型 | 字段和说明 |
|---|---|
static String |
DATA_FILE_SUFFIX |
bufferCompressor, bufferPool, LOG, numBuffersOut, numBytesOut, numBytesProduced, numSubpartitions, partitionId, partitionManager, partitionTypeAVAILABLE| 构造器和说明 |
|---|
HsResultPartition(String owningTaskName,
int partitionIndex,
ResultPartitionID partitionId,
ResultPartitionType partitionType,
int numSubpartitions,
int numTargetKeyGroups,
BatchShuffleReadBufferPool readBufferPool,
ScheduledExecutorService readIOExecutor,
ResultPartitionManager partitionManager,
String dataFileBashPath,
int networkBufferSize,
HybridShuffleConfiguration hybridShuffleConfiguration,
BufferCompressor bufferCompressor,
org.apache.flink.util.function.SupplierWithException<BufferPool,IOException> bufferPoolFactory) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
abortCheckpoint(long checkpointId,
CheckpointException cause)
Abort the checkpoint.
|
void |
alignedBarrierTimeout(long checkpointId)
Timeout the aligned barrier to unaligned barrier.
|
void |
broadcastEvent(AbstractEvent event,
boolean isPriorityEvent)
Writes the given
AbstractEvent to all channels. |
void |
broadcastRecord(ByteBuffer record)
Writes the given serialized record to all subpartitions.
|
void |
close()
Closes the partition writer which releases the allocated resource, for example the buffer
pool.
|
ResultSubpartitionView |
createSubpartitionView(int subpartitionId,
BufferAvailabilityListener availabilityListener)
Returns a reader for the subpartition with the given index.
|
void |
emitRecord(ByteBuffer record,
int targetSubpartition)
Writes the given serialized record to the target subpartition.
|
void |
finish()
Finishes the result partition.
|
void |
flush(int subpartitionIndex)
Manually trigger the consumption of data from the given subpartitions.
|
void |
flushAll()
Manually trigger the consumption of data from all subpartitions.
|
int |
getNumberOfQueuedBuffers()
Returns the total number of queued buffers of all subpartitions.
|
int |
getNumberOfQueuedBuffers(int targetSubpartition)
Returns the number of queued buffers of the given target subpartition.
|
long |
getSizeOfQueuedBuffersUnsafe()
Returns the total size in bytes of queued buffers of all subpartitions.
|
void |
notifyEndOfData(StopMode mode)
Notifies the downstream tasks that this
ResultPartitionWriter have emitted all the
user records. |
protected void |
releaseInternal()
Releases all produced data including both those stored in memory and persisted on disk.
|
void |
setMetricGroup(TaskIOMetricGroup metrics)
Sets the metric group for the
ResultPartitionWriter. |
protected void |
setupInternal()
Do the subclass's own setup operation.
|
canBeCompressed, checkInProduceState, fail, getAllDataProcessedFuture, getAvailableFuture, getBufferPool, getFailureCause, getNumberOfSubpartitions, getNumTargetKeyGroups, getOwningTaskName, getPartitionId, getPartitionIndex, getPartitionManager, getPartitionType, isFinished, isReleased, onSubpartitionAllDataProcessed, release, release, setMaxOverdraftBuffersPerGate, setup, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitand, isApproximatelyAvailable, isAvailable, orpublic HsResultPartition(String owningTaskName, int partitionIndex, ResultPartitionID partitionId, ResultPartitionType partitionType, int numSubpartitions, int numTargetKeyGroups, BatchShuffleReadBufferPool readBufferPool, ScheduledExecutorService readIOExecutor, ResultPartitionManager partitionManager, String dataFileBashPath, int networkBufferSize, HybridShuffleConfiguration hybridShuffleConfiguration, @Nullable BufferCompressor bufferCompressor, org.apache.flink.util.function.SupplierWithException<BufferPool,IOException> bufferPoolFactory)
protected void setupInternal()
throws IOException
ResultPartitionsetupInternal 在类中 ResultPartitionIOExceptionpublic void setMetricGroup(TaskIOMetricGroup metrics)
ResultPartitionWriterResultPartitionWriter.setMetricGroup 在接口中 ResultPartitionWritersetMetricGroup 在类中 ResultPartitionpublic void emitRecord(ByteBuffer record, int targetSubpartition) throws IOException
ResultPartitionWriterIOExceptionpublic void broadcastRecord(ByteBuffer record) throws IOException
ResultPartitionWriterIOExceptionpublic void broadcastEvent(AbstractEvent event, boolean isPriorityEvent) throws IOException
ResultPartitionWriterAbstractEvent to all channels.IOExceptionpublic ResultSubpartitionView createSubpartitionView(int subpartitionId, BufferAvailabilityListener availabilityListener) throws IOException
ResultPartitionWriterIOExceptionpublic void alignedBarrierTimeout(long checkpointId)
throws IOException
ResultPartitionWriterIOExceptionpublic void abortCheckpoint(long checkpointId,
CheckpointException cause)
ResultPartitionWriterpublic void flushAll()
ResultPartitionWriterpublic void flush(int subpartitionIndex)
ResultPartitionWriterpublic void finish()
throws IOException
ResultPartitionAfter this operation, it is not possible to add further data to the result partition.
For BLOCKING results, this will trigger the deployment of consuming tasks.
finish 在接口中 ResultPartitionWriterfinish 在类中 ResultPartitionIOExceptionpublic void close()
ResultPartitionWriterclose 在接口中 AutoCloseableclose 在接口中 ResultPartitionWriterclose 在类中 ResultPartitionprotected void releaseInternal()
ResultPartitionreleaseInternal 在类中 ResultPartitionpublic int getNumberOfQueuedBuffers()
ResultPartitiongetNumberOfQueuedBuffers 在类中 ResultPartitionpublic long getSizeOfQueuedBuffersUnsafe()
ResultPartitionpublic int getNumberOfQueuedBuffers(int targetSubpartition)
ResultPartitiongetNumberOfQueuedBuffers 在类中 ResultPartitionpublic void notifyEndOfData(StopMode mode) throws IOException
ResultPartitionWriterResultPartitionWriter have emitted all the
user records.notifyEndOfData 在接口中 ResultPartitionWriternotifyEndOfData 在类中 ResultPartitionmode - tells if we should flush all records or not (it is false in case of
stop-with-savepoint (--no-drain))IOExceptionCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.