Command used to fetch a value from Riak.
Fetching an object from Riak is a simple matter of supplying a {@link com.basho.riak.client.query.Location}and executing the FetchValue operation.
Location loc = new Location("my_bucket").setKey("my_key"); FetchValue fv = new FetchValue.Builder(loc).build(); FetchValue.Response response = client.execute(fv); RiakObject obj = response.getValue(RiakObject.class);
All operations including FetchValue can called async as well.
... {@literal RiakFuture} future = client.execute(sv);... future.await(); if (future.isSuccess) { ... }
ORM features are also provided when retrieving the results from the response. By default, JSON serialization / deserializtion is used. For example, if the value stored in Riak was JSON and mapped to your class {@code MyPojo}:
... MyPojo mp = response.getValue(MyPojo.class); ...
@author Dave Rusek
@since 2.0
@see Response