presto-hive/src/main/java/io/prestosql/plugin/hive/util/SortBuffer.java/SortBuffer/SortBuffer
class SortBuffer:    public SortBuffer(
            DataSize maxMemory,
            List<Type> types,
            List<Integer> sortFields,
            List<SortOrder> sortOrders,
            PageSorter pageSorter)
    {
        checkArgument(maxMemory.toBytes() > 0, "maxMemory is zero");
        this.maxMemoryBytes = maxMemory.toBytes();
        this.types = requireNonNull(types, "types is null");
        this.sortFields = ImmutableList.copyOf(requireNonNull(sortFields, "sortFields is null"));
        this.sortOrders = ImmutableList.copyOf(requireNonNull(sortOrders, "sortOrders is null"));
        this.pageSorter = requireNonNull(pageSorter, "pageSorter is null");
        this.pageBuilder = new PageBuilder(types);
    }