From 8fd3fd0e9cc0e4bda6abc65f88dd95230e24a5e9 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Thu, 18 Oct 2018 20:03:57 -0700 Subject: [PATCH] Revert "HBASE-21323 Should not skip force updating for a sub procedure even if" This reverts commit 30727764a3f9c30c41eaae4340ee7ea9723c1306. Revert till we figure why behavior between 2.1 and 2.2 is different. --- .../store/wal/TestForceUpdateProcedure.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestForceUpdateProcedure.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestForceUpdateProcedure.java index bf5ce8374e9..eb68955f587 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestForceUpdateProcedure.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestForceUpdateProcedure.java @@ -24,8 +24,6 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; import java.util.concurrent.Exchanger; -import java.util.stream.Collectors; - import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseCommonTestingUtility; @@ -211,7 +209,7 @@ public class TestForceUpdateProcedure { EXEC.submitProcedure(new ParentProcedure()); EXCHANGER.exchange(Boolean.TRUE); UTIL.waitFor(10000, () -> EXEC.getActiveExecutorCount() == 0); - // The above operations are to make sure that we have persisted the states of the two + // The above operations are used to make sure that we have persist the states of the two // procedures. long procId = EXEC.submitProcedure(new ExchangeProcedure()); assertEquals(1, STORE.getActiveLogs().size()); @@ -238,13 +236,12 @@ public class TestForceUpdateProcedure { Map, Procedure> procMap = new HashMap<>(); EXEC.getProcedures().stream().filter(p -> !p.isFinished()) .forEach(p -> procMap.put(p.getClass(), p)); - StringBuffer sb = new StringBuffer(); - String mapAsStr = procMap.entrySet().stream().map(e -> e.getKey() + " " + e.getValue()). - collect(Collectors.joining(", ")); - assertEquals(mapAsStr, 2, procMap.size()); + assertEquals(3, procMap.size()); ParentProcedure parentProc = (ParentProcedure) procMap.get(ParentProcedure.class); assertEquals(ProcedureState.WAITING, parentProc.getState()); WaitingProcedure waitingProc = (WaitingProcedure) procMap.get(WaitingProcedure.class); assertEquals(ProcedureState.WAITING_TIMEOUT, waitingProc.getState()); + DummyProcedure dummyProc = (DummyProcedure) procMap.get(DummyProcedure.class); + assertEquals(ProcedureState.SUCCESS, dummyProc.getState()); } }