Class RemoteStorageScanner
- java.lang.Object
-
- org.apache.flink.runtime.io.network.partition.hybrid.tiered.tier.remote.RemoteStorageScanner
-
- All Implemented Interfaces:
Runnable
public class RemoteStorageScanner extends Object implements Runnable
TheRemoteStorageScanneris introduced to notify asynchronously for file reading on remote storage. Asynchronous notifications will preventRemoteTierConsumerAgentfrom repeatedly attempting to read remote files and reduce CPU consumption.It will be invoked by
RemoteTierConsumerAgentto 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 Constructor Description RemoteStorageScanner(String baseRemoteStoragePath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()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 Detail
-
RemoteStorageScanner
public RemoteStorageScanner(String baseRemoteStoragePath)
-
-
Method Detail
-
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)
-
-