Hi Duo, Thanks for your explanation. This actually what currently is implemented; as in the pseudo code below.
This would be beneficial of course. E.g., if a scan would be a full-table scan
with e.g. a column name filter that doesn’t return any results, this would
waste a lot of effort in the HBase region server. More actively sending a
closeScanner request would prevent this. Right now, we need to wait for the
heartbeat interval.
Would such behaviour be desirable from an HBase project/community point of view?
Best regards,
Frens Jan
class subscription:
closed = false
close():
close = true;
onNext(results, controller):
if(closed)
controller.terminate();
else
...
onHeartbeat(controller):
if(closed)
controller.terminate();
> On 15 May 2025, at 17:24, 张铎(Duo Zhang) <[email protected]> wrote:
>
> For asynchronous scan, we will send scan request to region server in
> background, and once there is a scan result returned from the region
> server, we can issue the next scan request.
> And in fact, we still do not have the ability to actually 'cancel' a
> scan request which is running at region server side, what we call a
> 'terminate', is to just stop issuing new scan request from client
> side.
>
> The terminate call in ScanController just tells the background task to
> stop sending new request to region server, and it is only valid when
> you have finished a scan request and get the result from region
> server.
>
> For actual implementation, since the scan request is in background,
> you can just use a flag to record that you want to terminate the scan,
> and then you are free to do anything you want. And in the next onNext
> call, you just call terminate to stop sending new scan requests.
>
> Thanks.
signature.asc
Description: Message signed with OpenPGP
