Class BlockingPhysicalFilePool
java.lang.Object
org.apache.flink.runtime.checkpoint.filemerging.PhysicalFilePool
org.apache.flink.runtime.checkpoint.filemerging.BlockingPhysicalFilePool
- All Implemented Interfaces:
Closeable,AutoCloseable
A Blocking
PhysicalFilePool 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
ConstructorsConstructorDescriptionBlockingPhysicalFilePool(long maxFileSize, PhysicalFile.PhysicalFileCreator physicalFileCreator) -
Method Summary
Modifier and TypeMethodDescriptionprotected Queue<PhysicalFile>Create and return a file queue.pollFile(FileMergingSnapshotManager.SubtaskKey subtaskKey, CheckpointedStateScope scope) Poll a physical file from the pool.booleantryPutFile(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 Details
-
BlockingPhysicalFilePool
public BlockingPhysicalFilePool(long maxFileSize, PhysicalFile.PhysicalFileCreator physicalFileCreator)
-
-
Method Details
-
tryPutFile
public boolean tryPutFile(FileMergingSnapshotManager.SubtaskKey subtaskKey, PhysicalFile physicalFile) throws IOException Description copied from class:PhysicalFilePoolTry to put a physical file into file pool.- Specified by:
tryPutFilein 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:PhysicalFilePoolPoll a physical file from the pool.- Specified by:
pollFilein classPhysicalFilePool- Parameters:
subtaskKey- the key of current subtask.scope- the scope of the checkpoint.- Returns:
- a physical file.
- Throws:
IOException
-
createFileQueue
Description copied from class:PhysicalFilePoolCreate and return a file queue.- Specified by:
createFileQueuein classPhysicalFilePool- Returns:
- a created file queue.
-