Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Minor fix for change to AdminClient

src/java/voldemort/client/protocol/admin/AdminClient.java
- do not close down AdminStoreClient from queryKeys

test/unit/voldemort/client/AdminServiceBasicTest.java
- added some additional checks to test to confirm (non)existence of exceptions&values
  • Loading branch information...
commit 96ed494c9f34d632ac8f4a2f0da20d0abeb17c8e 1 parent ad7ca98
@jayjwylie jayjwylie authored
View
2  src/java/voldemort/client/protocol/admin/AdminClient.java
@@ -2154,7 +2154,6 @@ public void updateEntries(int nodeId,
store = adminStoreClient.getSocketStore(nodeId, storeName);
} catch(Exception e) {
- AdminClient.this.close();
throw new VoldemortException(e);
}
@@ -2165,7 +2164,6 @@ public QueryKeyResult computeNext() {
ByteArray key;
List<Versioned<byte[]>> value = null;
if(!keys.hasNext()) {
- AdminClient.this.close();
return endOfData();
} else {
key = keys.next();
View
11 test/unit/voldemort/client/AdminServiceBasicTest.java
@@ -1437,6 +1437,8 @@ public void testQuery() {
entry = results.next();
assertFalse("There should not be more results", results.hasNext());
assertEquals("Not the right key", queryKeys.get(0), entry.getKey());
+ assertFalse("There should not be exception", entry.hasException());
+ assertTrue("There should be values", entry.hasValues());
assertNotNull("Response should be non-null", entry.getValues());
assertEquals("Value should be empty list", 0, entry.getValues().size());
assertNull("There should not be exception", entry.getException());
@@ -1449,6 +1451,8 @@ public void testQuery() {
entry = results.next();
assertFalse("There should not be more results", results.hasNext());
assertEquals("Not the right key", queryKeys.get(0), entry.getKey());
+ assertTrue("There should be exception", entry.hasException());
+ assertFalse("There should not be values", entry.hasValues());
assertNull("Value should be null", entry.getValues());
assertTrue("There should be InvalidMetadataException exception",
entry.getException() instanceof InvalidMetadataException);
@@ -1461,6 +1465,8 @@ public void testQuery() {
entry = results.next();
assertFalse("There should not be more results", results.hasNext());
assertEquals("Not the right key", queryKeys.get(0), entry.getKey());
+ assertTrue("There should be exception", entry.hasException());
+ assertFalse("There should not be values", entry.hasValues());
assertNull("Value should be null", entry.getValues());
assertTrue("There should be InvalidMetadataException exception",
entry.getException() instanceof InvalidMetadataException);
@@ -1473,9 +1479,10 @@ public void testQuery() {
assertTrue("Results should not be empty", results.hasNext());
entry = results.next();
assertFalse("There should not be more results", results.hasNext());
+ assertFalse("There should not be exception", entry.hasException());
+ assertTrue("There should be values", entry.hasValues());
assertEquals("Not the right key", queryKeys.get(0), entry.getKey());
assertEquals("Value should be empty list", 0, entry.getValues().size());
- assertNull("There should not be exception", entry.getException());
// test empty request
queryKeys = new ArrayList<ByteArray>();
@@ -1490,6 +1497,8 @@ public void testQuery() {
assertTrue("Results should not be empty", results.hasNext());
entry = results.next();
assertFalse("There should not be more results", results.hasNext());
+ assertTrue("There should be exception", entry.hasException());
+ assertFalse("There should not be values", entry.hasValues());
assertNull("Value should be null", entry.getValues());
assertTrue("There should be IllegalArgumentException exception",
entry.getException() instanceof IllegalArgumentException);
Please sign in to comment.
Something went wrong with that request. Please try again.