hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Billy Pearson" <sa...@pearsonwholesale.com>
Subject Re: Low-cost and fast HTable.exists(...)?
Date Sun, 09 Nov 2008 22:48:37 GMT
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" <lars@worldlingo.com> wrote in 
message news:4916F67B.5080300@worldlingo.com...
> 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
View raw message