hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lars George <l...@worldlingo.com>
Subject Low-cost and fast HTable.exists(...)?
Date Sun, 09 Nov 2008 14:40:59 GMT
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


Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message