Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-17291

Implement metastorage cursor batching

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0-beta1
    • None

    Description

      In order to increase metaStorage.range() performance that currently retrieves entries one by one it's possible to implement simple batching. As an initial solution we might hardcode the batch-size.

      Basically speaking it's required to update CursorNextCommand.

      Instead of

      Entry e = (Entry) cursorDesc.cursor().next();
      
      clo.result(new SingleEntryResponse(e.key(), e.value(), e.revision(), e.updateCounter())); 

      we might use something similar to

          List<SingleEntryResponse> batch = new ArrayList<>(RANGE_CURSOR_BATCH_SIZE);
      
          for (int i = 0; i < RANGE_CURSOR_BATCH_SIZE; i++) {
              Entry e = (Entry) cursorDesc.cursor().next();
      
              batch.add(new SingleEntryResponse(e.key(), e.value(), e.revision(), e.updateCounter()));
      
              if (! cursorDesc.cursor.hasNext()) {
                  break;
              }
          }
      
      clo.result(new MultipleEntryResponse(batch));

      It's not trivial to reimplement rocks cursors to also use batching, however it's not that important because rocks cursors are always local.

       

      Besides that it's required to update org.apache.ignite.internal.metastorage.client.CursorImpl with client-side-iteration over batched data and requesting new portion if nothing left.

      Attachments

        Issue Links

          Activity

            People

              Denis Chudov Denis Chudov
              alapin Alexander Lapin
              Alexander Lapin Alexander Lapin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m