On 18/07/16 21:06, Andy Seaborne wrote:
What about spill to disk and cancellation in the second or later spill? (did
the files get cleared?)
I didn't test mixing spilling and sort-cancellation [1]. But
cancelling the sort by throwing an exception in the comparator
and catching that exception around the call to Arrays.sort()
should not affect the spill mechanics at all ... except the
merge depends on the files each being sorted, but the merge
doesn't run anyway if the query has been cancelled ...
I'll construct some unit tests and have them include cases
mixing spilling and cancellation.
[1] I had earlier experimented with using spill-to-disk as a way of
getting faster cancellations, and it does work, but there's a
significant additional time overhead as well as needing disk
space for the sort files. Stuart Williams suggested the
aborting-comparator trick.
There are a reasonable number of cases here.
More than I had realised, thanks for catching them.
Chris
--
"It's just the beginning we've seen" - Colosseum, /Tomorrow's Blues/
Epimorphics Ltd, http://www.epimorphics.com
Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20 6PT
Epimorphics Ltd. is a limited company registered in England (number 7016688)