Package org.apache.helix

Examples of org.apache.helix.HelixDataAccessor.keyBuilder()


   
    HealthStatsAggregationTask task = new HealthStatsAggregationTask(_startCMResultMap.get(controllerName)._manager);
    task.run();
    Thread.sleep(100);
    HelixDataAccessor helixDataAccessor = manager.getHelixDataAccessor();
    Builder keyBuilder = helixDataAccessor.keyBuilder();

    AlertHistory history = manager.getHelixDataAccessor().getProperty(keyBuilder.alertHistory());
    //
    Assert.assertEquals(history, null);
   
View Full Code Here


    _setupTool.getClusterManagementTool().addAlert(CLUSTER_NAME, _alertStr1);
    _setupTool.getClusterManagementTool().addAlert(CLUSTER_NAME, _alertStr2);

    int historySize = 0;
    HelixDataAccessor helixDataAccessor = manager.getHelixDataAccessor();
    Builder keyBuilder = helixDataAccessor.keyBuilder();
    HelixProperty property = helixDataAccessor.getProperty(keyBuilder.alertHistory());
    ZNRecord history = null;
    if(property != null)
    {
      history = property.getRecord();
View Full Code Here

        & testListener.idealStateChangeReceived & testListener.liveInstanceChangeReceived
        & testListener.messageChangeReceived);

    testListener.Reset();
    HelixDataAccessor accessor = testHelixManager.getHelixDataAccessor();
    Builder keyBuilder = accessor.keyBuilder();
   
    ExternalView extView = new ExternalView("db-12345");
    accessor.setProperty(keyBuilder.externalView("db-12345"), extView);
    Thread.sleep(100);
    AssertJUnit.assertTrue(testListener.externalViewChangeReceived);
View Full Code Here

  }

  // verify leader node
  BaseDataAccessor<ZNRecord> baseAccessor = new ZkBaseDataAccessor<ZNRecord>(_gZkClient);
  HelixDataAccessor accessor = new ZKHelixDataAccessor(grandClusterName, baseAccessor);
  LiveInstance controllerLeader = accessor.getProperty(accessor.keyBuilder()
          .controllerLeader());
  Assert.assertNotNull(controllerLeader,
          "controllerLeader should be either controller_9000 or controller_9001");
  Assert.assertTrue(controllerLeader.getInstanceName().startsWith("controller_900"));
View Full Code Here

  Assert.assertNotNull(controllerLeader,
          "controllerLeader should be either controller_9000 or controller_9001");
  Assert.assertTrue(controllerLeader.getInstanceName().startsWith("controller_900"));

  accessor = new ZKHelixDataAccessor(clusterName, baseAccessor);
  LiveInstance leader = accessor.getProperty(accessor.keyBuilder().controllerLeader());
  for (int i = 0; i < 20; i++) {
      if (leader != null) {
    break;
      }
      Thread.sleep(200);
View Full Code Here

  for (int i = 0; i < 20; i++) {
      if (leader != null) {
    break;
      }
      Thread.sleep(200);
      leader = accessor.getProperty(accessor.keyBuilder().controllerLeader());
  }
  Assert.assertTrue(leader.getInstanceName().startsWith("controller_900"));

  boolean verifyResult = ClusterStateVerifier
          .verifyByZkCallback(new MasterNbInExtViewVerifier(ZK_ADDR, clusterName));
View Full Code Here

  Thread.sleep(500);

  // save ideal state
  BaseDataAccessor<ZNRecord> baseAccessor = new ZkBaseDataAccessor<ZNRecord>(_gZkClient);
  HelixDataAccessor accessor = new ZKHelixDataAccessor(clusterName, baseAccessor);
  IdealState idealState = accessor.getProperty(accessor.keyBuilder().idealStates("db_11"));
  ZNRecordJsonSerializer serializer = new ZNRecordJsonSerializer();

  String tmpDir = System.getProperty("java.io.tmpdir");
  if (tmpDir == null) {
      tmpDir = "/tmp";
View Full Code Here

  verifyResult = ClusterStateVerifier.verifyByZkCallback(new BestPossAndExtViewZkVerifier(
          ZK_ADDR, clusterName));
  Assert.assertTrue(verifyResult);

  IdealState idealState2 = accessor.getProperty(accessor.keyBuilder().idealStates("db_11"));
  Assert.assertTrue(idealState2.getRecord().equals(idealState.getRecord()));

  // clean up
  // for (int i = 0; i < 2; i++) {
  // controllers[i].syncStop();
View Full Code Here

          + " localhost_1232 localhost_12320";
  ClusterSetup.processCommandLineArgs(command.split("\\s+"));

  BaseDataAccessor<ZNRecord> baseAccessor = new ZkBaseDataAccessor<ZNRecord>(_gZkClient);
  HelixDataAccessor accessor = new ZKHelixDataAccessor(clusterName, baseAccessor);
  String path = accessor.keyBuilder().instanceConfig("localhost_1232").getPath();
  Assert.assertFalse(_gZkClient.exists(path), path
          + " should not exist since localhost_1232 has been swapped by localhost_12320");

  System.out.println("END " + clusterName + " at " + new Date(System.currentTimeMillis()));
    }
View Full Code Here

          + " false";
  ClusterSetup.processCommandLineArgs(command.split("\\s+"));

  BaseDataAccessor<ZNRecord> baseAccessor = new ZkBaseDataAccessor<ZNRecord>(_gZkClient);
  HelixDataAccessor accessor = new ZKHelixDataAccessor(clusterName, baseAccessor);
  String path = accessor.keyBuilder().controllerLeader().getPath();
  for (int i = 0; i < 10; i++) {
      Thread.sleep(1000);
      if (!_gZkClient.exists(path)) {
    break;
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.