We have an open issue for stuff similar to this
Atomic increment operations
https://issues.apache.org/jira/browse/HBASE-803
either that or use something like
memcache or scan the table.

Billy


"Lars George" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
Hi,

I was wondering if there is a low cost (as in memory) and fast way to
check if a certain cell already exists? I need to insert a cell, but
based on if it was there before or not increase a counter (as in total
number of entries in a table). I see that HTable.get(...) returns the
byte array, means there are memory, reading and network streaming
involved. So if I do a

if (table.get(row, col) == null) { incr(counter); }
table.put(...);

this seems like a waste of resources and may not be as fast as a true

if (!table.exists(row, col))  { incr(counter); }
table.put(...)

It looks like this is easily doable since get() also delegates to the
region servers.

Am I missing something? Assuming HTable is sort of a Set implementation
I am confused as to way this check is missing.

Please advise.

Lars




Reply via email to