Package org.apache.helix.TestHelper

Examples of org.apache.helix.TestHelper.StartCMResult


    _setupTool.addResourceToCluster(CLUSTER_NAME, db2, 60, "OnlineOffline", IdealStateModeProperty.AUTO_REBALANCE+"");
   

    _setupTool.rebalanceStorageCluster(CLUSTER_NAME, db2, 1);
    String instance2 = "localhost_279699";
    StartCMResult result = TestHelper.startDummyProcess(ZK_ADDR, CLUSTER_NAME, instance2);
   
   
    Thread.sleep(500);
    Assert.assertFalse(result._thread.isAlive());
    Assert.assertTrue(null == manager.getHelixDataAccessor().getProperty(accessor.keyBuilder().liveInstance(instance2)));

    ConfigScope scope =
        new ConfigScopeBuilder().forCluster(CLUSTER_NAME)
                                .build();
   
    manager.getConfigAccessor().set(scope, ZKHelixManager.ALLOW_PARTICIPANT_AUTO_JOIN, "true");
   
    result =
        TestHelper.startDummyProcess(ZK_ADDR, CLUSTER_NAME, instance2);
   
    StartCMResult result2 =
        TestHelper.startDummyProcess(ZK_ADDR, CLUSTER_NAME, instance2);
   
    Thread.sleep(500);
    Assert.assertTrue(result._thread.isAlive() || result2._thread.isAlive());
    for(int i = 0; i< 20; i++)
View Full Code Here


        LOG.error("fail to start participant:" + instanceName
                     + "(participant with the same name already running");
      }
      else
      {
        StartCMResult result = TestHelper.startDummyProcess(ZK_ADDR, firstCluster,
                                                            instanceName);
        _startCMResultMap.put(instanceName, result);
      }
    }

    // start distributed cluster controllers
    for (int i = 0; i < 5; i++)
    {
      String controllerName = CONTROLLER_PREFIX + "_" + i;
      if (_startCMResultMap.get(controllerName) != null)
      {
        LOG.error("fail to start controller:" + controllerName
                     + "(controller with the same name already running");
      }
      else
      {
        StartCMResult result = TestHelper.startController(CONTROLLER_CLUSTER,
                                                                 controllerName,
                                                                 ZK_ADDR,
                                                                 HelixControllerMain.DISTRIBUTED);
        _startCMResultMap.put(controllerName, result);
      }
View Full Code Here

     *   3) disconnect leader/disconnect participant
     */
    String leader = getCurrentLeader(_gZkClient, CONTROLLER_CLUSTER);
    // pauseController(_startCMResultMap.get(leader)._manager.getDataAccessor());

    StartCMResult result;

    Iterator<Entry<String, StartCMResult>> it = _startCMResultMap.entrySet().iterator();

    while (it.hasNext())
    {
View Full Code Here

        LOG.error("fail to start particpant:" + instanceName
            + "(participant with same name already exists)");
      }
      else
      {
        StartCMResult result =
            TestHelper.startDummyProcess(ZK_ADDR, CLUSTER_NAME, instanceName);
        _startCMResultMap.put(instanceName, result);
      }
    }

    // start controller
    String controllerName = CONTROLLER_PREFIX + "_0";
    StartCMResult startResult =
        TestHelper.startController(CLUSTER_NAME,
                                   controllerName,
                                   ZK_ADDR,
                                   HelixControllerMain.STANDALONE);
    _startCMResultMap.put(controllerName, startResult);
View Full Code Here

    for (int i = 0; i < 2; i++)
    {
      String storageNodeName = PARTICIPANT_PREFIX + "_" + (1000 + i);
      _setupTool.addInstanceToCluster(CLUSTER_NAME, storageNodeName);
     
      StartCMResult resultx =
          TestHelper.startDummyProcess(ZK_ADDR, CLUSTER_NAME, storageNodeName.replace(':', '_'));
      _startCMResultMap.put(storageNodeName, resultx);
    }
    Thread.sleep(1000);
    result =
View Full Code Here

        LOG.error("fail to start particpant:" + instanceName
            + "(participant with same name already exists)");
      }
      else
      {
        StartCMResult result =
            TestHelper.startDummyProcess(ZK_ADDR, CLUSTER_NAME, instanceName);
        _startCMResultMap.put(instanceName, result);
      }
    }

    // start controller
    String controllerName = CONTROLLER_PREFIX + "_0";
    StartCMResult startResult =
        TestHelper.startController(CLUSTER_NAME,
                                   controllerName,
                                   ZK_ADDR,
                                   HelixControllerMain.STANDALONE);
    _startCMResultMap.put(controllerName, startResult);
View Full Code Here

  {
    /**
     * shutdown order: 1) disconnect the controller 2) disconnect participants
     */
  
    StartCMResult result;
    Iterator<Entry<String, StartCMResult>> it = _startCMResultMap.entrySet().iterator();
    while (it.hasNext())
    {
      String instanceName = it.next().getKey();
      if (instanceName.startsWith(CONTROLLER_PREFIX))
View Full Code Here

{
  @Test
  public void testDisconnectHistory() throws Exception
  {
    String controllerName = CONTROLLER_PREFIX + "_0";
    StartCMResult controllerResult = _startCMResultMap.get(controllerName);
    ZKHelixManager controller = (ZKHelixManager) controllerResult._manager;
    ZkStateChangeListener listener1 = new ZkStateChangeListener(controller, 5000, 10);
    // 11 disconnects in 5 sec
    for(int i = 0;i < 11; i++)
    {
View Full Code Here

      if (testInfo._startCMResultMap.containsKey(instanceName))
      {
        LOG.warn("Dummy participant:" + instanceName + " has already started; skip starting it");
      } else
      {
        StartCMResult result = TestHelper.startDummyProcess(ZK_ADDR, clusterName, instanceName);
        testInfo._startCMResultMap.put(instanceName, result);
        // testInfo._instanceStarted.countDown();
      }
    }
  }
View Full Code Here

      if (testInfo._startCMResultMap.containsKey(controllerName))
      {
        LOG.warn("Controller:" + controllerName + " has already started; skip starting it");
      } else
      {
        StartCMResult result = TestHelper.startController(clusterName, controllerName, ZK_ADDR,
            HelixControllerMain.STANDALONE);
        testInfo._startCMResultMap.put(controllerName, result);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.helix.TestHelper.StartCMResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.