Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-18165

Investigate removing PriorityQueue usage from KeyRangeConcatIterator

Agile BoardAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsAdd voteVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Normal
    • Resolution: Unresolved
    • 5.x
    • Feature/SAI

    Description

      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 Caleb Rackliffe is as follows:

      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();
      }
      

      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.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            mike_tr_adamson Mike Adamson Assign to me
            mike_tr_adamson Mike Adamson
            Mike Adamson

            Dates

              Created:
              Updated:

              Slack

                Issue deployment