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

ASF GitHub Bot commented on JENA-1212:
--------------------------------------

Github user ajs6f commented on a diff in the pull request:

    https://github.com/apache/jena/pull/157#discussion_r71167237
  
    --- Diff: 
jena-arq/src/main/java/org/apache/jena/atlas/data/SortedDataBag.java ---
    @@ -69,19 +69,81 @@
         
         protected final ThresholdPolicy<E> policy;
         protected final SerializationFactory<E> serializationFactory;
    -    protected final Comparator<? super E> comparator;
    +    protected final CanAbortComparator comparator;
         
         protected boolean finishedAdding = false;
         protected boolean spilled = false;
         protected boolean closed = false;
    +    protected volatile boolean cancelled;
    --- End diff --
    
    By making this a field inside `CanAbortComparator` and offering a method 
`cancel()` on `CanAbortComparator` you could break that type out and keep it 
static, instead of an inner type here.


> allow ORDER BY sort to be cancelled
> -----------------------------------
>
>                 Key: JENA-1212
>                 URL: https://issues.apache.org/jira/browse/JENA-1212
>             Project: Apache Jena
>          Issue Type: Improvement
>          Components: ARQ
>            Reporter: christopher james dollin
>            Priority: Minor
>             Fix For: Jena 3.1.1
>
>
> When a query with an ORDER BY is cancelled, the component
> Arrays.sort() that sorts the chunk(s) of the result
> bindings runs to completion before the cancel finishes.
> [See QueryIterSort and SortedDataBag.]
> For a large result set, this results in a long wait
> before the cancelled request finally finishes. This
> can be inconvenient.



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

Reply via email to