Skip to content
Snippets Groups Projects
Commit 776ec892 authored by nygard_89's avatar nygard_89
Browse files

[riak] Changed FetchValue.Option in update() transaction function.

parent 122b5b59
No related branches found
No related tags found
No related merge requests found
......@@ -468,7 +468,7 @@ public final class RiakKVClient extends DB {
object.getIndexes().getIndex(LongIntIndex.named("key_int")).add(getKeyAsLong(key));
UpdateValue update = new UpdateValue.Builder(location)
.withFetchOption(FetchValue.Option.DELETED_VCLOCK, true)
.withFetchOption(FetchValue.Option.R, rvalue)
.withStoreOption(Option.W, wvalue)
.withUpdate(new UpdateEntity(object))
.build();
......@@ -479,6 +479,9 @@ public final class RiakKVClient extends DB {
// For some reason, the update transaction doesn't throw any exception when no cluster has been started, so one
// needs to check whether it was done or not. When calling the wasUpdated() function with no nodes available, a
// NullPointerException is thrown.
// Moreover, such exception could be thrown when more threads are trying to update the same key or, more
// generally, when the system is being queried by many clients (i.e. overloaded). This is a known limitation of
// Riak KV's strong consistency implementation.
future.get(transactionTimeLimit, TimeUnit.SECONDS).wasUpdated();
} catch (TimeoutException e) {
if (debug) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment