Index: src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java =================================================================== --- src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java (revision 1088679) +++ src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java (working copy) @@ -3942,6 +3942,53 @@ assertIncrementKey(kvs[3], ROW, FAMILY, QUALIFIERS[3], 5); assertIncrementKey(kvs[4], ROW, FAMILY, QUALIFIERS[4], 1); + + //Test HBase-3725 + + // Flush current data - we could just flush the table if the call were + // synchronous but for now restart the cluster + TEST_UTIL.shutdownMiniHBaseCluster(); + TEST_UTIL.restartHBaseCluster(3); + + ht.close(); + ht = new HTable(TABLENAME); + + // Delete some - not deleting QUALIFIERS[0] for a control + Delete del = new Delete(ROW); + del.deleteColumn(FAMILY, QUALIFIERS[1]); + del.deleteColumn(FAMILY, QUALIFIERS[2]); + del.deleteColumn(FAMILY, QUALIFIERS[3]); + del.deleteColumn(FAMILY, QUALIFIERS[4]); + ht.delete(del); + + // Increment them again + + // First with old API + ht.incrementColumnValue(ROW, FAMILY, QUALIFIERS[0], 4); + ht.incrementColumnValue(ROW, FAMILY, QUALIFIERS[1], 3); + ht.incrementColumnValue(ROW, FAMILY, QUALIFIERS[2], 2); + ht.incrementColumnValue(ROW, FAMILY, QUALIFIERS[3], 1); + + // Now increment things incremented with old and do some new + inc = new Increment(ROW); + inc.addColumn(FAMILY, QUALIFIERS[0], 1); + inc.addColumn(FAMILY, QUALIFIERS[2], 1); + inc.addColumn(FAMILY, QUALIFIERS[3], 1); + inc.addColumn(FAMILY, QUALIFIERS[4], 1); + ht.increment(inc); + + + // Verify expected results + r = ht.get(new Get(ROW)); + kvs = r.raw(); + assertEquals(5, kvs.length); + assertIncrementKey(kvs[0], ROW, FAMILY, QUALIFIERS[0], 6); + assertIncrementKey(kvs[1], ROW, FAMILY, QUALIFIERS[1], 3); + assertIncrementKey(kvs[2], ROW, FAMILY, QUALIFIERS[2], 3); + assertIncrementKey(kvs[3], ROW, FAMILY, QUALIFIERS[3], 2); + assertIncrementKey(kvs[4], ROW, FAMILY, QUALIFIERS[4], 1); + + // Now try multiple columns by different amounts inc = new Increment(ROWS[0]); for (int i=0;i