accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [1/2] accumulo git commit: ACCUMULO-4483 Added another test case
Date Wed, 12 Oct 2016 00:42:52 GMT
Repository: accumulo
Updated Branches:
  refs/heads/master 551fa0954 -> 016ea6780


ACCUMULO-4483 Added another test case

This forces the exception by reseeking the in memory map
iterator to the same location after forcing a switch.


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/83fe980f
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/83fe980f
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/83fe980f

Branch: refs/heads/master
Commit: 83fe980f43864a951f5aa5222ab7428a0d4853ae
Parents: 69ca25f
Author: Ivan Bella <ivan@bella.name>
Authored: Tue Oct 11 20:20:10 2016 -0400
Committer: Drew Farris <drew@apache.org>
Committed: Tue Oct 11 20:40:33 2016 -0400

----------------------------------------------------------------------
 .../accumulo/tserver/InMemoryMapTest.java       | 26 ++++++++++++++++++++
 1 file changed, 26 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/83fe980f/server/tserver/src/test/java/org/apache/accumulo/tserver/InMemoryMapTest.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/InMemoryMapTest.java
b/server/tserver/src/test/java/org/apache/accumulo/tserver/InMemoryMapTest.java
index 59dc68e..f813d42 100644
--- a/server/tserver/src/test/java/org/apache/accumulo/tserver/InMemoryMapTest.java
+++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/InMemoryMapTest.java
@@ -141,6 +141,13 @@ public class InMemoryMapTest {
 
   }
 
+  static void aeNoNext(SortedKeyValueIterator<Key,Value> dc, String row, String column,
int ts, String val) throws IOException {
+    assertTrue(dc.hasTop());
+    assertEquals(nk(row, column, ts), dc.getTopKey());
+    assertEquals(new Value(val.getBytes()), dc.getTopValue());
+
+  }
+
   static Set<ByteSequence> newCFSet(String... cfs) {
     HashSet<ByteSequence> cfSet = new HashSet<>();
     for (String cf : cfs) {
@@ -248,6 +255,25 @@ public class InMemoryMapTest {
   }
 
   @Test
+  public void testDecodeValueModification() throws Exception {
+    // This test case is the fix for ACCUMULO-4483
+    InMemoryMap imm = newInMemoryMap(false, tempFolder.newFolder().getAbsolutePath());
+
+    mutate(imm, "r1", "foo:cq1", 3, "");
+    MemoryIterator ski1 = imm.skvIterator(null);
+
+    imm.delete(0);
+
+    ski1.seek(new Range(new Text("r1")), LocalityGroupUtil.EMPTY_CF_SET, false);
+    aeNoNext(ski1, "r1", "foo:cq1", 3, "");
+    ski1.seek(new Range(new Text("r1")), LocalityGroupUtil.EMPTY_CF_SET, false);
+    ae(ski1, "r1", "foo:cq1", 3, "");
+    assertFalse(ski1.hasTop());
+
+    ski1.close();
+  }
+
+  @Test
   public void test5() throws Exception {
     InMemoryMap imm = newInMemoryMap(false, tempFolder.newFolder().getAbsolutePath());
 


Mime
View raw message