private void test2(String table, boolean doFlush) throws Exception {
// test sending multiple mutations with multiple constrain violations... all of the non violating mutations
// should go through
int numericErrors = 2;
BatchWriter bw = getConnector().createBatchWriter(table, new BatchWriterConfig());
bw.addMutation(newMut("r1", "cf1", "cq1", "123"));
bw.addMutation(newMut("r1", "cf1", "cq2", "I'm a bad value"));
if (doFlush) {
try {
bw.flush();
throw new Exception("Didn't find a bad mutation");
} catch (MutationsRejectedException mre) {
// ignored
try {
bw.close();
} catch (MutationsRejectedException ex) {
// ignored
}
bw = getConnector().createBatchWriter(table, new BatchWriterConfig());
numericErrors = 1;
}
}
bw.addMutation(newMut("r1", "cf1", "cq3", "I'm a naughty value"));
bw.addMutation(newMut("@bad row@", "cf1", "cq2", "456"));