title: Are HBase Batch Operations Atomic?
body: <pre><code>// Create a list of Puts, and save in HBase via HTable's batch method
  HTable table = new HTable(HBaseConfiguration.create(), 'table_name');
  List&lt;Row&gt; actions = new ArrayList&lt;Row&gt;();
  actions.add(put1); //rowkey = 'abc'
  actions.add(put2); //rowkey = 'def'
  actions.add(put3); //rowkey = 'ghi'
  Object[] results = table.batch(actions);
  </code></pre>
  
  <p>Is it possible that this snippit could result in at least one, but not all, of the puts failing to to save to HBase? In other words, is <code>batch</code> guarenteed to happen atomically, where either all the <code>puts</code> are saved, or none of them all?</p>
  
  <p>If <code>batch</code> cannot guarantee this, how can we identify which of the puts succeeded and which failed? Or, can we at least identify that something failed, which would tell us to go delete all the rows we tried to save in order to roll them back?</p>
  
  <p>When I cast the results to <code>Result</code> and print them out, it returns <code>keyvalues=NONE</code>, but I can see that my puts succeeded.</p>