Search in sources :

Example 1 with DelayedTransitionBase

use of org.apache.helix.integration.DelayedTransitionBase in project helix by apache.

the class TestP2PMessageSemiAuto method beforeClass.

@BeforeClass
public void beforeClass() throws InterruptedException {
    System.out.println("START " + getShortClassName() + " at " + new Date(System.currentTimeMillis()));
    // setup storage cluster
    _gSetupTool.addCluster(CLUSTER_NAME, true);
    for (int i = 0; i < PARTICIPANT_NUMBER; i++) {
        String instance = PARTICIPANT_PREFIX + "_" + (PARTICIPANT_START_PORT + i);
        _gSetupTool.addInstanceToCluster(CLUSTER_NAME, instance);
        _instances.add(instance);
    }
    // start dummy participants
    for (int i = 0; i < PARTICIPANT_NUMBER; i++) {
        MockParticipantManager participant = new MockParticipantManager(ZK_ADDR, CLUSTER_NAME, _instances.get(i));
        participant.setTransition(new DelayedTransitionBase(50));
        participant.syncStart();
        _participants.add(participant);
    }
    createDBInSemiAuto(_gSetupTool, CLUSTER_NAME, DB_NAME_1, _instances, BuiltInStateModelDefinitions.MasterSlave.name(), PARTITION_NUMBER, REPLICA_NUMBER);
    createDBInSemiAuto(_gSetupTool, CLUSTER_NAME, DB_NAME_2, _instances, BuiltInStateModelDefinitions.MasterSlave.name(), PARTITION_NUMBER, REPLICA_NUMBER);
    // start controller
    String controllerName = CONTROLLER_PREFIX + "_0";
    _controller = new ClusterControllerManager(ZK_ADDR, CLUSTER_NAME, controllerName);
    _controller.syncStart();
    _clusterVerifier = new BestPossibleExternalViewVerifier.Builder(CLUSTER_NAME).setZkClient(_gZkClient).build();
    Assert.assertTrue(_clusterVerifier.verify());
    _configAccessor = new ConfigAccessor(_gZkClient);
    _accessor = new ZKHelixDataAccessor(CLUSTER_NAME, _baseAccessor);
}
Also used : ClusterControllerManager(org.apache.helix.integration.manager.ClusterControllerManager) MockParticipantManager(org.apache.helix.integration.manager.MockParticipantManager) DelayedTransitionBase(org.apache.helix.integration.DelayedTransitionBase) BestPossibleExternalViewVerifier(org.apache.helix.tools.ClusterVerifiers.BestPossibleExternalViewVerifier) ConfigAccessor(org.apache.helix.ConfigAccessor) Date(java.util.Date) ZKHelixDataAccessor(org.apache.helix.manager.zk.ZKHelixDataAccessor) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

Date (java.util.Date)1 ConfigAccessor (org.apache.helix.ConfigAccessor)1 DelayedTransitionBase (org.apache.helix.integration.DelayedTransitionBase)1 ClusterControllerManager (org.apache.helix.integration.manager.ClusterControllerManager)1 MockParticipantManager (org.apache.helix.integration.manager.MockParticipantManager)1 ZKHelixDataAccessor (org.apache.helix.manager.zk.ZKHelixDataAccessor)1 BestPossibleExternalViewVerifier (org.apache.helix.tools.ClusterVerifiers.BestPossibleExternalViewVerifier)1 BeforeClass (org.testng.annotations.BeforeClass)1