Class BlockingPhysicalFilePool
- java.lang.Object
-
- org.apache.flink.runtime.checkpoint.filemerging.PhysicalFilePool
-
- org.apache.flink.runtime.checkpoint.filemerging.BlockingPhysicalFilePool
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class BlockingPhysicalFilePool extends PhysicalFilePool
A BlockingPhysicalFilePool
which may block when polling physical files. This class try best to reuse a physical file until its size > maxFileSize.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.flink.runtime.checkpoint.filemerging.PhysicalFilePool
PhysicalFilePool.Type
-
-
Field Summary
-
Fields inherited from class org.apache.flink.runtime.checkpoint.filemerging.PhysicalFilePool
exclusivePhysicalFilePool, maxFileSize, physicalFileCreator, sharedPhysicalFilePoolBySubtask
-
-
Constructor Summary
Constructors Constructor Description BlockingPhysicalFilePool(long maxFileSize, PhysicalFile.PhysicalFileCreator physicalFileCreator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Queue<PhysicalFile>
createFileQueue()
Create and return a file queue.PhysicalFile
pollFile(FileMergingSnapshotManager.SubtaskKey subtaskKey, CheckpointedStateScope scope)
Poll a physical file from the pool.boolean
tryPutFile(FileMergingSnapshotManager.SubtaskKey subtaskKey, PhysicalFile physicalFile)
Try to put a physical file into file pool.-
Methods inherited from class org.apache.flink.runtime.checkpoint.filemerging.PhysicalFilePool
close, close, getFileQueue, isEmpty
-
-
-
-
Constructor Detail
-
BlockingPhysicalFilePool
public BlockingPhysicalFilePool(long maxFileSize, PhysicalFile.PhysicalFileCreator physicalFileCreator)
-
-
Method Detail
-
tryPutFile
public boolean tryPutFile(FileMergingSnapshotManager.SubtaskKey subtaskKey, PhysicalFile physicalFile) throws IOException
Description copied from class:PhysicalFilePool
Try to put a physical file into file pool.- Specified by:
tryPutFile
in classPhysicalFilePool
- Parameters:
subtaskKey
- the key of current subtask.physicalFile
- target physical file.- Returns:
- true if file is in the pool, false otherwise.
- Throws:
IOException
-
pollFile
@Nonnull public PhysicalFile pollFile(FileMergingSnapshotManager.SubtaskKey subtaskKey, CheckpointedStateScope scope) throws IOException
Description copied from class:PhysicalFilePool
Poll a physical file from the pool.- Specified by:
pollFile
in classPhysicalFilePool
- Parameters:
subtaskKey
- the key of current subtask.scope
- the scope of the checkpoint.- Returns:
- a physical file.
- Throws:
IOException
-
createFileQueue
protected Queue<PhysicalFile> createFileQueue()
Description copied from class:PhysicalFilePool
Create and return a file queue.- Specified by:
createFileQueue
in classPhysicalFilePool
- Returns:
- a created file queue.
-
-