accumulo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Korb, Michael [USA]" <>
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: 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.setTimeout(timeout, TimeUnit.MILLISECONDS);

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



Why isn't this working?


View raw message