UnsafeInMemorySorter
Used by UnsafeExternalSorter, and UnsafeKVExternalSorter.
Internally, it has an array which maintains the record address, and its prefix. When sorting, it can move the pointer array around by comparing the prefix only if the prefix is not equal. Otherwise, it needs to compare the real value as well. By this way, it reach cache locality.
When it is constructed, it has to be passed in RecordComparator and PrefixComparator for sorting. If the RecordComparator is null, there will be no sorting.