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

Ekaterina Dimitrova commented on CASSANDRA-18165:
-------------------------------------------------

Indeed, agreed with [~maedhroz], this will be done as part of CASSANDRA-19428. 
To be committed soon  

> Investigate removing PriorityQueue usage from KeyRangeConcatIterator
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-18165
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18165
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Feature/SAI
>            Reporter: Mike Adamson
>            Assignee: Mike Adamson
>            Priority: Normal
>              Labels: SAI
>             Fix For: 5.0, 5.1
>
>
> It has been identified during the review of CASSANDRA-18058 that the 
> KeyRangeConcatIterator could potentially stop using a PriorityQueue to 
> maintain it's active list of sorted KeyRangeIterators.
> The code suggested by [~maedhroz] is as follows:
> {code:java}
> private int i = 0;
> ...
> protected void performSkipTo(PrimaryKey primaryKey)
> {
>     while (i < toRelease.size())
>     {
>         RangeIterator currentIterator = toRelease.get(i);
>         if (currentIterator.getCurrent().compareTo(primaryKey) >= 0)
>             break;
>         if (currentIterator.getMaximum().compareTo(primaryKey) >= 0)
>         {
>             currentIterator.skipTo(primaryKey);
>             break;
>         }
>         i++;
>     }
> }
> ...
> protected PrimaryKey computeNext()
> {
>     while (i < toRelease.size())
>     {
>         RangeIterator currentIterator = toRelease.get(i);
>         
>         if (currentIterator.hasNext())
>             return currentIterator.next();
>         
>         i++;
>     }
>     return endOfData();
> }
> {code}
> It was decided that this change would need performance and correctness 
> testing in it's own right would not be included in the original SAI CEP 
> ticket.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to