public void insertRecord(long recordPointer, long keyPrefix) {
        if (!hasSpaceForAnotherRecord()) {
            expandPointerArray(consumer.allocateArray(array.size() * 2));
        }
        array.set(pos, recordPointer);
        pos++;
        array.set(pos, keyPrefix);
        pos++;
    }
Inserts a record to be sorted. Assumes that the record pointer points to a record length
stored as a 4-byte integer, followed by the record's bytes.

@param recordPointer pointer to a record in a data page, encoded by {@link TaskMemoryManager}.
@param keyPrefix     a user-defined key prefix
indexr-query-opt/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorter.java