http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestDrop.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestDrop.java b/helix-core/src/test/java/org/apache/helix/integration/TestDrop.java
index ac20652..63b5666 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestDrop.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestDrop.java
@@ -30,10 +30,10 @@ import org.apache.helix.HelixDataAccessor;
import org.apache.helix.PropertyKey;
import org.apache.helix.TestHelper;
import org.apache.helix.HelixDefinedState;
+import org.apache.helix.manager.zk.MockParticipant;
+import org.apache.helix.manager.zk.MockController;
import org.apache.helix.manager.zk.ZKHelixAdmin;
import org.apache.helix.manager.zk.ZKHelixDataAccessor;
-import org.apache.helix.integration.manager.ClusterControllerManager;
-import org.apache.helix.integration.manager.MockParticipantManager;
import org.apache.helix.mock.participant.ErrTransition;
import org.apache.helix.model.CurrentState;
import org.apache.helix.model.ExternalView;
@@ -56,12 +56,12 @@ public class TestDrop extends ZkTestBase {
* @param participants
*/
private void assertEmptyCSandEV(String clusterName, String db,
- MockParticipantManager[] participants) {
+ MockParticipant[] participants) {
HelixDataAccessor accessor = new ZKHelixDataAccessor(clusterName, _baseAccessor);
PropertyKey.Builder keyBuilder = accessor.keyBuilder();
Assert.assertNull(accessor.getProperty(keyBuilder.externalView(db)));
- for (MockParticipantManager participant : participants) {
+ for (MockParticipant participant : participants) {
String instanceName = participant.getInstanceName();
String sessionId = participant.getSessionId();
Assert.assertNull(accessor.getProperty(keyBuilder.currentState(instanceName, sessionId, db)));
@@ -77,7 +77,7 @@ public class TestDrop extends ZkTestBase {
System.out.println("START " + clusterName + " at " + new Date(System.currentTimeMillis()));
- MockParticipantManager[] participants = new MockParticipantManager[n];
+ MockParticipant[] participants = new MockParticipant[n];
TestHelper.setupCluster(clusterName, _zkaddr, 12918, // participant port
"localhost", // participant name prefix
@@ -89,15 +89,15 @@ public class TestDrop extends ZkTestBase {
"MasterSlave", true); // do rebalance
// start controller
- ClusterControllerManager controller =
- new ClusterControllerManager(_zkaddr, clusterName, "controller");
+ MockController controller =
+ new MockController(_zkaddr, clusterName, "controller");
controller.syncStart();
// start participants
for (int i = 0; i < n; i++) {
String instanceName = "localhost_" + (12918 + i);
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
participants[i].syncStart();
}
@@ -132,7 +132,7 @@ public class TestDrop extends ZkTestBase {
System.out.println("START " + clusterName + " at " + new Date(System.currentTimeMillis()));
- MockParticipantManager[] participants = new MockParticipantManager[n];
+ MockParticipant[] participants = new MockParticipant[n];
TestHelper.setupCluster(clusterName, _zkaddr, 12918, // participant port
"localhost", // participant name prefix
@@ -144,8 +144,8 @@ public class TestDrop extends ZkTestBase {
"MasterSlave", true); // do rebalance
// start controller
- ClusterControllerManager controller =
- new ClusterControllerManager(_zkaddr, clusterName, "controller_0");
+ MockController controller =
+ new MockController(_zkaddr, clusterName, "controller_0");
controller.syncStart();
// start participants
@@ -157,10 +157,10 @@ public class TestDrop extends ZkTestBase {
String instanceName = "localhost_" + (12918 + i);
if (i == 0) {
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
participants[i].setTransition(new ErrTransition(errTransitions));
} else {
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
}
participants[i].syncStart();
}
@@ -206,7 +206,7 @@ public class TestDrop extends ZkTestBase {
System.out.println("START " + clusterName + " at " + new Date(System.currentTimeMillis()));
- MockParticipantManager[] participants = new MockParticipantManager[n];
+ MockParticipant[] participants = new MockParticipant[n];
TestHelper.setupCluster(clusterName, _zkaddr, 12918, // participant port
"localhost", // participant name prefix
@@ -218,8 +218,8 @@ public class TestDrop extends ZkTestBase {
"MasterSlave", true); // do rebalance
// start controller
- ClusterControllerManager controller =
- new ClusterControllerManager(_zkaddr, clusterName, "controller_0");
+ MockController controller =
+ new MockController(_zkaddr, clusterName, "controller_0");
controller.syncStart();
// start participants
@@ -231,10 +231,10 @@ public class TestDrop extends ZkTestBase {
String instanceName = "localhost_" + (12918 + i);
if (i == 0) {
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
participants[i].setTransition(new ErrTransition(errTransitions));
} else {
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
}
participants[i].syncStart();
}
@@ -314,7 +314,7 @@ public class TestDrop extends ZkTestBase {
System.out.println("START " + clusterName + " at " + new Date(System.currentTimeMillis()));
- MockParticipantManager[] participants = new MockParticipantManager[n];
+ MockParticipant[] participants = new MockParticipant[n];
TestHelper.setupCluster(clusterName, _zkaddr, 12918, // participant port
"localhost", // participant name prefix
@@ -340,8 +340,8 @@ public class TestDrop extends ZkTestBase {
accessor.setProperty(keyBuilder.idealStates("TestDB0"), isBuilder.build());
// start controller
- ClusterControllerManager controller =
- new ClusterControllerManager(_zkaddr, clusterName, "controller_0");
+ MockController controller =
+ new MockController(_zkaddr, clusterName, "controller_0");
controller.syncStart();
// start participants
@@ -352,10 +352,10 @@ public class TestDrop extends ZkTestBase {
String instanceName = "localhost_" + (12918 + i);
if (i == 0) {
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
participants[i].setTransition(new ErrTransition(errTransitions));
} else {
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
}
participants[i].syncStart();
}
@@ -400,7 +400,7 @@ public class TestDrop extends ZkTestBase {
System.out.println("START " + clusterName + " at " + new Date(System.currentTimeMillis()));
- MockParticipantManager[] participants = new MockParticipantManager[n];
+ MockParticipant[] participants = new MockParticipant[n];
TestHelper.setupCluster(clusterName, _zkaddr, 12918, // participant port
"localhost", // participant name prefix
@@ -412,15 +412,15 @@ public class TestDrop extends ZkTestBase {
"MasterSlave", true); // do rebalance
// start controller
- ClusterControllerManager controller =
- new ClusterControllerManager(_zkaddr, clusterName, "controller_0");
+ MockController controller =
+ new MockController(_zkaddr, clusterName, "controller_0");
controller.syncStart();
// start participants
for (int i = 0; i < n; i++) {
String instanceName = "localhost_" + (12918 + i);
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
participants[i].syncStart();
}
@@ -486,16 +486,16 @@ public class TestDrop extends ZkTestBase {
ZKHelixDataAccessor accessor = new ZKHelixDataAccessor(clusterName, _baseAccessor);
PropertyKey.Builder keyBuilder = accessor.keyBuilder();
- ClusterControllerManager controller =
- new ClusterControllerManager(_zkaddr, clusterName, "controller_0");
+ MockController controller =
+ new MockController(_zkaddr, clusterName, "controller_0");
controller.syncStart();
// start participants
- MockParticipantManager[] participants = new MockParticipantManager[n];
+ MockParticipant[] participants = new MockParticipant[n];
for (int i = 0; i < n; i++) {
String instanceName = "localhost_" + (12918 + i);
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
participants[i].syncStart();
}
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestDropResource.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestDropResource.java b/helix-core/src/test/java/org/apache/helix/integration/TestDropResource.java
index d4faf84..d661601 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestDropResource.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestDropResource.java
@@ -20,7 +20,7 @@ package org.apache.helix.integration;
*/
import org.apache.helix.TestHelper;
-import org.apache.helix.integration.manager.MockParticipantManager;
+import org.apache.helix.manager.zk.MockParticipant;
import org.apache.helix.tools.ClusterSetup;
import org.apache.helix.tools.ClusterStateVerifier;
import org.testng.Assert;
@@ -69,7 +69,7 @@ public class TestDropResource extends ZkStandAloneCMTestBase {
TestHelper.<String> setOf("localhost_12918", "localhost_12919",
/* "localhost_12920", */"localhost_12921", "localhost_12922"), _zkaddr);
- _participants[2] = new MockParticipantManager(_zkaddr, CLUSTER_NAME, hostToKill);
+ _participants[2] = new MockParticipant(_zkaddr, CLUSTER_NAME, hostToKill);
_participants[2].syncStart();
TestHelper.verifyWithTimeout("verifyEmptyCurStateAndExtView", 30 * 1000, CLUSTER_NAME, "MyDB2",
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestEnablePartitionDuringDisable.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestEnablePartitionDuringDisable.java b/helix-core/src/test/java/org/apache/helix/integration/TestEnablePartitionDuringDisable.java
index 83e3001..21a1be3 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestEnablePartitionDuringDisable.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestEnablePartitionDuringDisable.java
@@ -26,8 +26,8 @@ import org.apache.helix.NotificationContext;
import org.apache.helix.TestHelper;
import org.apache.helix.api.State;
import org.apache.helix.api.id.PartitionId;
-import org.apache.helix.integration.manager.ClusterControllerManager;
-import org.apache.helix.integration.manager.MockParticipantManager;
+import org.apache.helix.manager.zk.MockParticipant;
+import org.apache.helix.manager.zk.MockController;
import org.apache.helix.mock.participant.MockTransition;
import org.apache.helix.model.Message;
import org.apache.helix.testutil.ZkTestBase;
@@ -99,21 +99,21 @@ public class TestEnablePartitionDuringDisable extends ZkTestBase {
3, // replicas
"MasterSlave", true); // do rebalance
- ClusterControllerManager controller =
- new ClusterControllerManager(_zkaddr, clusterName, "controller_0");
+ MockController controller =
+ new MockController(_zkaddr, clusterName, "controller_0");
controller.syncStart();
// start participants
EnablePartitionTransition transition = new EnablePartitionTransition();
- MockParticipantManager[] participants = new MockParticipantManager[5];
+ MockParticipant[] participants = new MockParticipant[5];
for (int i = 0; i < 5; i++) {
String instanceName = "localhost_" + (12918 + i);
if (instanceName.equals("localhost_12919")) {
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
participants[i].setTransition(transition);
} else {
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
}
participants[i].syncStart();
}
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestEntropyFreeNodeBounce.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestEntropyFreeNodeBounce.java b/helix-core/src/test/java/org/apache/helix/integration/TestEntropyFreeNodeBounce.java
index 4119fc6..09fe1e4 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestEntropyFreeNodeBounce.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestEntropyFreeNodeBounce.java
@@ -28,11 +28,10 @@ import org.apache.helix.InstanceType;
import org.apache.helix.PropertyKey;
import org.apache.helix.TestHelper;
import org.apache.helix.api.id.StateModelDefId;
-import org.apache.helix.integration.manager.ClusterControllerManager;
+import org.apache.helix.manager.zk.MockController;
import org.apache.helix.manager.zk.ZKHelixAdmin;
import org.apache.helix.manager.zk.ZKHelixDataAccessor;
import org.apache.helix.manager.zk.ZKHelixManager;
-import org.apache.helix.manager.zk.ZkClient;
import org.apache.helix.model.ExternalView;
import org.apache.helix.model.IdealState.RebalanceMode;
import org.apache.helix.testutil.ZkTestBase;
@@ -78,8 +77,8 @@ public class TestEntropyFreeNodeBounce extends ZkTestBase {
}
// Start the controller
- ClusterControllerManager controller =
- new ClusterControllerManager(_zkaddr, clusterName, "controller");
+ MockController controller =
+ new MockController(_zkaddr, clusterName, "controller");
controller.syncStart();
// get an admin and accessor
@@ -97,14 +96,14 @@ public class TestEntropyFreeNodeBounce extends ZkTestBase {
Assert.assertTrue(result);
ExternalView stableExternalView =
accessor.getProperty(keyBuilder.externalView(RESOURCE_NAME));
- for (HelixManager participant : participants) {
+ for (int i = 0; i < NUM_PARTICIPANTS; i++) {
// disable the controller, bounce the node, re-enable the controller, verify assignments
// remained the same
helixAdmin.enableCluster(clusterName, false);
- participant.disconnect();
+ participants[i].disconnect();
Thread.sleep(1000);
- participant = createParticipant(clusterName, participant.getInstanceName());
- participant.connect();
+ participants[i] = createParticipant(clusterName, participants[i].getInstanceName());
+ participants[i].connect();
Thread.sleep(1000);
helixAdmin.enableCluster(clusterName, true);
Thread.sleep(1000);
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestErrorPartition.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestErrorPartition.java b/helix-core/src/test/java/org/apache/helix/integration/TestErrorPartition.java
index edc2965..19af9a7 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestErrorPartition.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestErrorPartition.java
@@ -26,8 +26,8 @@ import java.util.Map;
import java.util.Set;
import org.apache.helix.TestHelper;
-import org.apache.helix.integration.manager.ClusterControllerManager;
-import org.apache.helix.integration.manager.MockParticipantManager;
+import org.apache.helix.manager.zk.MockParticipant;
+import org.apache.helix.manager.zk.MockController;
import org.apache.helix.manager.zk.ZKHelixAdmin;
import org.apache.helix.mock.participant.ErrTransition;
import org.apache.helix.testutil.TestUtil;
@@ -40,7 +40,7 @@ public class TestErrorPartition extends ZkTestBase {
@Test()
public void testErrorPartition() throws Exception {
String clusterName = TestUtil.getTestName();
- MockParticipantManager[] participants = new MockParticipantManager[5];
+ MockParticipant[] participants = new MockParticipant[5];
System.out.println("START testErrorPartition() at " + new Date(System.currentTimeMillis()));
ZKHelixAdmin tool = new ZKHelixAdmin(_zkclient);
@@ -48,8 +48,8 @@ public class TestErrorPartition extends ZkTestBase {
TestHelper.setupCluster(clusterName, _zkaddr, 12918, "localhost", "TestDB", 1, 10, 5, 3,
"MasterSlave", true);
- ClusterControllerManager controller =
- new ClusterControllerManager(_zkaddr, clusterName, "controller_0");
+ MockController controller =
+ new MockController(_zkaddr, clusterName, "controller_0");
controller.syncStart();
for (int i = 0; i < 5; i++) {
@@ -61,10 +61,10 @@ public class TestErrorPartition extends ZkTestBase {
put("SLAVE-MASTER", TestHelper.setOf("TestDB0_4"));
}
};
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
participants[i].setTransition(new ErrTransition(errPartitions));
} else {
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
}
participants[i].syncStart();
}
@@ -115,7 +115,7 @@ public class TestErrorPartition extends ZkTestBase {
ClusterStateVerifier.verifyByPolling(new ClusterStateVerifier.BestPossAndExtViewZkVerifier(
_zkaddr, clusterName));
Assert.assertTrue(result);
- participants[0] = new MockParticipantManager(_zkaddr, clusterName, "localhost_12918");
+ participants[0] = new MockParticipant(_zkaddr, clusterName, "localhost_12918");
new Thread(participants[0]).start();
result =
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestExternalViewUpdates.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestExternalViewUpdates.java b/helix-core/src/test/java/org/apache/helix/integration/TestExternalViewUpdates.java
index 835f81e..8791ff8 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestExternalViewUpdates.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestExternalViewUpdates.java
@@ -25,8 +25,8 @@ import java.util.List;
import org.apache.helix.PropertyKey.Builder;
import org.apache.helix.TestHelper;
-import org.apache.helix.integration.manager.ClusterControllerManager;
-import org.apache.helix.integration.manager.MockParticipantManager;
+import org.apache.helix.manager.zk.MockParticipant;
+import org.apache.helix.manager.zk.MockController;
import org.apache.helix.testutil.TestUtil;
import org.apache.helix.testutil.ZkTestBase;
import org.apache.helix.tools.ClusterStateVerifier;
@@ -42,7 +42,7 @@ public class TestExternalViewUpdates extends ZkTestBase {
System.out.println("START testExternalViewUpdates at " + new Date(System.currentTimeMillis()));
String clusterName = TestUtil.getTestName();
- MockParticipantManager[] participants = new MockParticipantManager[5];
+ MockParticipant[] participants = new MockParticipant[5];
int resourceNb = 10;
TestHelper.setupCluster(clusterName, _zkaddr, 12918, // participant port
"localhost", // participant name prefix
@@ -53,15 +53,15 @@ public class TestExternalViewUpdates extends ZkTestBase {
1, // replicas
"MasterSlave", true); // do rebalance
- ClusterControllerManager controller =
- new ClusterControllerManager(_zkaddr, clusterName, "controller_0");
+ MockController controller =
+ new MockController(_zkaddr, clusterName, "controller_0");
controller.syncStart();
// start participants
for (int i = 0; i < 5; i++) {
String instanceName = "localhost_" + (12918 + i);
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
participants[i].syncStart();
}
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestFullAutoNodeTagging.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestFullAutoNodeTagging.java b/helix-core/src/test/java/org/apache/helix/integration/TestFullAutoNodeTagging.java
index 6704fa9..20ea617 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestFullAutoNodeTagging.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestFullAutoNodeTagging.java
@@ -28,8 +28,8 @@ import org.apache.helix.HelixDataAccessor;
import org.apache.helix.PropertyKey;
import org.apache.helix.TestHelper;
import org.apache.helix.TestHelper.Verifier;
-import org.apache.helix.integration.manager.ClusterControllerManager;
-import org.apache.helix.integration.manager.MockParticipantManager;
+import org.apache.helix.manager.zk.MockParticipant;
+import org.apache.helix.manager.zk.MockController;
import org.apache.helix.manager.zk.ZKHelixAdmin;
import org.apache.helix.manager.zk.ZKHelixDataAccessor;
import org.apache.helix.model.ExternalView;
@@ -95,16 +95,16 @@ public class TestFullAutoNodeTagging extends ZkTestBase {
}
// Start controller
- ClusterControllerManager controller =
- new ClusterControllerManager(_zkaddr, clusterName, "controller");
+ MockController controller =
+ new MockController(_zkaddr, clusterName, "controller");
controller.syncStart();
// Start participants
- MockParticipantManager[] participants = new MockParticipantManager[NUM_PARTICIPANTS];
+ MockParticipant[] participants = new MockParticipant[NUM_PARTICIPANTS];
for (int i = 0; i < NUM_PARTICIPANTS; i++) {
final String instanceName = "localhost_" + (12918 + i);
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
participants[i].syncStart();
}
@@ -193,16 +193,16 @@ public class TestFullAutoNodeTagging extends ZkTestBase {
helixAdmin.setResourceIdealState(clusterName, RESOURCE_NAME, idealState);
// start controller
- ClusterControllerManager controller =
- new ClusterControllerManager(_zkaddr, clusterName, "controller");
+ MockController controller =
+ new MockController(_zkaddr, clusterName, "controller");
controller.syncStart();
// start participants
- MockParticipantManager[] participants = new MockParticipantManager[NUM_PARTICIPANTS];
+ MockParticipant[] participants = new MockParticipant[NUM_PARTICIPANTS];
for (int i = 0; i < NUM_PARTICIPANTS; i++) {
final String instanceName = "localhost_" + (12918 + i);
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
participants[i].syncStart();
}
@@ -264,16 +264,16 @@ public class TestFullAutoNodeTagging extends ZkTestBase {
helixAdmin.setResourceIdealState(clusterName, RESOURCE_NAME, idealState);
// start controller
- ClusterControllerManager controller =
- new ClusterControllerManager(_zkaddr, clusterName, "controller");
+ MockController controller =
+ new MockController(_zkaddr, clusterName, "controller");
controller.syncStart();
// start participants
- MockParticipantManager[] participants = new MockParticipantManager[NUM_PARTICIPANTS];
+ MockParticipant[] participants = new MockParticipant[NUM_PARTICIPANTS];
for (int i = 0; i < NUM_PARTICIPANTS; i++) {
final String instanceName = "localhost_" + (12918 + i);
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
participants[i].syncStart();
// ensure that everything is valid if this is a tagged node that is starting
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestHelixCustomCodeRunner.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestHelixCustomCodeRunner.java b/helix-core/src/test/java/org/apache/helix/integration/TestHelixCustomCodeRunner.java
index 2d95811..1acc142 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestHelixCustomCodeRunner.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestHelixCustomCodeRunner.java
@@ -27,8 +27,8 @@ import org.apache.helix.HelixManager;
import org.apache.helix.NotificationContext;
import org.apache.helix.PropertyKey.Builder;
import org.apache.helix.TestHelper;
-import org.apache.helix.integration.manager.ClusterControllerManager;
-import org.apache.helix.integration.manager.MockParticipantManager;
+import org.apache.helix.manager.zk.MockParticipant;
+import org.apache.helix.manager.zk.MockController;
import org.apache.helix.manager.zk.ZKHelixDataAccessor;
import org.apache.helix.model.LiveInstance;
import org.apache.helix.participant.CustomCodeCallbackHandler;
@@ -87,15 +87,15 @@ public class TestHelixCustomCodeRunner extends ZkTestBase {
_nodeNb, // replica
"MasterSlave", true);
- ClusterControllerManager controller =
- new ClusterControllerManager(_zkaddr, _clusterName, "controller_0");
+ MockController controller =
+ new MockController(_zkaddr, _clusterName, "controller_0");
controller.syncStart();
- MockParticipantManager[] participants = new MockParticipantManager[5];
+ MockParticipant[] participants = new MockParticipant[5];
for (int i = 0; i < _nodeNb; i++) {
String instanceName = "localhost_" + (_startPort + i);
- participants[i] = new MockParticipantManager(_zkaddr, _clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, _clusterName, instanceName);
registerCustomCodeRunner(participants[i]);
participants[i].syncStart();
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestInstanceAutoJoin.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestInstanceAutoJoin.java b/helix-core/src/test/java/org/apache/helix/integration/TestInstanceAutoJoin.java
index c6d963d..0acd107 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestInstanceAutoJoin.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestInstanceAutoJoin.java
@@ -2,11 +2,12 @@ package org.apache.helix.integration;
import org.apache.helix.HelixDataAccessor;
import org.apache.helix.HelixManager;
-import org.apache.helix.integration.manager.MockParticipantManager;
+import org.apache.helix.manager.zk.MockParticipant;
import org.apache.helix.manager.zk.ZKHelixManager;
-import org.apache.helix.model.ConfigScope;
+import org.apache.helix.model.HelixConfigScope;
+import org.apache.helix.model.HelixConfigScope.ConfigScopeProperty;
import org.apache.helix.model.IdealState.RebalanceMode;
-import org.apache.helix.model.builder.ConfigScopeBuilder;
+import org.apache.helix.model.builder.HelixConfigScopeBuilder;
import org.testng.Assert;
import org.testng.annotations.Test;
@@ -43,8 +44,7 @@ public class TestInstanceAutoJoin extends ZkStandAloneCMTestBase {
_setupTool.rebalanceStorageCluster(CLUSTER_NAME, db2, 1);
String instance2 = "localhost_279699";
// StartCMResult result = TestHelper.startDummyProcess(zkaddr, CLUSTER_NAME, instance2);
- MockParticipantManager newParticipant =
- new MockParticipantManager(_zkaddr, CLUSTER_NAME, instance2);
+ MockParticipant newParticipant = new MockParticipant(_zkaddr, CLUSTER_NAME, instance2);
newParticipant.syncStart();
Thread.sleep(500);
@@ -52,11 +52,12 @@ public class TestInstanceAutoJoin extends ZkStandAloneCMTestBase {
Assert.assertTrue(null == manager.getHelixDataAccessor().getProperty(
accessor.keyBuilder().liveInstance(instance2)));
- ConfigScope scope = new ConfigScopeBuilder().forCluster(CLUSTER_NAME).build();
+ HelixConfigScope scope =
+ new HelixConfigScopeBuilder(ConfigScopeProperty.CLUSTER).forCluster(CLUSTER_NAME).build();
manager.getConfigAccessor().set(scope, ZKHelixManager.ALLOW_PARTICIPANT_AUTO_JOIN, "true");
- newParticipant = new MockParticipantManager(_zkaddr, CLUSTER_NAME, instance2);
+ newParticipant = new MockParticipant(_zkaddr, CLUSTER_NAME, instance2);
newParticipant.syncStart();
Thread.sleep(500);
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestInvalidAutoIdealState.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestInvalidAutoIdealState.java b/helix-core/src/test/java/org/apache/helix/integration/TestInvalidAutoIdealState.java
index 1f1af0e..b89d184 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestInvalidAutoIdealState.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestInvalidAutoIdealState.java
@@ -28,8 +28,8 @@ import org.apache.helix.HelixDataAccessor;
import org.apache.helix.PropertyKey.Builder;
import org.apache.helix.TestHelper;
import org.apache.helix.api.id.StateModelDefId;
-import org.apache.helix.integration.manager.ClusterControllerManager;
-import org.apache.helix.integration.manager.MockParticipantManager;
+import org.apache.helix.manager.zk.MockParticipant;
+import org.apache.helix.manager.zk.MockController;
import org.apache.helix.manager.zk.ZKHelixAdmin;
import org.apache.helix.model.ExternalView;
import org.apache.helix.model.IdealState;
@@ -91,16 +91,16 @@ public class TestInvalidAutoIdealState extends ZkTestBase {
admin.setResourceIdealState(clusterName, "TestDB", idealState);
// start participants
- MockParticipantManager[] participants = new MockParticipantManager[n];
+ MockParticipant[] participants = new MockParticipant[n];
for (int i = 0; i < n; i++) {
String instanceName = "localhost_" + (12918 + i);
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
participants[i].syncStart();
}
- ClusterControllerManager controller =
- new ClusterControllerManager(_zkaddr, clusterName, "controller_0");
+ MockController controller =
+ new MockController(_zkaddr, clusterName, "controller_0");
controller.syncStart();
boolean result =
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestInvalidResourceRebalance.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestInvalidResourceRebalance.java b/helix-core/src/test/java/org/apache/helix/integration/TestInvalidResourceRebalance.java
index 2cedb83..9202f4f 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestInvalidResourceRebalance.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestInvalidResourceRebalance.java
@@ -24,8 +24,8 @@ import java.util.Map;
import org.apache.helix.HelixAdmin;
import org.apache.helix.TestHelper;
-import org.apache.helix.integration.manager.ClusterControllerManager;
-import org.apache.helix.integration.manager.MockParticipantManager;
+import org.apache.helix.manager.zk.MockParticipant;
+import org.apache.helix.manager.zk.MockController;
import org.apache.helix.model.HelixConfigScope.ConfigScopeProperty;
import org.apache.helix.model.IdealState.RebalanceMode;
import org.apache.helix.model.builder.HelixConfigScopeBuilder;
@@ -66,8 +66,8 @@ public class TestInvalidResourceRebalance extends ZkTestBase {
true); // do rebalance
// start controller
- ClusterControllerManager controller =
- new ClusterControllerManager(_zkaddr, clusterName, "controller");
+ MockController controller =
+ new MockController(_zkaddr, clusterName, "controller");
controller.syncStart();
// add the ideal state spec (prevents non-CUSTOMIZED MasterSlave ideal states)
@@ -80,11 +80,11 @@ public class TestInvalidResourceRebalance extends ZkTestBase {
properties);
// start participants
- MockParticipantManager[] participants = new MockParticipantManager[NUM_PARTICIPANTS];
+ MockParticipant[] participants = new MockParticipant[NUM_PARTICIPANTS];
for (int i = 0; i < NUM_PARTICIPANTS; i++) {
final String instanceName = "localhost_" + (12918 + i);
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
participants[i].syncStart();
}
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestMessageThrottle.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestMessageThrottle.java b/helix-core/src/test/java/org/apache/helix/integration/TestMessageThrottle.java
index 1442979..6201dca 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestMessageThrottle.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestMessageThrottle.java
@@ -29,13 +29,12 @@ import org.apache.helix.PropertyPathConfig;
import org.apache.helix.PropertyType;
import org.apache.helix.TestHelper;
import org.apache.helix.ZNRecord;
+import org.apache.helix.manager.zk.MockParticipant;
+import org.apache.helix.manager.zk.MockController;
import org.apache.helix.manager.zk.ZKHelixAdmin;
import org.apache.helix.manager.zk.ZKHelixDataAccessor;
-import org.apache.helix.manager.zk.ZkBaseDataAccessor;
import org.apache.helix.model.ClusterConstraints.ConstraintType;
import org.apache.helix.model.Message;
-import org.apache.helix.integration.manager.ClusterControllerManager;
-import org.apache.helix.integration.manager.MockParticipantManager;
import org.apache.helix.model.builder.ConstraintItemBuilder;
import org.apache.helix.testutil.TestUtil;
import org.apache.helix.testutil.ZkTestBase;
@@ -51,7 +50,7 @@ public class TestMessageThrottle extends ZkTestBase {
// Logger.getRootLogger().setLevel(Level.INFO);
String clusterName = TestUtil.getTestName();
- MockParticipantManager[] participants = new MockParticipantManager[5];
+ MockParticipant[] participants = new MockParticipant[5];
System.out.println("START " + clusterName + " at " + new Date(System.currentTimeMillis()));
@@ -115,15 +114,15 @@ public class TestMessageThrottle extends ZkTestBase {
});
}
- ClusterControllerManager controller =
- new ClusterControllerManager(_zkaddr, clusterName, "controller_0");
+ MockController controller =
+ new MockController(_zkaddr, clusterName, "controller_0");
controller.syncStart();
// start participants
for (int i = 0; i < 5; i++) {
String instanceName = "localhost_" + (12918 + i);
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
participants[i].syncStart();
}
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestMessageThrottle2.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestMessageThrottle2.java b/helix-core/src/test/java/org/apache/helix/integration/TestMessageThrottle2.java
index 2731b79..496a16f 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestMessageThrottle2.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestMessageThrottle2.java
@@ -34,7 +34,6 @@ import org.apache.helix.HelixDataAccessor;
import org.apache.helix.HelixManager;
import org.apache.helix.IdealStateChangeListener;
import org.apache.helix.InstanceConfigChangeListener;
-import org.apache.helix.InstanceType;
import org.apache.helix.LiveInstanceChangeListener;
import org.apache.helix.NotificationContext;
import org.apache.helix.PropertyKey.Builder;
@@ -42,9 +41,10 @@ import org.apache.helix.TestHelper;
import org.apache.helix.ZNRecord;
import org.apache.helix.api.id.PartitionId;
import org.apache.helix.controller.HelixControllerMain;
+import org.apache.helix.manager.zk.MockParticipant;
import org.apache.helix.manager.zk.ZKHelixAdmin;
import org.apache.helix.manager.zk.ZKHelixDataAccessor;
-import org.apache.helix.manager.zk.ZKHelixManager;
+import org.apache.helix.manager.zk.ZkHelixConnection;
import org.apache.helix.model.ClusterConstraints;
import org.apache.helix.model.ExternalView;
import org.apache.helix.model.IdealState;
@@ -237,32 +237,34 @@ public class TestMessageThrottle2 extends ZkTestBase {
static final class MyProcess {
private final String instanceName;
- private HelixManager helixManager;
+ // private HelixManager helixManager;
+ private MockParticipant participant;
public MyProcess(String instanceName) {
this.instanceName = instanceName;
}
public void start() throws Exception {
- helixManager =
- new ZKHelixManager(clusterName, instanceName, InstanceType.PARTICIPANT, _zkaddr);
+// helixManager =
+// new ZKHelixManager(clusterName, instanceName, InstanceType.PARTICIPANT, _zkaddr);
+ participant = new MockParticipant(_zkaddr, clusterName, instanceName);
{
// hack to set sessionTimeout
- Field sessionTimeout = ZKHelixManager.class.getDeclaredField("_sessionTimeout");
+ Field sessionTimeout = ZkHelixConnection.class.getDeclaredField("_sessionTimeout");
sessionTimeout.setAccessible(true);
- sessionTimeout.setInt(helixManager, 1000);
+ sessionTimeout.setInt(participant.getConn(), 1000);
}
- StateMachineEngine stateMach = helixManager.getStateMachineEngine();
- stateMach.registerStateModelFactory("MasterSlave", new MyStateModelFactory(helixManager));
- helixManager.connect();
+ StateMachineEngine stateMach = participant.getStateMachineEngine();
+ stateMach.registerStateModelFactory("MasterSlave", new MyStateModelFactory(participant));
+ participant.connect();
StatusPrinter statusPrinter = new StatusPrinter();
- statusPrinter.registerWith(helixManager);
+ statusPrinter.registerWith(participant);
}
public void stop() {
- helixManager.disconnect();
+ participant.disconnect();
}
}
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestMessagingService.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestMessagingService.java b/helix-core/src/test/java/org/apache/helix/integration/TestMessagingService.java
index 7df9e8b..08954e5 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestMessagingService.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestMessagingService.java
@@ -84,7 +84,7 @@ public class TestMessagingService extends ZkStandAloneCMTestBase {
}
@Test()
- public void TestMessageSimpleSend() throws Exception {
+ public void testMessageSimpleSend() throws Exception {
String hostSrc = "localhost_" + START_PORT;
String hostDest = "localhost_" + (START_PORT + 1);
@@ -176,7 +176,7 @@ public class TestMessagingService extends ZkStandAloneCMTestBase {
}
@Test()
- public void TestMessageSimpleSendReceiveAsync() throws Exception {
+ public void testMessageSimpleSendReceiveAsync() throws Exception {
String hostSrc = "localhost_" + START_PORT;
String hostDest = "localhost_" + (START_PORT + 1);
@@ -243,7 +243,7 @@ public class TestMessagingService extends ZkStandAloneCMTestBase {
}
@Test()
- public void TestBlockingSendReceive() throws Exception {
+ public void testBlockingSendReceive() throws Exception {
String hostSrc = "localhost_" + START_PORT;
String hostDest = "localhost_" + (START_PORT + 1);
@@ -282,7 +282,7 @@ public class TestMessagingService extends ZkStandAloneCMTestBase {
}
@Test()
- public void TestMultiMessageCriteria() throws Exception {
+ public void testMultiMessageCriteria() throws Exception {
String hostSrc = "localhost_" + START_PORT;
for (int i = 0; i < NODE_NR; i++) {
@@ -382,7 +382,7 @@ public class TestMessagingService extends ZkStandAloneCMTestBase {
}
@Test()
- public void TestControllerMessage() throws Exception {
+ public void testControllerMessage() throws Exception {
String hostSrc = "localhost_" + START_PORT;
for (int i = 0; i < NODE_NR; i++) {
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestNonOfflineInitState.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestNonOfflineInitState.java b/helix-core/src/test/java/org/apache/helix/integration/TestNonOfflineInitState.java
index 1329cbe..105633a 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestNonOfflineInitState.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestNonOfflineInitState.java
@@ -22,13 +22,12 @@ package org.apache.helix.integration;
import java.util.Date;
import org.apache.helix.TestHelper;
-import org.apache.helix.integration.manager.ClusterControllerManager;
-import org.apache.helix.integration.manager.MockParticipantManager;
+import org.apache.helix.manager.zk.MockParticipant;
+import org.apache.helix.manager.zk.MockController;
import org.apache.helix.mock.participant.MockBootstrapModelFactory;
import org.apache.helix.participant.StateMachineEngine;
import org.apache.helix.testutil.TestUtil;
import org.apache.helix.testutil.ZkTestBase;
-import org.apache.helix.tools.ClusterSetup;
import org.apache.helix.tools.ClusterStateVerifier;
import org.apache.helix.tools.ClusterStateVerifier.BestPossAndExtViewZkVerifier;
import org.apache.log4j.Logger;
@@ -52,16 +51,16 @@ public class TestNonOfflineInitState extends ZkTestBase {
1, // replicas
"Bootstrap", true); // do rebalance
- ClusterControllerManager controller =
- new ClusterControllerManager(_zkaddr, clusterName, "controller_0");
+ MockController controller =
+ new MockController(_zkaddr, clusterName, "controller_0");
controller.syncStart();
// start participants
- MockParticipantManager[] participants = new MockParticipantManager[5];
+ MockParticipant[] participants = new MockParticipant[5];
for (int i = 0; i < 5; i++) {
String instanceName = "localhost_" + (12918 + i);
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
// add a state model with non-OFFLINE initial state
StateMachineEngine stateMach = participants[i].getStateMachineEngine();
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestNullReplica.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestNullReplica.java b/helix-core/src/test/java/org/apache/helix/integration/TestNullReplica.java
index 544fbd5..461d8bb 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestNullReplica.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestNullReplica.java
@@ -25,8 +25,8 @@ import org.apache.helix.PropertyPathConfig;
import org.apache.helix.PropertyType;
import org.apache.helix.TestHelper;
import org.apache.helix.ZNRecord;
-import org.apache.helix.integration.manager.ClusterControllerManager;
-import org.apache.helix.integration.manager.MockParticipantManager;
+import org.apache.helix.manager.zk.MockParticipant;
+import org.apache.helix.manager.zk.MockController;
import org.apache.helix.model.IdealState;
import org.apache.helix.testutil.ZkTestBase;
import org.apache.helix.tools.ClusterStateVerifier;
@@ -45,7 +45,7 @@ public class TestNullReplica extends ZkTestBase {
System.out.println("START " + clusterName + " at " + new Date(System.currentTimeMillis()));
- MockParticipantManager[] participants = new MockParticipantManager[5];
+ MockParticipant[] participants = new MockParticipant[5];
TestHelper.setupCluster(clusterName, _zkaddr, 12918, // participant port
"localhost", // participant name prefix
@@ -62,15 +62,15 @@ public class TestNullReplica extends ZkTestBase {
idealState.getSimpleFields().remove(IdealState.IdealStateProperty.REPLICAS.toString());
_zkclient.writeData(idealStatePath, idealState);
- ClusterControllerManager controller =
- new ClusterControllerManager(_zkaddr, clusterName, "controller_0");
+ MockController controller =
+ new MockController(_zkaddr, clusterName, "controller_0");
controller.syncStart();
// start participants
for (int i = 0; i < 5; i++) {
String instanceName = "localhost_" + (12918 + i);
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
participants[i].syncStart();
}
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestParticipantNameCollision.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestParticipantNameCollision.java b/helix-core/src/test/java/org/apache/helix/integration/TestParticipantNameCollision.java
index d4d56df..bc30754 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestParticipantNameCollision.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestParticipantNameCollision.java
@@ -22,7 +22,7 @@ package org.apache.helix.integration;
import java.util.Date;
import org.apache.helix.TestHelper;
-import org.apache.helix.integration.manager.MockParticipantManager;
+import org.apache.helix.manager.zk.MockParticipant;
import org.apache.log4j.Logger;
import org.testng.annotations.Test;
@@ -33,13 +33,13 @@ public class TestParticipantNameCollision extends ZkStandAloneCMTestBase {
public void testParticiptantNameCollision() throws Exception {
logger.info("RUN TestParticipantNameCollision() at " + new Date(System.currentTimeMillis()));
- MockParticipantManager newParticipant = null;
+ MockParticipant newParticipant = null;
for (int i = 0; i < 1; i++) {
String instanceName = "localhost_" + (START_PORT + i);
try {
// the call fails on getClusterManagerForParticipant()
// no threads start
- newParticipant = new MockParticipantManager(_zkaddr, CLUSTER_NAME, instanceName);
+ newParticipant = new MockParticipant(_zkaddr, CLUSTER_NAME, instanceName);
newParticipant.syncStart();
} catch (Exception e) {
e.printStackTrace();
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestPartitionLevelTransitionConstraint.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestPartitionLevelTransitionConstraint.java b/helix-core/src/test/java/org/apache/helix/integration/TestPartitionLevelTransitionConstraint.java
index 2f27fd2..823a9ce 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestPartitionLevelTransitionConstraint.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestPartitionLevelTransitionConstraint.java
@@ -24,17 +24,14 @@ import java.util.Date;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
-import org.apache.helix.BaseDataAccessor;
import org.apache.helix.HelixAdmin;
import org.apache.helix.HelixDataAccessor;
import org.apache.helix.NotificationContext;
import org.apache.helix.TestHelper;
-import org.apache.helix.ZNRecord;
-import org.apache.helix.integration.manager.ClusterControllerManager;
-import org.apache.helix.integration.manager.MockParticipantManager;
+import org.apache.helix.manager.zk.MockParticipant;
+import org.apache.helix.manager.zk.MockController;
import org.apache.helix.manager.zk.ZKHelixAdmin;
import org.apache.helix.manager.zk.ZKHelixDataAccessor;
-import org.apache.helix.manager.zk.ZkBaseDataAccessor;
import org.apache.helix.model.ClusterConstraints.ConstraintAttribute;
import org.apache.helix.model.ClusterConstraints.ConstraintType;
import org.apache.helix.model.IdealState;
@@ -139,15 +136,15 @@ public class TestPartitionLevelTransitionConstraint extends ZkTestBase {
admin.setConstraint(clusterName, ConstraintType.MESSAGE_CONSTRAINT, "constraint1",
constraintItemBuilder.build());
- ClusterControllerManager controller =
- new ClusterControllerManager(_zkaddr, clusterName, "controller");
+ MockController controller =
+ new MockController(_zkaddr, clusterName, "controller");
controller.syncStart();
// start 1st participant
- MockParticipantManager[] participants = new MockParticipantManager[n];
+ MockParticipant[] participants = new MockParticipant[n];
String instanceName1 = "localhost_12918";
- participants[0] = new MockParticipantManager(_zkaddr, clusterName, instanceName1);
+ participants[0] = new MockParticipant(_zkaddr, clusterName, instanceName1);
participants[0].getStateMachineEngine().registerStateModelFactory("Bootstrap",
new BootstrapStateModelFactory());
participants[0].syncStart();
@@ -160,7 +157,7 @@ public class TestPartitionLevelTransitionConstraint extends ZkTestBase {
// start 2nd participant which will be the master for Test0_0
String instanceName2 = "localhost_12919";
- participants[1] = new MockParticipantManager(_zkaddr, clusterName, instanceName2);
+ participants[1] = new MockParticipant(_zkaddr, clusterName, instanceName2);
participants[1].getStateMachineEngine().registerStateModelFactory("Bootstrap",
new BootstrapStateModelFactory());
participants[1].syncStart();
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestPauseSignal.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestPauseSignal.java b/helix-core/src/test/java/org/apache/helix/integration/TestPauseSignal.java
index 2d87e61..5c59348 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestPauseSignal.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestPauseSignal.java
@@ -24,8 +24,8 @@ import java.util.Date;
import org.apache.helix.HelixDataAccessor;
import org.apache.helix.TestHelper;
import org.apache.helix.ZNRecord;
-import org.apache.helix.integration.manager.ClusterControllerManager;
-import org.apache.helix.integration.manager.MockParticipantManager;
+import org.apache.helix.manager.zk.MockParticipant;
+import org.apache.helix.manager.zk.MockController;
import org.apache.helix.manager.zk.ZKHelixDataAccessor;
import org.apache.helix.manager.zk.ZNRecordSerializer;
import org.apache.helix.manager.zk.ZkBaseDataAccessor;
@@ -48,7 +48,7 @@ public class TestPauseSignal extends ZkTestBase {
System.out.println("START " + clusterName + " at " + new Date(System.currentTimeMillis()));
- MockParticipantManager[] participants = new MockParticipantManager[5];
+ MockParticipant[] participants = new MockParticipant[5];
TestHelper.setupCluster(clusterName, _zkaddr, 12918, // participant port
"localhost", // participant name prefix
@@ -60,15 +60,15 @@ public class TestPauseSignal extends ZkTestBase {
"MasterSlave", true); // do rebalance
// start controller
- ClusterControllerManager controller =
- new ClusterControllerManager(_zkaddr, clusterName, "controller_0");
+ MockController controller =
+ new MockController(_zkaddr, clusterName, "controller_0");
controller.syncStart();
// start participants
for (int i = 0; i < 5; i++) {
String instanceName = "localhost_" + (12918 + i);
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
participants[i].syncStart();
}
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestPreferenceListAsQueue.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestPreferenceListAsQueue.java b/helix-core/src/test/java/org/apache/helix/integration/TestPreferenceListAsQueue.java
index 6de604b..06a2b56 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestPreferenceListAsQueue.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestPreferenceListAsQueue.java
@@ -44,7 +44,6 @@ import org.apache.helix.model.builder.ConstraintItemBuilder;
import org.apache.helix.participant.statemachine.StateModel;
import org.apache.helix.participant.statemachine.StateModelFactory;
import org.apache.helix.testutil.ZkTestBase;
-import org.apache.helix.tools.ClusterSetup;
import org.apache.log4j.Logger;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestRedefineStateModelDef.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestRedefineStateModelDef.java b/helix-core/src/test/java/org/apache/helix/integration/TestRedefineStateModelDef.java
index 1ce31f4..b7f61c6 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestRedefineStateModelDef.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestRedefineStateModelDef.java
@@ -26,8 +26,8 @@ import java.util.TreeMap;
import org.apache.helix.PropertyKey;
import org.apache.helix.TestHelper;
-import org.apache.helix.integration.manager.ClusterControllerManager;
-import org.apache.helix.integration.manager.MockParticipantManager;
+import org.apache.helix.manager.zk.MockParticipant;
+import org.apache.helix.manager.zk.MockController;
import org.apache.helix.manager.zk.ZKHelixDataAccessor;
import org.apache.helix.model.IdealState;
import org.apache.helix.model.IdealState.RebalanceMode;
@@ -66,16 +66,16 @@ public class TestRedefineStateModelDef extends ZkTestBase {
autoRebalance(clusterName);
// start controller
- ClusterControllerManager controller =
- new ClusterControllerManager(_zkaddr, clusterName, "controller_0");
+ MockController controller =
+ new MockController(_zkaddr, clusterName, "controller_0");
controller.syncStart();
// start participants
- MockParticipantManager[] participants = new MockParticipantManager[n];
+ MockParticipant[] participants = new MockParticipant[n];
for (int i = 0; i < n; i++) {
String instanceName = "localhost_" + (12918 + i);
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
participants[i].syncStart();
}
@@ -88,7 +88,7 @@ public class TestRedefineStateModelDef extends ZkTestBase {
// stop controller, redefine state model definition, and re-start controller
controller.syncStop();
redefineStateModelDef(clusterName);
- controller = new ClusterControllerManager(_zkaddr, clusterName, "controller_0");
+ controller = new MockController(_zkaddr, clusterName, "controller_0");
controller.syncStart();
result =
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestReelectedPipelineCorrectness.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestReelectedPipelineCorrectness.java b/helix-core/src/test/java/org/apache/helix/integration/TestReelectedPipelineCorrectness.java
index 5595d0c..e522008 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestReelectedPipelineCorrectness.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestReelectedPipelineCorrectness.java
@@ -24,13 +24,12 @@ import java.util.Date;
import org.apache.helix.HelixAdmin;
import org.apache.helix.HelixDataAccessor;
import org.apache.helix.TestHelper;
-import org.apache.helix.integration.manager.ClusterDistributedController;
-import org.apache.helix.integration.manager.MockParticipantManager;
+import org.apache.helix.manager.zk.MockParticipant;
+import org.apache.helix.manager.zk.MockMultiClusterController;
import org.apache.helix.model.IdealState;
import org.apache.helix.model.IdealState.RebalanceMode;
import org.apache.helix.model.LiveInstance;
import org.apache.helix.testutil.ZkTestBase;
-import org.apache.helix.tools.ClusterSetup;
import org.apache.helix.tools.ClusterStateVerifier;
import org.apache.helix.tools.ClusterStateVerifier.BestPossAndExtViewZkVerifier;
import org.testng.Assert;
@@ -76,18 +75,18 @@ public class TestReelectedPipelineCorrectness extends ZkTestBase {
_setupTool.activateCluster(clusterName, controllerCluster, true);
// start participants
- MockParticipantManager[] participants = new MockParticipantManager[NUM_PARTICIPANTS];
+ MockParticipant[] participants = new MockParticipant[NUM_PARTICIPANTS];
for (int i = 0; i < NUM_PARTICIPANTS; i++) {
final String instanceName = "localhost_" + (12918 + i);
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
participants[i].syncStart();
}
// start controllers
- ClusterDistributedController[] controllers = new ClusterDistributedController[NUM_CONTROLLERS];
+ MockMultiClusterController[] controllers = new MockMultiClusterController[NUM_CONTROLLERS];
for (int i = 0; i < NUM_CONTROLLERS; i++) {
controllers[i] =
- new ClusterDistributedController(_zkaddr, controllerCluster, "controller_" + i);
+ new MockMultiClusterController(_zkaddr, controllerCluster, "controller_" + i);
controllers[i].syncStart();
}
Thread.sleep(1000);
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestRenamePartition.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestRenamePartition.java b/helix-core/src/test/java/org/apache/helix/integration/TestRenamePartition.java
index c692ed5..f619503 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestRenamePartition.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestRenamePartition.java
@@ -30,8 +30,8 @@ import org.apache.helix.TestHelper;
import org.apache.helix.ZNRecord;
import org.apache.helix.api.id.StateModelDefId;
import org.apache.helix.controller.strategy.DefaultTwoStateStrategy;
-import org.apache.helix.integration.manager.ClusterControllerManager;
-import org.apache.helix.integration.manager.MockParticipantManager;
+import org.apache.helix.manager.zk.MockParticipant;
+import org.apache.helix.manager.zk.MockController;
import org.apache.helix.manager.zk.ZKHelixDataAccessor;
import org.apache.helix.model.IdealState;
import org.apache.helix.model.IdealState.RebalanceMode;
@@ -43,12 +43,12 @@ import org.testng.annotations.Test;
public class TestRenamePartition extends ZkTestBase {
// map from clusterName to participants
- final Map<String, MockParticipantManager[]> _participantMap =
- new ConcurrentHashMap<String, MockParticipantManager[]>();
+ final Map<String, MockParticipant[]> _participantMap =
+ new ConcurrentHashMap<String, MockParticipant[]>();
// map from clusterName to controllers
- final Map<String, ClusterControllerManager> _controllerMap =
- new ConcurrentHashMap<String, ClusterControllerManager>();
+ final Map<String, MockController> _controllerMap =
+ new ConcurrentHashMap<String, MockController>();
@Test()
public void testRenamePartitionAutoIS() throws Exception {
@@ -136,17 +136,17 @@ public class TestRenamePartition extends ZkTestBase {
}
private void startAndVerify(String clusterName) throws Exception {
- MockParticipantManager[] participants = new MockParticipantManager[5];
+ MockParticipant[] participants = new MockParticipant[5];
- ClusterControllerManager controller =
- new ClusterControllerManager(_zkaddr, clusterName, "controller_0");
+ MockController controller =
+ new MockController(_zkaddr, clusterName, "controller_0");
controller.syncStart();
// start participants
for (int i = 0; i < 5; i++) {
String instanceName = "localhost_" + (12918 + i);
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
participants[i].syncStart();
}
@@ -160,14 +160,14 @@ public class TestRenamePartition extends ZkTestBase {
}
private void stop(String clusterName) {
- ClusterControllerManager controller = _controllerMap.get(clusterName);
+ MockController controller = _controllerMap.get(clusterName);
if (controller != null) {
controller.syncStop();
}
- MockParticipantManager[] participants = _participantMap.get(clusterName);
+ MockParticipant[] participants = _participantMap.get(clusterName);
if (participants != null) {
- for (MockParticipantManager participant : participants) {
+ for (MockParticipant participant : participants) {
participant.syncStop();
}
}
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestResetInstance.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestResetInstance.java b/helix-core/src/test/java/org/apache/helix/integration/TestResetInstance.java
index e6b9c2d..5804744 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestResetInstance.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestResetInstance.java
@@ -25,8 +25,8 @@ import java.util.Map;
import java.util.Set;
import org.apache.helix.TestHelper;
-import org.apache.helix.integration.manager.ClusterControllerManager;
-import org.apache.helix.integration.manager.MockParticipantManager;
+import org.apache.helix.manager.zk.MockParticipant;
+import org.apache.helix.manager.zk.MockController;
import org.apache.helix.mock.participant.ErrTransition;
import org.apache.helix.testutil.ZkTestBase;
import org.apache.helix.tools.ClusterSetup;
@@ -55,8 +55,8 @@ public class TestResetInstance extends ZkTestBase {
"MasterSlave", true); // do rebalance
// start controller
- ClusterControllerManager controller =
- new ClusterControllerManager(_zkaddr, clusterName, "controller_0");
+ MockController controller =
+ new MockController(_zkaddr, clusterName, "controller_0");
controller.syncStart();
Map<String, Set<String>> errPartitions = new HashMap<String, Set<String>>() {
@@ -67,15 +67,15 @@ public class TestResetInstance extends ZkTestBase {
};
// start mock participants
- MockParticipantManager[] participants = new MockParticipantManager[n];
+ MockParticipant[] participants = new MockParticipant[n];
for (int i = 0; i < n; i++) {
String instanceName = "localhost_" + (12918 + i);
if (i == 0) {
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
participants[i].setTransition(new ErrTransition(errPartitions));
} else {
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
}
participants[i].syncStart();
}
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestResetPartitionState.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestResetPartitionState.java b/helix-core/src/test/java/org/apache/helix/integration/TestResetPartitionState.java
index 85ab192..4855b3d 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestResetPartitionState.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestResetPartitionState.java
@@ -28,9 +28,9 @@ import org.apache.helix.NotificationContext;
import org.apache.helix.PropertyKey.Builder;
import org.apache.helix.TestHelper;
import org.apache.helix.api.State;
+import org.apache.helix.manager.zk.MockParticipant;
+import org.apache.helix.manager.zk.MockController;
import org.apache.helix.manager.zk.ZKHelixDataAccessor;
-import org.apache.helix.integration.manager.ClusterControllerManager;
-import org.apache.helix.integration.manager.MockParticipantManager;
import org.apache.helix.mock.participant.ErrTransition;
import org.apache.helix.model.LiveInstance;
import org.apache.helix.model.Message;
@@ -80,8 +80,8 @@ public class TestResetPartitionState extends ZkTestBase {
"MasterSlave", true); // do rebalance
// start controller
- ClusterControllerManager controller =
- new ClusterControllerManager(_zkaddr, clusterName, "controller_0");
+ MockController controller =
+ new MockController(_zkaddr, clusterName, "controller_0");
controller.syncStart();
Map<String, Set<String>> errPartitions = new HashMap<String, Set<String>>() {
@@ -92,15 +92,15 @@ public class TestResetPartitionState extends ZkTestBase {
};
// start mock participants
- MockParticipantManager[] participants = new MockParticipantManager[n];
+ MockParticipant[] participants = new MockParticipant[n];
for (int i = 0; i < n; i++) {
String instanceName = "localhost_" + (12918 + i);
if (i == 0) {
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
participants[i].setTransition(new ErrTransition(errPartitions));
} else {
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
}
participants[i].syncStart();
}
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestResetResource.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestResetResource.java b/helix-core/src/test/java/org/apache/helix/integration/TestResetResource.java
index 60983af..7d28931 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestResetResource.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestResetResource.java
@@ -25,8 +25,8 @@ import java.util.Map;
import java.util.Set;
import org.apache.helix.TestHelper;
-import org.apache.helix.integration.manager.ClusterControllerManager;
-import org.apache.helix.integration.manager.MockParticipantManager;
+import org.apache.helix.manager.zk.MockParticipant;
+import org.apache.helix.manager.zk.MockController;
import org.apache.helix.mock.participant.ErrTransition;
import org.apache.helix.testutil.ZkTestBase;
import org.apache.helix.tools.ClusterSetup;
@@ -54,8 +54,8 @@ public class TestResetResource extends ZkTestBase {
"MasterSlave", true); // do rebalance
// start controller
- ClusterControllerManager controller =
- new ClusterControllerManager(_zkaddr, clusterName, "controller_0");
+ MockController controller =
+ new MockController(_zkaddr, clusterName, "controller_0");
controller.syncStart();
Map<String, Set<String>> errPartitions = new HashMap<String, Set<String>>() {
@@ -66,15 +66,15 @@ public class TestResetResource extends ZkTestBase {
};
// start mock participants
- MockParticipantManager[] participants = new MockParticipantManager[n];
+ MockParticipant[] participants = new MockParticipant[n];
for (int i = 0; i < n; i++) {
String instanceName = "localhost_" + (12918 + i);
if (i == 0) {
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
participants[i].setTransition(new ErrTransition(errPartitions));
} else {
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
}
participants[i].syncStart();
}
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestRestartParticipant.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestRestartParticipant.java b/helix-core/src/test/java/org/apache/helix/integration/TestRestartParticipant.java
index e9d2b45..6057583 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestRestartParticipant.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestRestartParticipant.java
@@ -24,8 +24,8 @@ import java.util.concurrent.atomic.AtomicReference;
import org.apache.helix.NotificationContext;
import org.apache.helix.TestHelper;
-import org.apache.helix.integration.manager.ClusterControllerManager;
-import org.apache.helix.integration.manager.MockParticipantManager;
+import org.apache.helix.manager.zk.MockParticipant;
+import org.apache.helix.manager.zk.MockController;
import org.apache.helix.mock.participant.MockTransition;
import org.apache.helix.model.Message;
import org.apache.helix.testutil.TestUtil;
@@ -37,15 +37,15 @@ import org.testng.annotations.Test;
public class TestRestartParticipant extends ZkTestBase {
public class KillOtherTransition extends MockTransition {
- final AtomicReference<MockParticipantManager> _other;
+ final AtomicReference<MockParticipant> _other;
- public KillOtherTransition(MockParticipantManager other) {
- _other = new AtomicReference<MockParticipantManager>(other);
+ public KillOtherTransition(MockParticipant other) {
+ _other = new AtomicReference<MockParticipant>(other);
}
@Override
public void doTransition(Message message, NotificationContext context) {
- MockParticipantManager other = _other.getAndSet(null);
+ MockParticipant other = _other.getAndSet(null);
if (other != null) {
System.err.println("Kill " + other.getInstanceName()
+ ". Interrupted exceptions are IGNORABLE");
@@ -60,7 +60,7 @@ public class TestRestartParticipant extends ZkTestBase {
System.out.println("START testRestartParticipant at " + new Date(System.currentTimeMillis()));
String clusterName = TestUtil.getTestName();
- MockParticipantManager[] participants = new MockParticipantManager[5];
+ MockParticipant[] participants = new MockParticipant[5];
TestHelper.setupCluster(clusterName, _zkaddr, 12918, // participant port
"localhost", // participant name prefix
@@ -71,8 +71,8 @@ public class TestRestartParticipant extends ZkTestBase {
3, // replicas
"MasterSlave", true); // do rebalance
- ClusterControllerManager controller =
- new ClusterControllerManager(_zkaddr, clusterName, "controller_0");
+ MockController controller =
+ new MockController(_zkaddr, clusterName, "controller_0");
controller.syncStart();
// start participants
@@ -80,10 +80,10 @@ public class TestRestartParticipant extends ZkTestBase {
String instanceName = "localhost_" + (12918 + i);
if (i == 4) {
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
participants[i].setTransition(new KillOtherTransition(participants[0]));
} else {
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
}
participants[i].syncStart();
@@ -96,8 +96,8 @@ public class TestRestartParticipant extends ZkTestBase {
// restart
Thread.sleep(500);
- MockParticipantManager participant =
- new MockParticipantManager(_zkaddr, participants[0].getClusterName(),
+ MockParticipant participant =
+ new MockParticipant(_zkaddr, participants[0].getClusterName(),
participants[0].getInstanceName());
System.err.println("Restart " + participant.getInstanceName());
participant.syncStart();
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestSchemataSM.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestSchemataSM.java b/helix-core/src/test/java/org/apache/helix/integration/TestSchemataSM.java
index 9adf374..67d5e32 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestSchemataSM.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestSchemataSM.java
@@ -26,8 +26,8 @@ import java.util.Map;
import org.apache.helix.HelixConstants;
import org.apache.helix.PropertyKey;
import org.apache.helix.TestHelper;
-import org.apache.helix.integration.manager.ClusterControllerManager;
-import org.apache.helix.integration.manager.MockParticipantManager;
+import org.apache.helix.manager.zk.MockParticipant;
+import org.apache.helix.manager.zk.MockController;
import org.apache.helix.manager.zk.ZKHelixDataAccessor;
import org.apache.helix.model.ExternalView;
import org.apache.helix.model.IdealState;
@@ -45,7 +45,7 @@ public class TestSchemataSM extends ZkTestBase {
String clusterName = className + "_" + methodName;
int n = 5;
- MockParticipantManager[] participants = new MockParticipantManager[n];
+ MockParticipant[] participants = new MockParticipant[n];
System.out.println("START " + clusterName + " at " + new Date(System.currentTimeMillis()));
@@ -69,15 +69,15 @@ public class TestSchemataSM extends ZkTestBase {
Arrays.asList(HelixConstants.StateModelToken.ANY_LIVEINSTANCE.toString()));
accessor.setProperty(key, idealState);
- ClusterControllerManager controller =
- new ClusterControllerManager(_zkaddr, clusterName, "controller");
+ MockController controller =
+ new MockController(_zkaddr, clusterName, "controller");
controller.syncStart();
// start n-1 participants
for (int i = 1; i < n; i++) {
String instanceName = "localhost_" + (12918 + i);
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
participants[i].syncStart();
}
@@ -87,7 +87,7 @@ public class TestSchemataSM extends ZkTestBase {
Assert.assertTrue(result);
// start the remaining 1 participant
- participants[0] = new MockParticipantManager(_zkaddr, clusterName, "localhost_12918");
+ participants[0] = new MockParticipant(_zkaddr, clusterName, "localhost_12918");
participants[0].syncStart();
// make sure we have all participants in MASTER state
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestSessionExpiryInTransition.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestSessionExpiryInTransition.java b/helix-core/src/test/java/org/apache/helix/integration/TestSessionExpiryInTransition.java
index bbca923..9e80bb9 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestSessionExpiryInTransition.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestSessionExpiryInTransition.java
@@ -26,8 +26,8 @@ import org.apache.helix.NotificationContext;
import org.apache.helix.TestHelper;
import org.apache.helix.ZkTestHelper;
import org.apache.helix.api.id.PartitionId;
-import org.apache.helix.integration.manager.ClusterControllerManager;
-import org.apache.helix.integration.manager.MockParticipantManager;
+import org.apache.helix.manager.zk.MockParticipant;
+import org.apache.helix.manager.zk.MockController;
import org.apache.helix.mock.participant.MockTransition;
import org.apache.helix.model.Message;
import org.apache.helix.testutil.ZkTestBase;
@@ -42,10 +42,14 @@ public class TestSessionExpiryInTransition extends ZkTestBase {
public class SessionExpiryTransition extends MockTransition {
private final AtomicBoolean _done = new AtomicBoolean();
+ private final MockParticipant _participant;
+
+ public SessionExpiryTransition(MockParticipant participant) {
+ _participant = participant;
+ }
@Override
public void doTransition(Message message, NotificationContext context) {
- MockParticipantManager manager = (MockParticipantManager) context.getManager();
String instance = message.getTgtName();
PartitionId partition = message.getPartitionId();
@@ -54,7 +58,7 @@ public class TestSessionExpiryInTransition extends ZkTestBase {
// on localhost_12918
&& _done.getAndSet(true) == false) {
try {
- ZkTestHelper.expireSession(manager.getZkClient());
+ ZkTestHelper.expireSession(_participant.getZkClient());
} catch (Exception e) {
LOG.error("Exception expire zk-session", e);
}
@@ -72,7 +76,7 @@ public class TestSessionExpiryInTransition extends ZkTestBase {
System.out.println("START " + clusterName + " at " + new Date(System.currentTimeMillis()));
- MockParticipantManager[] participants = new MockParticipantManager[5];
+ MockParticipant[] participants = new MockParticipant[5];
TestHelper.setupCluster(clusterName, _zkaddr, 12918, // participant port
"localhost", // participant name prefix
@@ -84,15 +88,15 @@ public class TestSessionExpiryInTransition extends ZkTestBase {
"MasterSlave", true); // do rebalance
// start controller
- ClusterControllerManager controller =
- new ClusterControllerManager(_zkaddr, clusterName, "controller_0");
+ MockController controller =
+ new MockController(_zkaddr, clusterName, "controller_0");
controller.syncStart();
// start participants
for (int i = 0; i < 5; i++) {
String instanceName = "localhost_" + (12918 + i);
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
- participants[i].setTransition(new SessionExpiryTransition());
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
+ participants[i].setTransition(new SessionExpiryTransition(participants[i]));
participants[i].syncStart();
}
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestSharedConnection.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestSharedConnection.java b/helix-core/src/test/java/org/apache/helix/integration/TestSharedConnection.java
index 665db05..8b77ce7 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestSharedConnection.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestSharedConnection.java
@@ -25,6 +25,7 @@ import java.util.Map;
import org.apache.helix.HelixAdmin;
import org.apache.helix.HelixConnection;
import org.apache.helix.HelixController;
+import org.apache.helix.HelixManager;
import org.apache.helix.HelixParticipant;
import org.apache.helix.TestHelper;
import org.apache.helix.api.State;
@@ -33,7 +34,7 @@ import org.apache.helix.api.id.ControllerId;
import org.apache.helix.api.id.ParticipantId;
import org.apache.helix.api.id.PartitionId;
import org.apache.helix.api.id.StateModelDefId;
-import org.apache.helix.manager.zk.HelixConnectionAdaptor;
+import org.apache.helix.manager.zk.ZKHelixManager;
import org.apache.helix.manager.zk.ZkHelixConnection;
import org.apache.helix.manager.zk.ZkHelixLeaderElection;
import org.apache.helix.model.IdealState;
@@ -180,7 +181,7 @@ public class TestSharedConnection extends ZkTestBase {
// Now verify that exactly one is leader
int leaderCount = 0;
for (HelixController controller : controllers) {
- HelixConnectionAdaptor adaptor = new HelixConnectionAdaptor(controller);
+ HelixManager adaptor = new ZKHelixManager(controller);
boolean result = ZkHelixLeaderElection.tryUpdateController(adaptor);
if (result) {
leaderCount++;
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestStandAloneCMMain.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestStandAloneCMMain.java b/helix-core/src/test/java/org/apache/helix/integration/TestStandAloneCMMain.java
index c1854c8..9c012a7 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestStandAloneCMMain.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestStandAloneCMMain.java
@@ -25,7 +25,7 @@ import org.apache.helix.HelixDataAccessor;
import org.apache.helix.PropertyKey;
import org.apache.helix.TestHelper;
import org.apache.helix.TestHelper.Verifier;
-import org.apache.helix.integration.manager.ClusterControllerManager;
+import org.apache.helix.manager.zk.MockController;
import org.apache.helix.manager.zk.ZKHelixDataAccessor;
import org.apache.helix.model.LiveInstance;
import org.apache.helix.tools.ClusterStateVerifier;
@@ -39,10 +39,10 @@ public class TestStandAloneCMMain extends ZkStandAloneCMTestBase {
@Test()
public void testStandAloneCMMain() throws Exception {
logger.info("RUN testStandAloneCMMain() at " + new Date(System.currentTimeMillis()));
- ClusterControllerManager newController = null;
+ MockController newController = null;
for (int i = 1; i <= 2; i++) {
String controllerName = "controller_" + i;
- newController = new ClusterControllerManager(_zkaddr, CLUSTER_NAME, controllerName);
+ newController = new MockController(_zkaddr, CLUSTER_NAME, controllerName);
newController.syncStart();
}
http://git-wip-us.apache.org/repos/asf/helix/blob/02165c52/helix-core/src/test/java/org/apache/helix/integration/TestStandAloneCMSessionExpiry.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestStandAloneCMSessionExpiry.java b/helix-core/src/test/java/org/apache/helix/integration/TestStandAloneCMSessionExpiry.java
index da93e12..30c67c8 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestStandAloneCMSessionExpiry.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestStandAloneCMSessionExpiry.java
@@ -23,10 +23,9 @@ import java.util.Date;
import org.apache.helix.TestHelper;
import org.apache.helix.ZkTestHelper;
-import org.apache.helix.integration.manager.ClusterControllerManager;
-import org.apache.helix.integration.manager.MockParticipantManager;
+import org.apache.helix.manager.zk.MockParticipant;
+import org.apache.helix.manager.zk.MockController;
import org.apache.helix.testutil.ZkTestBase;
-import org.apache.helix.tools.ClusterSetup;
import org.apache.helix.tools.ClusterStateVerifier;
import org.apache.log4j.Logger;
import org.testng.Assert;
@@ -47,15 +46,15 @@ public class TestStandAloneCMSessionExpiry extends ZkTestBase {
TestHelper.setupCluster(clusterName, _zkaddr, 12918, "localhost", "TestDB", 1, 20, 5, 3,
"MasterSlave", true);
- MockParticipantManager[] participants = new MockParticipantManager[5];
+ MockParticipant[] participants = new MockParticipant[5];
for (int i = 0; i < 5; i++) {
String instanceName = "localhost_" + (12918 + i);
- participants[i] = new MockParticipantManager(_zkaddr, clusterName, instanceName);
+ participants[i] = new MockParticipant(_zkaddr, clusterName, instanceName);
participants[i].syncStart();
}
- ClusterControllerManager controller =
- new ClusterControllerManager(_zkaddr, clusterName, "controller_0");
+ MockController controller =
+ new MockController(_zkaddr, clusterName, "controller_0");
controller.syncStart();
boolean result;
@@ -65,7 +64,7 @@ public class TestStandAloneCMSessionExpiry extends ZkTestBase {
Assert.assertTrue(result);
// participant session expiry
- MockParticipantManager participantToExpire = participants[1];
+ MockParticipant participantToExpire = participants[1];
System.out.println("Expire participant session");
String oldSessionId = participantToExpire.getSessionId();
|