presto-thrift/src/main/java/io/prestosql/plugin/thrift/ThriftPageSource.java/ThriftPageSource/ThriftPageSource
class ThriftPageSource:    public ThriftPageSource(
            DriftClient<PrestoThriftService> client,
            Map<String, String> thriftHeader,
            ThriftConnectorSplit split,
            List<ColumnHandle> columns,
            ThriftConnectorStats stats,
            long maxBytesPerResponse)
    {
        // init columns
        requireNonNull(columns, "columns is null");
        ImmutableList.Builder<String> columnNames = new ImmutableList.Builder<>();
        ImmutableList.Builder<Type> columnTypes = new ImmutableList.Builder<>();
        for (ColumnHandle columnHandle : columns) {
            ThriftColumnHandle thriftColumnHandle = (ThriftColumnHandle) columnHandle;
            columnNames.add(thriftColumnHandle.getColumnName());
            columnTypes.add(thriftColumnHandle.getColumnType());
        }
        this.columnNames = columnNames.build();
        this.columnTypes = columnTypes.build();
        this.stats = requireNonNull(stats, "stats is null");

        // this parameter is read from config, so it should be checked by config validation
        // however, here it's a raw constructor parameter, so adding this safety check
        checkArgument(maxBytesPerResponse > 0, "maxBytesPerResponse is zero or negative");
        this.maxBytesPerResponse = maxBytesPerResponse;

        // init split
        requireNonNull(split, "split is null");
        this.splitId = split.getSplitId();

        // init client
        requireNonNull(client, "client is null");
        if (split.getAddresses().isEmpty()) {
            this.client = client.get(thriftHeader);
        }
        else {
            String hosts = split.getAddresses().stream()
                    .map(HostAddress::toString)
                    .collect(joining(","));
            this.client = client.get(Optional.of(hosts), thriftHeader);
        }
    }