presto-accumulo/src/main/java/io/prestosql/plugin/accumulo/index/Indexer.java/Indexer/Indexer
class Indexer:    public Indexer(
            Connector connector,
            Authorizations auths,
            AccumuloTable table,
            BatchWriterConfig writerConfig)
            throws TableNotFoundException
    {
        this.connector = requireNonNull(connector, "connector is null");
        this.table = requireNonNull(table, "table is null");
        this.writerConfig = requireNonNull(writerConfig, "writerConfig is null");
        requireNonNull(auths, "auths is null");

        this.serializer = table.getSerializerInstance();

        // Create our batch writer
        indexWriter = connector.createBatchWriter(table.getIndexTableName(), writerConfig);

        ImmutableMultimap.Builder<ByteBuffer, ByteBuffer> indexColumnsBuilder = ImmutableMultimap.builder();
        Map<ByteBuffer, Map<ByteBuffer, Type>> indexColumnTypesBuilder = new HashMap<>();

        // Initialize metadata
        table.getColumns().forEach(columnHandle -> {
            if (columnHandle.isIndexed()) {
                // Wrap the column family and qualifier for this column and add it to
                // collection of indexed columns
                ByteBuffer family = wrap(columnHandle.getFamily().get().getBytes(UTF_8));
                ByteBuffer qualifier = wrap(columnHandle.getQualifier().get().getBytes(UTF_8));
                indexColumnsBuilder.put(family, qualifier);

                // Create a mapping for this column's Presto type, again creating a new one for the
                // family if necessary
                Map<ByteBuffer, Type> types = indexColumnTypesBuilder.get(family);
                if (types == null) {
                    types = new HashMap<>();
                    indexColumnTypesBuilder.put(family, types);
                }
                types.put(qualifier, columnHandle.getType());
            }
        });

        indexColumns = indexColumnsBuilder.build();
        indexColumnTypes = ImmutableMap.copyOf(indexColumnTypesBuilder);

        // If there are no indexed columns, throw an exception
        if (indexColumns.isEmpty()) {
            throw new PrestoException(NOT_SUPPORTED, "No indexed columns in table metadata. Refusing to index a table with no indexed columns");
        }

        // Initialize metrics map
        // This metrics map is for column cardinality
        metrics.put(METRICS_TABLE_ROW_COUNT, new AtomicLong(0));

        // Scan the metrics table for existing first row and last row
        Pair<byte[], byte[]> minmax = getMinMaxRowIds(connector, table, auths);
        firstRow = minmax.getLeft();
        lastRow = minmax.getRight();
    }