public ShuffleSorterIterator getSortedIterator() {
    int offset = 0;
    if (useRadixSort) {
      offset = RadixSort.sort(
        array, pos,
        PackedRecordPointer.PARTITION_ID_START_BYTE_INDEX,
        PackedRecordPointer.PARTITION_ID_END_BYTE_INDEX, false, false);
    } else {
      MemoryBlock unused = new MemoryBlock(
        array.getBaseObject(),
        array.getBaseOffset() + pos * 8L,
        (array.size() - pos) * 8L);
      LongArray buffer = new LongArray(unused);
      Sorter<PackedRecordPointer, LongArray> sorter =
        new Sorter<>(new ShuffleSortDataFormat(buffer));

      sorter.sort(array, 0, pos, SORT_COMPARATOR);
    }
    return new ShuffleSorterIterator(pos, array, offset);
  }
public ShuffleSorterIterator getSortedIterator ( ) { int offset = 0 ; if ( useRadixSort ) { offset = RadixSort . sort ( array , pos , PackedRecordPointer . PARTITION_ID_START_BYTE_INDEX , PackedRecordPointer . PARTITION_ID_END_BYTE_INDEX , false , false ) ; } else { MemoryBlock unused = new MemoryBlock ( array . getBaseObject ( ) , array . getBaseOffset ( ) + pos * 8L , ( array . size ( ) - pos ) * 8L ) ; LongArray buffer = new LongArray ( unused ) ; Sorter < PackedRecordPointer , LongArray > sorter = new Sorter < > ( new ShuffleSortDataFormat ( buffer ) ) ; sorter . sort ( array , 0 , pos , SORT_COMPARATOR ) ; } return new ShuffleSorterIterator ( pos , array , offset ) ; }
Return an iterator over record pointers in sorted order.