// 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;
                                public void process(List row) {
                                    int oid = (int) row.get(0);
                                    String name = (String) row.get(1);
                                    oid2name.put(oid, name);
                                    name2oid.put(name, oid);
                                }
                            })
                    .create();

            int results = (int) con.queryWith(pg_types);

            if (results == 0) {
                throw new IllegalStateException("no types?");
            }

            SQL schema = SQL.query("SELECT" +
                    "  a.attname," + // column name
                    "  a.attnum," + // column index
                    "  b.oid," + // table oid
                    "  b.relname" + // table name
                    " FROM pg_class b" +
                    " JOIN pg_attribute a" +
                    " ON a.attrelid = b.oid" +
                    " WHERE b.relkind = 'r'" +
                    " AND a.attnum > 0" +
                    " AND b.relname NOT LIKE 'pg_%'" +
                    " AND b.relname NOT LIKE 'sql_%'")
                    .withName("schema.names")
                    .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;

                                public void process(List row) {
                                    int oid = (int) row.get(0);
                                    String name = (String) row.get(1);
                                    oid2name.put(oid, name);
                                    name2oid.put(name, oid);
                                }
                            })
                    .create();

            int results = (int) con.queryWith(pg_types);

            if (results == 0) {
                throw new IllegalStateException("no types?");
            }

            SQL schema = SQL.query("SELECT" +
                    "  a.attname," + // column name
                    "  a.attnum," + // column index
                    "  b.oid," + // table oid
                    "  b.relname" + // table name
                    " FROM pg_class b" +
                    " JOIN pg_attribute a" +
                    " ON a.attrelid = b.oid" +
                    " WHERE b.relkind = 'r'" +
                    " AND a.attnum > 0" +
                    " AND b.relname NOT LIKE 'pg_%'" +
                    " AND b.relname NOT LIKE 'sql_%'")
                    .withName("schema.names")
                    .buildRowsWith(Helpers.ROW_AS_LIST)
                    .buildResultsWith(
                            new RowProcessor<List>() {