docs: protected long loadAll( NodeSequence sequence,
                              QueueBuffer<BufferedRow> buffer,
                              AtomicLong batchSize,
                              Queue<Batch> inMemoryBatches,
                              int numRowsInMemory ) {
          // Put all of the batches from the sequence into the buffer
          Batch batch = sequence.nextBatch();
          boolean loadIntoMemory = numRowsInMemory > 0 && inMemoryBatches != null;
          long numInMemory = 0L;
          while (batch != null && batchSize.get() == 0L) {
              if (loadIntoMemory) {
                  Batch copy = NodeSequence.batchWithCount(batch);
                  inMemoryBatches.add(copy);
                  batchSize.set(copy.rowCount());
                  numInMemory += copy.rowCount();
                  numRowsInMemory -= batchSize.get();
                  if (numRowsInMemory <= 0) loadIntoMemory = false;
              } else {
                  while (batch.hasNext()) {
                      batch.nextRow();
                      buffer.append(createRow(batch));
                      batchSize.incrementAndGet();
                  }
              }
              batch = sequence.nextBatch();
          }
          while (batch != null) {
              if (loadIntoMemory) {
                  Batch copy = NodeSequence.batchWithCount(batch);
                  inMemoryBatches.add(copy);
                  numInMemory += copy.rowCount();
                  numRowsInMemory -= copy.rowCount();
                  if (numRowsInMemory <= 0) loadIntoMemory = false;
              } else {
                  while (batch.hasNext()) {
                      batch.nextRow();
                      buffer.append(createRow(batch));
                  }
              }
              batch = sequence.nextBatch();
          }
          return buffer.size() + numInMemory;
      }