[ 
https://issues.apache.org/jira/browse/PHOENIX-2640?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15122472#comment-15122472
 ] 

Samarth Jain commented on PHOENIX-2640:
---------------------------------------

As a first cut, a naive solution would be to track all the TableResultIterators 
created for a statement at the PhoenixStatement level. Then statement.cancel() 
would involve calling close on all the TableResultIterators. This in turn would 
end up closing the corresponding server side scanners. Any further invocation 
of next() on the server side scanners will fail with an UnknownScannerException 
error. I call the solution naive because it is likely, especially for 
aggregate/grouped queries, that we might be running server side aggregation 
which happens after we are done reading all the rows from the scanners. In that 
case closing the scanners won't help. We could always tweak our aggregator code 
to check periodically whether the scanner has been closed and to clean up and 
cancel the query gracefully. 

> Make it possible to kill running queries (and ideally list them too)
> --------------------------------------------------------------------
>
>                 Key: PHOENIX-2640
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2640
>             Project: Phoenix
>          Issue Type: New Feature
>            Reporter: John Wilkinson
>
> It would be useful to be able to find and kill queries that have gone on
> for a long time.
> Right now, it looks like there is no way other than killing the client, and no
> way to find running queries other than to have the client track them.
> One useful step would be to implement Statement.cancel(), which would allow 
> client code to cleanly kill queries.
> Even better from a dev-ops/support point of view would be the ability to see 
> running queries via a UI or API of some sort and kill them from there.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to