Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Accumulo >> mail # user >> writing to more than one table


Copy link to this message
-
Re: writing to more than one table
There is indeed. As of 1.4, maybe earlier there is a class called MultiTableBatchWriter.

I believe the usage is as follows.

One obtains one via calling:

MultiTableBatchWriter mtbw = conn.createMultiTableBatchWriter(long maxMemory, long maxLatency, int maxWriteThreads)

on a Connector object.

Then obtain BatchWriters for your various tables

BatchWriter bw1 = mtbw.getBatchWriter("table1");
BatchWriter bw2 = mtbw.getBatchWriter("table2");

When done, one closes the MultiTableBatchWriter

mtbw.close()

On Feb 8, 2012, at 8:30 AM, Benson Margulies wrote:

> I've sketched code that creates rows in two tables at the same time.
> So I've got two batch writers, and presumably I need to divide my
> threads amongst them. Is there something I'm missing here; like some
> other variation on the writer classes that is more suited to multiple
> tables?