public class NonBlockingPhysicalFilePool extends PhysicalFilePool
PhysicalFilePool
which will always provide usable physical file without
blocking. It may create many physical files if pollFile(FileMergingSnapshotManager.SubtaskKey,
CheckpointedStateScope)
frequently.PhysicalFilePool.Type
exclusivePhysicalFilePool, maxFileSize, physicalFileCreator, sharedPhysicalFilePoolBySubtask
Constructor and Description |
---|
NonBlockingPhysicalFilePool(long maxFileSize,
PhysicalFile.PhysicalFileCreator physicalFileCreator) |
Modifier and Type | Method and 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.
|
close, close, getFileQueue, isEmpty
public NonBlockingPhysicalFilePool(long maxFileSize, PhysicalFile.PhysicalFileCreator physicalFileCreator)
public boolean tryPutFile(FileMergingSnapshotManager.SubtaskKey subtaskKey, PhysicalFile physicalFile)
PhysicalFilePool
tryPutFile
in class PhysicalFilePool
subtaskKey
- the key of current subtask.physicalFile
- target physical file.@Nonnull public PhysicalFile pollFile(FileMergingSnapshotManager.SubtaskKey subtaskKey, CheckpointedStateScope scope) throws IOException
PhysicalFilePool
pollFile
in class PhysicalFilePool
subtaskKey
- the key of current subtask.scope
- the scope of the checkpoint.IOException
protected Queue<PhysicalFile> createFileQueue()
PhysicalFilePool
createFileQueue
in class PhysicalFilePool
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.