The client might not support that, I don't know. I know the Python client (at 
least the version I'm using) also does a full GET of the object.

Here's the kicker though, I'm using LevelDB for the backend and LevelDB is 
notorious for having poor read performance when you're trying to GET a key that 
doesn't exist (checking for existence). So, don't do it if you're using LevelDB.

Bitcask is another story though, since all the keys are in memory so that 
lookup is constant time (I believe, unless your key space is going into swap, 
but that shouldn't happen).

On Jul 28, 2012, at 11:44 AM, Ukyo Virgden wrote:

> Hi, 
> 
> Just installed riak and trying to get adjusted. Having looked at the java 
> client, I could not tell if there' a way to check key exixtence. What I need 
> to do is to check if a key exists and put it if it doesn't.  In HTTP request 
> from curl, a HEAD request instead of a GET gives the result I need. 
> 
> How can I check the existence of a key from java client without making a full 
> fetch?
> 
> Thanks.
> _______________________________________________
> riak-users mailing list
> riak-users@lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to