org.apache.accumulo.core.client.impl
Class BatchWriterImpl

java.lang.Object
  extended by org.apache.accumulo.core.client.impl.BatchWriterImpl
All Implemented Interfaces:
BatchWriter

public class BatchWriterImpl
extends java.lang.Object
implements BatchWriter


Constructor Summary
BatchWriterImpl(Instance instance, AuthInfo credentials, java.lang.String table, long maxMemory, long maxLatency, int maxWriteThreads)
           
 
Method Summary
 void addMutation(Mutation m)
          Queues one mutation to write
 void addMutations(java.lang.Iterable<Mutation> iterable)
          Queues several mutations to write
 void close()
          Flush and release any resources.
 void flush()
          Send any buffered mutations to Accumulo immediately.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BatchWriterImpl

public BatchWriterImpl(Instance instance,
                       AuthInfo credentials,
                       java.lang.String table,
                       long maxMemory,
                       long maxLatency,
                       int maxWriteThreads)
Method Detail

addMutation

public void addMutation(Mutation m)
                 throws MutationsRejectedException
Description copied from interface: BatchWriter
Queues one mutation to write

Specified by:
addMutation in interface BatchWriter
Parameters:
m - the mutation to add
Throws:
MutationsRejectedException - this could be thrown because current or previous mutations failed

addMutations

public void addMutations(java.lang.Iterable<Mutation> iterable)
                  throws MutationsRejectedException
Description copied from interface: BatchWriter
Queues several mutations to write

Specified by:
addMutations in interface BatchWriter
Parameters:
iterable - allows adding any number of mutations iteratively
Throws:
MutationsRejectedException - this could be thrown because current or previous mutations failed

close

public void close()
           throws MutationsRejectedException
Description copied from interface: BatchWriter
Flush and release any resources.

Specified by:
close in interface BatchWriter
Throws:
MutationsRejectedException - this could be thrown because current or previous mutations failed

flush

public void flush()
           throws MutationsRejectedException
Description copied from interface: BatchWriter
Send any buffered mutations to Accumulo immediately.

Specified by:
flush in interface BatchWriter
Throws:
MutationsRejectedException - this could be thrown because current or previous mutations failed


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.