public class CompactFileWriter<T> extends AbstractStreamingWriter<T,CompactMessages.CoordinatorInput>
CompactMessages.InputFile
and CompactMessages.EndCheckpoint
to downstream.chainingStrategy, config, latencyStats, LOG, metrics, output, processingTimeService
Constructor and Description |
---|
CompactFileWriter(long bucketCheckInterval,
StreamingFileSink.BucketsBuilder<T,String,? extends StreamingFileSink.BucketsBuilder<T,String,?>> bucketsBuilder) |
Modifier and Type | Method and Description |
---|---|
void |
notifyCheckpointComplete(long checkpointId)
Notifies the listener that the checkpoint with the given
checkpointId completed and
was committed. |
protected void |
onPartFileOpened(String partition,
Path newPath)
Notifies a new file has been opened.
|
protected void |
partitionCreated(String partition)
Notifies a partition created.
|
protected void |
partitionInactive(String partition)
Notifies a partition become inactive.
|
commitUpToCheckpoint, dispose, endInput, initializeState, processElement, processWatermark, snapshotState
close, getChainingStrategy, getContainingTask, getCurrentKey, getExecutionConfig, getInternalTimerService, getKeyedStateBackend, getKeyedStateStore, getMetricGroup, getOperatorConfig, getOperatorID, getOperatorName, getOperatorStateBackend, getOrCreateKeyedState, getPartitionedState, getPartitionedState, getProcessingTimeService, getRuntimeContext, getTimeServiceManager, getUserCodeClassloader, initializeState, isUsingCustomRawKeyedState, notifyCheckpointAborted, open, prepareSnapshotPreBarrier, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processWatermark1, processWatermark2, reportOrForwardLatencyMarker, setChainingStrategy, setCurrentKey, setKeyContextElement1, setKeyContextElement2, setProcessingTimeService, setup, snapshotState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setKeyContextElement
close, getMetricGroup, getOperatorID, initializeState, open, prepareSnapshotPreBarrier, setKeyContextElement1, setKeyContextElement2, snapshotState
notifyCheckpointAborted
getCurrentKey, setCurrentKey
processLatencyMarker
public CompactFileWriter(long bucketCheckInterval, StreamingFileSink.BucketsBuilder<T,String,? extends StreamingFileSink.BucketsBuilder<T,String,?>> bucketsBuilder)
protected void partitionCreated(String partition)
AbstractStreamingWriter
partitionCreated
in class AbstractStreamingWriter<T,CompactMessages.CoordinatorInput>
protected void partitionInactive(String partition)
AbstractStreamingWriter
partitionInactive
in class AbstractStreamingWriter<T,CompactMessages.CoordinatorInput>
protected void onPartFileOpened(String partition, Path newPath)
AbstractStreamingWriter
Note that this does not mean that the file has been created in the file system. It is only created logically and the actual file will be generated after it is committed.
onPartFileOpened
in class AbstractStreamingWriter<T,CompactMessages.CoordinatorInput>
public void notifyCheckpointComplete(long checkpointId) throws Exception
CheckpointListener
checkpointId
completed and
was committed.
These notifications are "best effort", meaning they can sometimes be skipped. To behave
properly, implementers need to follow the "Checkpoint Subsuming Contract". Please see the
class-level JavaDocs
for details.
Please note that checkpoints may generally overlap, so you cannot assume that the notifyCheckpointComplete()
call is always for the latest prior checkpoint (or snapshot) that
was taken on the function/operator implementing this interface. It might be for a checkpoint
that was triggered earlier. Implementing the "Checkpoint Subsuming Contract" (see above)
properly handles this situation correctly as well.
Please note that throwing exceptions from this method will not cause the completed checkpoint to be revoked. Throwing exceptions will typically cause task/job failure and trigger recovery.
notifyCheckpointComplete
in interface CheckpointListener
notifyCheckpointComplete
in class AbstractStreamingWriter<T,CompactMessages.CoordinatorInput>
checkpointId
- The ID of the checkpoint that has been completed.Exception
- This method can propagate exceptions, which leads to a failure/recovery for
the task. Not that this will NOT lead to the checkpoint being revoked.Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.