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
A StateChangeFsUploader implementation that writes the changes to remote and local.
Local dstl files are only managed by TM side, Remote dstl files are managed by TM side and JM side,
LocalChangelogRegistry, TaskChangelogRegistry and ChangelogTaskLocalStateStore are responsible for managing
them.
TaskChangelogRegistry is
responsible for TM side, and SharedStateRegistry 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
ChangelogTaskLocalStateStoreby 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
ConstructorsConstructorDescriptionDuplicatingStateChangeFsUploader(org.apache.flink.api.common.JobID jobID, org.apache.flink.core.fs.Path basePath, org.apache.flink.core.fs.FileSystem fileSystem, boolean compression, int bufferSize, ChangelogStorageMetricGroup metrics, TaskChangelogRegistry changelogRegistry, org.apache.flink.runtime.state.LocalSnapshotDirectoryProvider localSnapshotDirectoryProvider) -
Method Summary
Methods inherited from class org.apache.flink.changelog.fs.AbstractStateChangeFsUploader
generateFileName, upload
-
Constructor Details
-
DuplicatingStateChangeFsUploader
public DuplicatingStateChangeFsUploader(org.apache.flink.api.common.JobID jobID, org.apache.flink.core.fs.Path basePath, org.apache.flink.core.fs.FileSystem fileSystem, boolean compression, int bufferSize, ChangelogStorageMetricGroup metrics, TaskChangelogRegistry changelogRegistry, org.apache.flink.runtime.state.LocalSnapshotDirectoryProvider localSnapshotDirectoryProvider)
-
-
Method Details
-
prepareStream
- Throws:
IOException
-
close
- Throws:
Exception
-