helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l...@apache.org
Subject [18/38] helix git commit: Add reset() method to MockParticipantManager to allow reuse of the participant.
Date Wed, 08 Feb 2017 17:59:53 GMT
Add reset() method to MockParticipantManager to allow reuse of the participant.


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

Branch: refs/heads/helix-0.6.x
Commit: 24d7700c470adbf5b6ece8d212945ab68256d993
Parents: abecf2f
Author: Lei Xia <lxia@linkedin.com>
Authored: Fri Sep 9 15:58:46 2016 -0700
Committer: Lei Xia <lxia@linkedin.com>
Committed: Wed Feb 8 09:50:24 2017 -0800

----------------------------------------------------------------------
 .../integration/manager/MockParticipantManager.java | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/helix/blob/24d7700c/helix-core/src/test/java/org/apache/helix/integration/manager/MockParticipantManager.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/manager/MockParticipantManager.java
b/helix-core/src/test/java/org/apache/helix/integration/manager/MockParticipantManager.java
index 51dd19d..d1cbe81 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/manager/MockParticipantManager.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/manager/MockParticipantManager.java
@@ -38,9 +38,9 @@ import org.apache.log4j.Logger;
 public class MockParticipantManager extends ZKHelixManager implements Runnable, ZkTestManager
{
   private static Logger LOG = Logger.getLogger(MockParticipantManager.class);
 
-  private final CountDownLatch _startCountDown = new CountDownLatch(1);
-  private final CountDownLatch _stopCountDown = new CountDownLatch(1);
-  private final CountDownLatch _waitStopCompleteCountDown = new CountDownLatch(1);
+  private CountDownLatch _startCountDown = new CountDownLatch(1);
+  private CountDownLatch _stopCountDown = new CountDownLatch(1);
+  private CountDownLatch _waitStopCompleteCountDown = new CountDownLatch(1);
 
   private final MockMSModelFactory _msModelFactory = new MockMSModelFactory(null);
 
@@ -70,6 +70,16 @@ public class MockParticipantManager extends ZKHelixManager implements Runnable,
     }
   }
 
+  /**
+   * This method should be called before syncStart() called after syncStop()
+   */
+  public void reset() {
+    syncStop();
+    _startCountDown = new CountDownLatch(1);
+    _stopCountDown = new CountDownLatch(1);
+    _waitStopCompleteCountDown = new CountDownLatch(1);
+  }
+
   @Override
   public void run() {
     try {


Mime
View raw message