@VisibleForTesting
    public void closeCurrentPage() {
        if (currentPage != null) {
            pageCursor = currentPage.getBaseOffset() + currentPage.size();
        }
    }
Marks the current page as no-more-space-available, and as a result, either allocate a
new page or spill when we see the next record.
indexr-query-opt/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java