Details
Description
Apparently HRegion.binaryIncrement() assumes argument 'amount' is always positive. It would be nice to support decrement operation. In my application, a counter can go both up and down.
Quick fix is
public byte [] binaryIncrement(byte [] value, long amount)
{ return Bytes.toBytes(Bytes.toLong(value) + amount); }
but it is 2x~3x slower than current implementation for small positive 'amount' value. I have not yet found a good implementation to support negative 'amount' argument, AND match the speed of current implementation. Anyway, I just want to throw this out there and see if anybody is interested in negative 'amount' support.