// Path: src/java/shadow/pgsql/utils/RowProcessor.java
// public abstract class RowProcessor<ROW> implements ResultBuilder<Integer, Integer, ROW> {
// 
//     @Override
//     public Integer init() {
//         return 0;
//     }
// 
//     public abstract void process(ROW row);
// 
//     @Override
//     public Integer add(Integer state, ROW row) {
//         process(row);
//         return state + 1;
//     }
// 
//     @Override
//     public Integer complete(Integer state) {
//         return state;
//     }
// }


import com.codahale.metrics.Counter;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.Timer;
import shadow.pgsql.utils.RowProcessor;
import java.io.EOFException;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

            if (buf.get() != 'S') {
                throw new IllegalStateException("ssl not accepted");
            }

            io = SSLSocketIO.start(channel, config.sslContext, config.host, config.port);
        } else {
            SocketChannel channel = SocketChannel.open(new InetSocketAddress(config.host, config.port));
            channel.configureBlocking(true);
            io = new SocketIO(channel);

            //io = new StreamIO(new Socket(config.host, config.port));
        }

        pg = new Connection(this, io);
        pg.startup(config.connectParams, config.authHandler);

        timerContext.stop();

        return pg;
    }

    void fetchSchemaInfo() throws IOException {
        // fetch schema related things
        try (Connection con = connect()) {

            SQL pg_types = SQL.query("SELECT oid, typname FROM pg_type")
                    .withName("schema.types")
                    .buildRowsWith(Helpers.ROW_AS_LIST)
                    .buildResultsWith(
// Path: src/java/shadow/pgsql/utils/RowProcessor.java
// public abstract class RowProcessor<ROW> implements ResultBuilder<Integer, Integer, ROW> {
// 
//     @Override
//     public Integer init() {
//         return 0;
//     }
// 
//     public abstract void process(ROW row);
// 
//     @Override
//     public Integer add(Integer state, ROW row) {
//         process(row);
//         return state + 1;
//     }
// 
//     @Override
//     public Integer complete(Integer state) {
//         return state;
//     }
// }


// Path: src/java/shadow/pgsql/Database.java
import com.codahale.metrics.Counter;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.Timer;
import shadow.pgsql.utils.RowProcessor;
import java.io.EOFException;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


            if (buf.get() != 'S') {
                throw new IllegalStateException("ssl not accepted");
            }

            io = SSLSocketIO.start(channel, config.sslContext, config.host, config.port);
        } else {
            SocketChannel channel = SocketChannel.open(new InetSocketAddress(config.host, config.port));
            channel.configureBlocking(true);
            io = new SocketIO(channel);

            //io = new StreamIO(new Socket(config.host, config.port));
        }

        pg = new Connection(this, io);
        pg.startup(config.connectParams, config.authHandler);

        timerContext.stop();

        return pg;
    }

    void fetchSchemaInfo() throws IOException {
        // fetch schema related things
        try (Connection con = connect()) {

            SQL pg_types = SQL.query("SELECT oid, typname FROM pg_type")
                    .withName("schema.types")
                    .buildRowsWith(Helpers.ROW_AS_LIST)
                    .buildResultsWith(
                            new RowProcessor<List>() {