code: private void moveRecords(Segment seg, ByteBuffer max, boolean deleteFromSource) {
          checkWritesAllowed();
          ByteBuffer from = seg.getMin();
          ByteBuffer toExclusive = successor(max);
  
          int batchSize = scanBatchSize();
          Iterator<List<ByteBuffer>> batchIter = Iterators.partition(
                  _dao.scanRecords(seg.getDataId(), from, toExclusive, batchSize, Integer.MAX_VALUE),
                  batchSize);
          while (batchIter.hasNext()) {
              List<ByteBuffer> records = batchIter.next();
  
              // Write to the destination.  Go through addAll() to update stats, do splitting, etc.
              addAll(records);
  
              // Delete individual records from the source.
              if (deleteFromSource) {
                  _dao.prepareUpdate(_name).deleteRecords(seg.getDataId(), records).execute();
              }
          }
  
          seg.setMin(toExclusive);
      }
docs: Move/copy segment records from a segment that isn't in segmentMap to the segments that are.