From 5f5cdbbdfb0446f0d6b43c475329f2ddeb435404 Mon Sep 17 00:00:00 2001 From: Christopher Frieler Date: Tue, 22 Mar 2016 22:19:10 +0100 Subject: [PATCH 1/2] CLIENTS-803: Added KvResponseBase#getLocation(). --- .../basho/riak/client/api/commands/kv/KvResponseBase.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/basho/riak/client/api/commands/kv/KvResponseBase.java b/src/main/java/com/basho/riak/client/api/commands/kv/KvResponseBase.java index a2998ce98..d57adcca6 100644 --- a/src/main/java/com/basho/riak/client/api/commands/kv/KvResponseBase.java +++ b/src/main/java/com/basho/riak/client/api/commands/kv/KvResponseBase.java @@ -47,6 +47,14 @@ protected KvResponseBase(Init builder) this.values = builder.values; } + /** + * Returns the {@link Location} affected by the operation that resulted in this response. + * @return the affected {@link Location} + */ + public Location getLocation() { + return location; + } + /** * Determine if this response contains any returned values. * @return true if values are present, false otherwise. From 328b6cb52df0dc38e6aea9372f53c8926a7189b0 Mon Sep 17 00:00:00 2001 From: Alex Moore Date: Tue, 19 Jul 2016 15:13:10 -0400 Subject: [PATCH 2/2] Add test for KVResponseBase:getLocation() --- .../basho/riak/client/api/commands/itest/ITestFetchValue.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/java/com/basho/riak/client/api/commands/itest/ITestFetchValue.java b/src/test/java/com/basho/riak/client/api/commands/itest/ITestFetchValue.java index 992a5fd29..deebefdac 100644 --- a/src/test/java/com/basho/riak/client/api/commands/itest/ITestFetchValue.java +++ b/src/test/java/com/basho/riak/client/api/commands/itest/ITestFetchValue.java @@ -229,6 +229,8 @@ private void resolveSiblings(Namespace ns, ConflictResolver resolver) thro assertEquals(pojo.value, fResp.getValues(converter).get(0).value); assertEquals(pojo.value, fResp.getValue(converter, resolver).value); assertEquals(pojo.value, fResp.getValue(pojoTypeRef).value); + + assertEquals(loc, fResp.getLocation()); } private Pojo storeSiblings(Location loc) throws ExecutionException, InterruptedException