Class NonBlockingPhysicalFilePool
java.lang.Object
org.apache.flink.runtime.checkpoint.filemerging.PhysicalFilePool
org.apache.flink.runtime.checkpoint.filemerging.NonBlockingPhysicalFilePool
- All Implemented Interfaces:
Closeable,AutoCloseable
A Non-Blocking
PhysicalFilePool which will always provide usable physical file without
blocking. It may create many physical files if pollFile(FileMergingSnapshotManager.SubtaskKey, CheckpointedStateScope) frequently.-
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
ConstructorsConstructorDescriptionNonBlockingPhysicalFilePool(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
-
NonBlockingPhysicalFilePool
public NonBlockingPhysicalFilePool(long maxFileSize, PhysicalFile.PhysicalFileCreator physicalFileCreator)
-
-
Method Details
-
tryPutFile
public boolean tryPutFile(FileMergingSnapshotManager.SubtaskKey subtaskKey, PhysicalFile physicalFile) 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.
-
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.
-