Class RemoteStorageScanner
java.lang.Object
org.apache.flink.runtime.io.network.partition.hybrid.tiered.tier.remote.RemoteStorageScanner
- All Implemented Interfaces:
Runnable
The
RemoteStorageScanner is introduced to notify asynchronously for file reading on
remote storage. Asynchronous notifications will prevent RemoteTierConsumerAgent from
repeatedly attempting to read remote files and reduce CPU consumption.
It will be invoked by RemoteTierConsumerAgent to watch the required segments and scan
the existence status of the segments. If the segment file is found, it will notify the
availability of segment file.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the executor.voidregisterAvailabilityAndPriorityNotifier(BiConsumer<TieredStoragePartitionId, TieredStorageSubpartitionId> availabilityNotifier) voidrun()Iterate the watched segment ids and check related file status.voidstart()Start the executor.voidwatchSegment(TieredStoragePartitionId partitionId, TieredStorageSubpartitionId subpartitionId, int segmentId) Watch the segment for a specific subpartition in theRemoteStorageScanner.
-
Constructor Details
-
RemoteStorageScanner
-
-
Method Details
-
start
public void start()Start the executor. -
watchSegment
public void watchSegment(TieredStoragePartitionId partitionId, TieredStorageSubpartitionId subpartitionId, int segmentId) Watch the segment for a specific subpartition in theRemoteStorageScanner.If a segment with a larger or equal id already exists, the current segment won't be watched.
If a segment with a smaller segment id is still being watched, the current segment will replace it because the smaller segment should have been consumed. This method ensures that only one segment file can be watched for each subpartition.
- Parameters:
partitionId- is the id of partition.subpartitionId- is the id of subpartition.segmentId- is the id of segment.
-
close
public void close()Close the executor. -
run
public void run()Iterate the watched segment ids and check related file status. -
registerAvailabilityAndPriorityNotifier
public void registerAvailabilityAndPriorityNotifier(BiConsumer<TieredStoragePartitionId, TieredStorageSubpartitionId> availabilityNotifier)
-