Hi Ukyo,

The Java client is … sort of complicated at the moment :) It's got a high level 
interface (IRiakClient) built on a "translation" level interface (RawClient) 
that then has the two separate, original clients under it (HTTP and Protocol 
buffers). 

At the highest level (IRiakClient)  … there isn't support for it. I suspect the 
reason for this is because Protocol Buffers doesn't support it, therefore we 
didn't want people to get unexpected results. 

At the RawClient level, however, it is supported and if you're using HTTP it 
will only do a HEAD and return the metadata (the headers) … unless there are 
siblings. If there are siblings (HEAD returns a 300 response) the client will 
then do a full fetch and return them. 

You can use the RawClient interface directly by instantiating and using a 
HTTPClientAdapter[1] rather than getting an IRiakClient instance from the 
RiakFactory. If you absolutely want this functionality that's the way to go. 

Thanks,
Brian Roach

[1] 
http://basho.github.com/riak-java-client/1.0.5/com/basho/riak/client/raw/http/HTTPClientAdapter.html


On Jul 28, 2012, at 10: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


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

Reply via email to