* @throws CellExtractorException if an error occurs in the DBItemTransformer
*/
public <C> ImmutableList<Mutation> write(Iterable<CellGroup<C>> groups,
Parameters params,
DBItemTransformer<Mutation,C> transformer) throws CellExtractorException {
AccumuloParameters parameters = AccumuloParameterOps.checkParamType(params);
Connector connector = AccumuloParameterOps.getConnectorFromParameters(instance, parameters);
try {
BatchWriter writer = connector.createBatchWriter(parameters.getTableName(),
parameters.getMaxWriteMemory(),
parameters.getMaxWriteLatency(),
parameters.getMaxWriteThreads());
ImmutableList<Mutation> items = baseWriter.write(groups, parameters, transformer);
writer.addMutations(items);
writer.close();
return items;
} catch (NoSuchElementException e){
throw new IllegalArgumentException("Missing table name in parameters");
} catch (TableNotFoundException e) {
throw new IllegalArgumentException("Table not found during read: " + parameters.getTableName(),e);
} catch (MutationsRejectedException e) {
throw new CellExtractorException("Accumulo mutations were rejected", e, ErrorType.REJECTED_WRITE);
}
}