HBASE-13202 Procedure v2 - core framework (addendum)
This commit is contained in:
parent
60c30c707c
commit
a8432fbd5a
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue