I have a single node riak installed locally from deb. I have no other settings done other than the one that comes with installation.
// Write objects
Location myKey = new Location(new Namespace("cars", "dodge"), "viper");
BinaryValue text = BinaryValue.create("vroom");
RiakObject obj = new RiakObject()
.setContentType("text/plain")
.setValue(text);
StoreValue store = new StoreValue.Builder(myKey, obj).build();
client.execute(store);
// read objects
FetchValue fetch = new FetchValue.Builder(myKey).build();
FetchValue.Response response = client.execute(fetch);
RiakObject obj = response.getValue(RiakObject.class);
System.out.println(obj.getValue());
this code already exists in basho docs. The only change I did was removing
withOption(StoreOption.W, new Quorum(3)) and withOption(FetchOption.R, new Quorum(3))
because the new client for basho does not take it.
I see that for the first time from a standalone program I am able to write and read but when I read for the second time I don't see the value. Am I missing some configuration ?