You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by bu...@apache.org on 2014/03/27 17:59:09 UTC

[1/6] git commit: ACCUMULO-2544: Fix match boundaries for MockTableOperations.deleteRows to be consistent with actual accumulo instance

Repository: accumulo
Updated Branches:
  refs/heads/1.5.2-SNAPSHOT 72c9af4c6 -> 7ec60f1bc
  refs/heads/1.6.0-SNAPSHOT 5d030cae9 -> a8572fe57
  refs/heads/master 8485134d7 -> 2849cbd8e


ACCUMULO-2544: Fix match boundaries for MockTableOperations.deleteRows to be consistent with actual accumulo instance

Signed-off-by: Sean Busbey <bu...@cloudera.com>


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

Branch: refs/heads/1.5.2-SNAPSHOT
Commit: 7ec60f1bcac4c274653d2779f1996138f3a275b7
Parents: 72c9af4
Author: Michael Fagan <mf...@arcus-research.com>
Authored: Tue Mar 25 14:58:37 2014 -0600
Committer: Sean Busbey <bu...@cloudera.com>
Committed: Thu Mar 27 11:42:39 2014 -0500

----------------------------------------------------------------------
 .../accumulo/core/client/mock/MockTableOperations.java  | 12 ++++++++----
 .../core/client/mock/MockTableOperationsTest.java       |  6 +++++-
 2 files changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec60f1b/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java b/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java
index f088b1f..dc4a619 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java
@@ -55,9 +55,9 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.Text;
 
 public class MockTableOperations extends TableOperationsHelper {
-
-  final private MockAccumulo acu;
-  final private String username;
+  private static final byte[] ZERO = {0};
+  private final MockAccumulo acu;
+  private final String username;
 
   MockTableOperations(MockAccumulo acu, String username) {
     this.acu = acu;
@@ -314,7 +314,11 @@ public class MockTableOperations extends TableOperationsHelper {
     if (!exists(tableName))
       throw new TableNotFoundException(tableName, tableName, "");
     MockTable t = acu.tables.get(tableName);
-    Set<Key> keep = new TreeSet<Key>(t.table.tailMap(new Key(start)).headMap(new Key(end)).keySet());
+    Text startText = new Text(start);
+    Text endText = new Text(end);
+    startText.append(ZERO, 0, 1);
+    endText.append(ZERO, 0, 1);
+    Set<Key> keep = new TreeSet<Key>(t.table.subMap(new Key(startText), new Key(endText)).keySet());
     t.table.keySet().removeAll(keep);
   }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec60f1b/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java b/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java
index da361b0..e377884 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java
@@ -267,9 +267,13 @@ public class MockTableOperationsTest {
     bw.flush();
     to.deleteRows("test", new Text("1"), new Text("2"));
     Scanner s = connector.createScanner("test", Constants.NO_AUTHS);
+    int oneCnt = 0;
     for (Entry<Key,Value> entry : s) {
-      Assert.assertTrue(entry.getKey().getRow().toString().charAt(0) != '1');
+      char rowStart = entry.getKey().getRow().toString().charAt(0);
+      Assert.assertTrue(rowStart != '2');
+      oneCnt += rowStart == '1' ? 1 : 0;
     }
+    Assert.assertEquals(5, oneCnt);
   }
   
 }


[4/6] git commit: Merge branch '1.5.2-SNAPSHOT' into 1.6.0-SNAPSHOT

Posted by bu...@apache.org.
Merge branch '1.5.2-SNAPSHOT' into 1.6.0-SNAPSHOT

Conflicts:
	core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java


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

Branch: refs/heads/master
Commit: a8572fe57690831b29b724c67f162857e9297577
Parents: 5d030ca 7ec60f1
Author: Sean Busbey <bu...@cloudera.com>
Authored: Thu Mar 27 11:51:45 2014 -0500
Committer: Sean Busbey <bu...@cloudera.com>
Committed: Thu Mar 27 11:51:45 2014 -0500

----------------------------------------------------------------------
 .../accumulo/core/client/mock/MockTableOperations.java  | 12 ++++++++----
 .../core/client/mock/MockTableOperationsTest.java       |  6 +++++-
 2 files changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/a8572fe5/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a8572fe5/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java
----------------------------------------------------------------------
diff --cc core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java
index 216b3ba,e377884..94dbed1
--- a/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java
@@@ -266,10 -266,14 +266,14 @@@ public class MockTableOperationsTest 
      }
      bw.flush();
      to.deleteRows("test", new Text("1"), new Text("2"));
 -    Scanner s = connector.createScanner("test", Constants.NO_AUTHS);
 +    Scanner s = connector.createScanner("test", Authorizations.EMPTY);
+     int oneCnt = 0;
      for (Entry<Key,Value> entry : s) {
-       Assert.assertTrue(entry.getKey().getRow().toString().charAt(0) != '1');
+       char rowStart = entry.getKey().getRow().toString().charAt(0);
+       Assert.assertTrue(rowStart != '2');
+       oneCnt += rowStart == '1' ? 1 : 0;
      }
+     Assert.assertEquals(5, oneCnt);
    }
 -  
 +
  }


[6/6] git commit: Merge branch '1.6.0-SNAPSHOT'

Posted by bu...@apache.org.
Merge branch '1.6.0-SNAPSHOT'


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

Branch: refs/heads/master
Commit: 2849cbd8e25f87691788c6cee8bbea0ffa2155fb
Parents: 8485134 a8572fe
Author: Sean Busbey <bu...@cloudera.com>
Authored: Thu Mar 27 11:58:19 2014 -0500
Committer: Sean Busbey <bu...@cloudera.com>
Committed: Thu Mar 27 11:58:19 2014 -0500

----------------------------------------------------------------------
 .../accumulo/core/client/mock/MockTableOperations.java  | 12 ++++++++----
 .../core/client/mock/MockTableOperationsTest.java       |  6 +++++-
 2 files changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------



[2/6] git commit: ACCUMULO-2544: Fix match boundaries for MockTableOperations.deleteRows to be consistent with actual accumulo instance

Posted by bu...@apache.org.
ACCUMULO-2544: Fix match boundaries for MockTableOperations.deleteRows to be consistent with actual accumulo instance

Signed-off-by: Sean Busbey <bu...@cloudera.com>


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

Branch: refs/heads/1.6.0-SNAPSHOT
Commit: 7ec60f1bcac4c274653d2779f1996138f3a275b7
Parents: 72c9af4
Author: Michael Fagan <mf...@arcus-research.com>
Authored: Tue Mar 25 14:58:37 2014 -0600
Committer: Sean Busbey <bu...@cloudera.com>
Committed: Thu Mar 27 11:42:39 2014 -0500

----------------------------------------------------------------------
 .../accumulo/core/client/mock/MockTableOperations.java  | 12 ++++++++----
 .../core/client/mock/MockTableOperationsTest.java       |  6 +++++-
 2 files changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec60f1b/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java b/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java
index f088b1f..dc4a619 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java
@@ -55,9 +55,9 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.Text;
 
 public class MockTableOperations extends TableOperationsHelper {
-
-  final private MockAccumulo acu;
-  final private String username;
+  private static final byte[] ZERO = {0};
+  private final MockAccumulo acu;
+  private final String username;
 
   MockTableOperations(MockAccumulo acu, String username) {
     this.acu = acu;
@@ -314,7 +314,11 @@ public class MockTableOperations extends TableOperationsHelper {
     if (!exists(tableName))
       throw new TableNotFoundException(tableName, tableName, "");
     MockTable t = acu.tables.get(tableName);
-    Set<Key> keep = new TreeSet<Key>(t.table.tailMap(new Key(start)).headMap(new Key(end)).keySet());
+    Text startText = new Text(start);
+    Text endText = new Text(end);
+    startText.append(ZERO, 0, 1);
+    endText.append(ZERO, 0, 1);
+    Set<Key> keep = new TreeSet<Key>(t.table.subMap(new Key(startText), new Key(endText)).keySet());
     t.table.keySet().removeAll(keep);
   }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec60f1b/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java b/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java
index da361b0..e377884 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java
@@ -267,9 +267,13 @@ public class MockTableOperationsTest {
     bw.flush();
     to.deleteRows("test", new Text("1"), new Text("2"));
     Scanner s = connector.createScanner("test", Constants.NO_AUTHS);
+    int oneCnt = 0;
     for (Entry<Key,Value> entry : s) {
-      Assert.assertTrue(entry.getKey().getRow().toString().charAt(0) != '1');
+      char rowStart = entry.getKey().getRow().toString().charAt(0);
+      Assert.assertTrue(rowStart != '2');
+      oneCnt += rowStart == '1' ? 1 : 0;
     }
+    Assert.assertEquals(5, oneCnt);
   }
   
 }


[3/6] git commit: ACCUMULO-2544: Fix match boundaries for MockTableOperations.deleteRows to be consistent with actual accumulo instance

Posted by bu...@apache.org.
ACCUMULO-2544: Fix match boundaries for MockTableOperations.deleteRows to be consistent with actual accumulo instance

Signed-off-by: Sean Busbey <bu...@cloudera.com>


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

Branch: refs/heads/master
Commit: 7ec60f1bcac4c274653d2779f1996138f3a275b7
Parents: 72c9af4
Author: Michael Fagan <mf...@arcus-research.com>
Authored: Tue Mar 25 14:58:37 2014 -0600
Committer: Sean Busbey <bu...@cloudera.com>
Committed: Thu Mar 27 11:42:39 2014 -0500

----------------------------------------------------------------------
 .../accumulo/core/client/mock/MockTableOperations.java  | 12 ++++++++----
 .../core/client/mock/MockTableOperationsTest.java       |  6 +++++-
 2 files changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec60f1b/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java b/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java
index f088b1f..dc4a619 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java
@@ -55,9 +55,9 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.Text;
 
 public class MockTableOperations extends TableOperationsHelper {
-
-  final private MockAccumulo acu;
-  final private String username;
+  private static final byte[] ZERO = {0};
+  private final MockAccumulo acu;
+  private final String username;
 
   MockTableOperations(MockAccumulo acu, String username) {
     this.acu = acu;
@@ -314,7 +314,11 @@ public class MockTableOperations extends TableOperationsHelper {
     if (!exists(tableName))
       throw new TableNotFoundException(tableName, tableName, "");
     MockTable t = acu.tables.get(tableName);
-    Set<Key> keep = new TreeSet<Key>(t.table.tailMap(new Key(start)).headMap(new Key(end)).keySet());
+    Text startText = new Text(start);
+    Text endText = new Text(end);
+    startText.append(ZERO, 0, 1);
+    endText.append(ZERO, 0, 1);
+    Set<Key> keep = new TreeSet<Key>(t.table.subMap(new Key(startText), new Key(endText)).keySet());
     t.table.keySet().removeAll(keep);
   }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec60f1b/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java b/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java
index da361b0..e377884 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java
@@ -267,9 +267,13 @@ public class MockTableOperationsTest {
     bw.flush();
     to.deleteRows("test", new Text("1"), new Text("2"));
     Scanner s = connector.createScanner("test", Constants.NO_AUTHS);
+    int oneCnt = 0;
     for (Entry<Key,Value> entry : s) {
-      Assert.assertTrue(entry.getKey().getRow().toString().charAt(0) != '1');
+      char rowStart = entry.getKey().getRow().toString().charAt(0);
+      Assert.assertTrue(rowStart != '2');
+      oneCnt += rowStart == '1' ? 1 : 0;
     }
+    Assert.assertEquals(5, oneCnt);
   }
   
 }


[5/6] git commit: Merge branch '1.5.2-SNAPSHOT' into 1.6.0-SNAPSHOT

Posted by bu...@apache.org.
Merge branch '1.5.2-SNAPSHOT' into 1.6.0-SNAPSHOT

Conflicts:
	core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java


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

Branch: refs/heads/1.6.0-SNAPSHOT
Commit: a8572fe57690831b29b724c67f162857e9297577
Parents: 5d030ca 7ec60f1
Author: Sean Busbey <bu...@cloudera.com>
Authored: Thu Mar 27 11:51:45 2014 -0500
Committer: Sean Busbey <bu...@cloudera.com>
Committed: Thu Mar 27 11:51:45 2014 -0500

----------------------------------------------------------------------
 .../accumulo/core/client/mock/MockTableOperations.java  | 12 ++++++++----
 .../core/client/mock/MockTableOperationsTest.java       |  6 +++++-
 2 files changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/a8572fe5/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a8572fe5/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java
----------------------------------------------------------------------
diff --cc core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java
index 216b3ba,e377884..94dbed1
--- a/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java
@@@ -266,10 -266,14 +266,14 @@@ public class MockTableOperationsTest 
      }
      bw.flush();
      to.deleteRows("test", new Text("1"), new Text("2"));
 -    Scanner s = connector.createScanner("test", Constants.NO_AUTHS);
 +    Scanner s = connector.createScanner("test", Authorizations.EMPTY);
+     int oneCnt = 0;
      for (Entry<Key,Value> entry : s) {
-       Assert.assertTrue(entry.getKey().getRow().toString().charAt(0) != '1');
+       char rowStart = entry.getKey().getRow().toString().charAt(0);
+       Assert.assertTrue(rowStart != '2');
+       oneCnt += rowStart == '1' ? 1 : 0;
      }
+     Assert.assertEquals(5, oneCnt);
    }
 -  
 +
  }