hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mberto...@apache.org
Subject [5/8] hbase git commit: HBASE-13202 Procedure v2 - core framework (addendum)
Date Sat, 18 Apr 2015 09:16:37 GMT
HBASE-13202 Procedure v2 - core framework (addendum)


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

Branch: refs/heads/branch-1.1
Commit: 9deb84f23e79741a14c161d8d9ced70686bb52ac
Parents: 84bc73f
Author: Matteo Bertozzi <matteo.bertozzi@cloudera.com>
Authored: Sat Apr 18 09:36:30 2015 +0100
Committer: Matteo Bertozzi <matteo.bertozzi@cloudera.com>
Committed: Sat Apr 18 09:56:10 2015 +0100

----------------------------------------------------------------------
 .../procedure2/store/ProcedureStoreTracker.java |  3 ++-
 .../store/TestProcedureStoreTracker.java        | 21 ++++++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/9deb84f2/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.java
----------------------------------------------------------------------
diff --git a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.java
b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.java
index a4711f1..152f131 100644
--- a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.java
+++ b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/ProcedureStoreTracker.java
@@ -211,6 +211,7 @@ public class ProcedureStoreTracker {
         long newStart = alignDown(procId);
         delta = (int)(start - newStart) >> ADDRESS_BITS_PER_WORD;
         offset = delta;
+        start = newStart;
       } else {
         // Add to tail
         long newEnd = alignUp(procId + 1);
@@ -383,7 +384,7 @@ public class ProcedureStoreTracker {
   @InterfaceAudience.Private
   public void setDeleted(final long procId, final boolean isDeleted) {
     BitSetNode node = getOrCreateNode(procId);
-    assert node.contains(procId) : "expected procId in the node";
+    assert node.contains(procId) : "expected procId=" + procId + " in the node=" + node;
     node.updateState(procId, isDeleted);
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/9deb84f2/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/TestProcedureStoreTracker.java
----------------------------------------------------------------------
diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/TestProcedureStoreTracker.java
b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/TestProcedureStoreTracker.java
index 7424cfa..9475e67 100644
--- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/TestProcedureStoreTracker.java
+++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/TestProcedureStoreTracker.java
@@ -189,4 +189,25 @@ public class TestProcedureStoreTracker {
       tracker.clear();
     }
   }
+
+  @Test
+  public void testLoad() {
+    final int MAX_PROCS = 1000;
+    final ProcedureStoreTracker tracker = new ProcedureStoreTracker();
+    for (int numProcs = 1; numProcs < MAX_PROCS; ++numProcs) {
+      for (int start = 1; start <= numProcs; ++start) {
+        assertTrue(tracker.isEmpty());
+
+        LOG.debug("loading " + numProcs + " procs from start=" + start);
+        for (int i = start; i <= numProcs; ++i) {
+          tracker.setDeleted(i, false);
+        }
+        for (int i = 1; i < start; ++i) {
+          tracker.setDeleted(i, false);
+        }
+
+        tracker.clear();
+      }
+    }
+  }
 }


Mime
View raw message