accumulo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Korb, Michael [USA]" <Korb_Mich...@bah.com>
Subject BatchWriter not working
Date Mon, 17 Dec 2012 22:10:13 GMT
I'm trying to write a simple Accumulo insertion with a BatchWriter, based on this document:
http://accumulo.apache.org/1.4/user_manual/Writing_Accumulo_Clients.html. I have a running
Accumulo instance with a table "table" and can add and remove records using the shell. But
I run the following code, and there is no output at all and nothing inserted:

        String instanceName = "instance";
        String zooServers = "localhost:2181";
        Instance instance = new ZooKeeperInstance(instanceName, zooServers);

        Connector connector = instance.getConnector("root", "secret");

        Text rowId = new Text("row1");
        Text colFam = new Text("myColFam");
        Text colQual = new Text("myColQual");
        ColumnVisibility vis = new ColumnVisibility("public");
        long timestamp = System.currentTimeMillis();
        Value value = new Value("Hello World!".getBytes());

        Mutation mutation = new Mutation(rowId);
        mutation.put(colFam, colQual, vis, timestamp, value);

        BatchWriterConfig config = new BatchWriterConfig();
        long memBuf = 1000000L;
        long timeout = 1000L;
        int numThreads = 10;
        config.setMaxMemory(memBuf);
        config.setTimeout(timeout, TimeUnit.MILLISECONDS);
        config.setMaxWriteThreads(numThreads);

        BatchWriter writer = connector.createBatchWriter("table", config);

        writer.addMutation(mutation);

        writer.close();


Why isn't this working?

Thanks,
Mike

Mime
View raw message