public boolean hasSpaceForAnotherRecord() {
        return pos + 2 <= array.size();
    }
@return the number of records that have been inserted into this sorter.
indexr-query-opt/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorter.java