Package org.apache.flink.changelog.fs
Class DuplicatingStateChangeFsUploader
- java.lang.Object
-
- org.apache.flink.changelog.fs.AbstractStateChangeFsUploader
-
- org.apache.flink.changelog.fs.DuplicatingStateChangeFsUploader
-
- All Implemented Interfaces:
AutoCloseable
,StateChangeUploader
public class DuplicatingStateChangeFsUploader extends AbstractStateChangeFsUploader
A StateChangeFsUploader implementation that writes the changes to remote and local.- Local dstl files are only managed by TM side,
LocalChangelogRegistry
,TaskChangelogRegistry
andChangelogTaskLocalStateStore
are responsible for managing them.- Remote dstl files are managed by TM side and JM side,
TaskChangelogRegistry
is responsible for TM side, andSharedStateRegistry
is responsible for JM side.The total discard logic of local dstl files is:
- Register files to
TaskChangelogRegistry.startTracking(org.apache.flink.runtime.state.StreamStateHandle, long)
onAbstractStateChangeFsUploader.upload(java.util.Collection<org.apache.flink.changelog.fs.StateChangeUploadScheduler.UploadTask>)
. - Store the meta of files into
ChangelogTaskLocalStateStore
by AsyncCheckpointRunnable#reportCompletedSnapshotStates(). - Pass control of the file to
LocalChangelogRegistry.register(org.apache.flink.runtime.state.StreamStateHandle, long)
when FsStateChangelogWriter#persist , files of the previous checkpoint will be deleted byLocalChangelogRegistry.discardUpToCheckpoint(long)
when the checkpoint is confirmed. - When ChangelogTruncateHelper#materialized() or
ChangelogTruncateHelper#checkpointSubsumed() is called,
TaskChangelogRegistry.release(org.apache.flink.runtime.state.StreamStateHandle)
is responsible for deleting local files. - When one checkpoint is aborted, all accumulated local dstl files will be deleted at once.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.changelog.fs.StateChangeUploader
StateChangeUploader.UploadTasksResult
-
-
Field Summary
-
Fields inherited from class org.apache.flink.changelog.fs.AbstractStateChangeFsUploader
bufferSize, compression, metrics
-
-
Constructor Summary
Constructors Constructor Description DuplicatingStateChangeFsUploader(JobID jobID, Path basePath, FileSystem fileSystem, boolean compression, int bufferSize, ChangelogStorageMetricGroup metrics, TaskChangelogRegistry changelogRegistry, LocalSnapshotDirectoryProvider localSnapshotDirectoryProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
org.apache.flink.changelog.fs.OutputStreamWithPos
prepareStream()
-
Methods inherited from class org.apache.flink.changelog.fs.AbstractStateChangeFsUploader
generateFileName, upload
-
-
-
-
Constructor Detail
-
DuplicatingStateChangeFsUploader
public DuplicatingStateChangeFsUploader(JobID jobID, Path basePath, FileSystem fileSystem, boolean compression, int bufferSize, ChangelogStorageMetricGroup metrics, TaskChangelogRegistry changelogRegistry, LocalSnapshotDirectoryProvider localSnapshotDirectoryProvider)
-
-
Method Detail
-
prepareStream
public org.apache.flink.changelog.fs.OutputStreamWithPos prepareStream() throws IOException
- Throws:
IOException
-
-