Package org.apache.accumulo.core.client
Interface BatchWriter
- All Superinterfaces:
- AutoCloseable
Send Mutations to a single Table in Accumulo.
 
When the user uses a client to create a BatchWriter, they specify how much memory and how many threads it should use. As the user adds mutations to the batch writer, it buffers them. Once the buffered mutations have used half of the user specified buffer, the mutations are dumped into the background to be written by a thread pool. If the user specified memory completely fills up, then writes are held. When a user calls flush, it does not return until all buffered mutations are written.
In the event that an MutationsRejectedException exception is thrown by one of the methods on a BatchWriter instance, the user should close the current instance and create a new instance.
- 
Method SummaryModifier and TypeMethodDescriptionvoidQueues one mutation to write.voidaddMutations(Iterable<Mutation> iterable) Queues several mutations to write.voidclose()Flush and release any resources.voidflush()Send any buffered mutations to Accumulo immediately.
- 
Method Details- 
addMutationQueues one mutation to write.- Parameters:
- m- the mutation to add
- Throws:
- MutationsRejectedException- this could be thrown because current or previous mutations failed
 
- 
addMutationsQueues several mutations to write.- Parameters:
- iterable- allows adding any number of mutations iteratively
- Throws:
- MutationsRejectedException- this could be thrown because current or previous mutations failed
 
- 
flushSend any buffered mutations to Accumulo immediately.- Throws:
- MutationsRejectedException- this could be thrown because current or previous mutations failed
 
- 
closeFlush and release any resources.- Specified by:
- closein interface- AutoCloseable
- Throws:
- MutationsRejectedException- this could be thrown because current or previous mutations failed
 
 
-