Class LogicalFile
java.lang.Object
org.apache.flink.runtime.checkpoint.filemerging.LogicalFile
An abstraction of logical files in file-merging checkpoints. It stands for a data segment, that
is to say a single file before file-merging.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionLogicalFile(LogicalFile.LogicalFileId fileId, PhysicalFile physicalFile, long startOffset, long length, FileMergingSnapshotManager.SubtaskKey subtaskKey) -
Method Summary
Modifier and TypeMethodDescriptionvoidadvanceLastCheckpointId(long checkpointId) A logical file may share across checkpoints (especially for shared state).voiddiscardWithCheckpointId(long checkpointId) When a checkpoint that uses this logical file is subsumed or aborted, discard this logical file.booleanlonglonglonginthashCode()boolean
-
Constructor Details
-
LogicalFile
public LogicalFile(LogicalFile.LogicalFileId fileId, @Nonnull PhysicalFile physicalFile, long startOffset, long length, @Nonnull FileMergingSnapshotManager.SubtaskKey subtaskKey)
-
-
Method Details
-
getFileId
-
advanceLastCheckpointId
public void advanceLastCheckpointId(long checkpointId) A logical file may share across checkpoints (especially for shared state). When this logical file is used/reused by a checkpoint, update the last checkpoint id that uses this logical file.- Parameters:
checkpointId- the checkpoint that uses this logical file.
-
discardWithCheckpointId
When a checkpoint that uses this logical file is subsumed or aborted, discard this logical file. If this file is used by a later checkpoint, the file should not be discarded. Note that the removal of logical may cause the deletion of physical file.- Parameters:
checkpointId- the checkpoint that is notified subsumed or aborted.- Throws:
IOException- if anything goes wrong with file system.
-
getLastUsedCheckpointID
public long getLastUsedCheckpointID() -
getPhysicalFile
-
getStartOffset
public long getStartOffset() -
getLength
public long getLength() -
getSubtaskKey
-
isDiscarded
@VisibleForTesting public boolean isDiscarded() -
hashCode
public int hashCode() -
equals
-