I suggest this should be one of common cases but probably I use wrong keywords when googling around.
I just need to create new table record with completely random key. Assume I obtained key with good randomness (almost random). However I can't be 100% sure no row yet exists. So what I need to do atomically:
- Having row key check no row exists yet.
- Reject operation if row exists.
- Create row if it does not exit.
Most useful piece of information I found on this topic is article about HBase row locks. I see HBase row locks as suitable solution but I'd like to do it better way without explicit row locking.
- ICV looks not suitable because I really do want key to be random.
- CAS would be great if they could work on 'row does not exists' condition but it looks they can't.
- Explicit row locks have disadvantages like issues on region split.
Could somebody please add useful advice? Preferable API is Java based but actually it is more about concept rather than implementation.