Class NonBlockingPhysicalFilePool
- java.lang.Object
-
- org.apache.flink.runtime.checkpoint.filemerging.PhysicalFilePool
-
- org.apache.flink.runtime.checkpoint.filemerging.NonBlockingPhysicalFilePool
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class NonBlockingPhysicalFilePool extends PhysicalFilePool
A Non-BlockingPhysicalFilePool
which will always provide usable physical file without blocking. It may create many physical files ifpollFile(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
Constructors Constructor Description NonBlockingPhysicalFilePool(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
-
NonBlockingPhysicalFilePool
public NonBlockingPhysicalFilePool(long maxFileSize, PhysicalFile.PhysicalFileCreator physicalFileCreator)
-
-
Method Detail
-
tryPutFile
public boolean tryPutFile(FileMergingSnapshotManager.SubtaskKey subtaskKey, PhysicalFile physicalFile)
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.
-
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.
-
-