Class LogicalFile
- java.lang.Object
-
- org.apache.flink.runtime.checkpoint.filemerging.LogicalFile
-
public class LogicalFile extends Object
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 Modifier and Type Class Description static classLogicalFile.LogicalFileIdID forLogicalFile.
-
Constructor Summary
Constructors Constructor Description LogicalFile(LogicalFile.LogicalFileId fileId, PhysicalFile physicalFile, long startOffset, long length, FileMergingSnapshotManager.SubtaskKey subtaskKey)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadvanceLastCheckpointId(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.booleanequals(Object o)LogicalFile.LogicalFileIdgetFileId()longgetLastUsedCheckpointID()longgetLength()PhysicalFilegetPhysicalFile()longgetStartOffset()FileMergingSnapshotManager.SubtaskKeygetSubtaskKey()inthashCode()booleanisDiscarded()
-
-
-
Constructor Detail
-
LogicalFile
public LogicalFile(LogicalFile.LogicalFileId fileId, @Nonnull PhysicalFile physicalFile, long startOffset, long length, @Nonnull FileMergingSnapshotManager.SubtaskKey subtaskKey)
-
-
Method Detail
-
getFileId
public LogicalFile.LogicalFileId 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
public void discardWithCheckpointId(long checkpointId) throws IOExceptionWhen 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
@Nonnull public PhysicalFile getPhysicalFile()
-
getStartOffset
public long getStartOffset()
-
getLength
public long getLength()
-
getSubtaskKey
@Nonnull public FileMergingSnapshotManager.SubtaskKey getSubtaskKey()
-
isDiscarded
@VisibleForTesting public boolean isDiscarded()
-
-