Package org.apache.helix

Examples of org.apache.helix.HelixManager.addExternalViewChangeListener()


    Set<String> parentIds = node.getParentIds();
    ResourceId resourceId = message.getResourceId();
    int numPartitions = node.getNumPartitions();
    Task task =
        _taskFactory.createTask(resourceId.stringify(), parentIds, manager, _taskResultStore);
    manager.addExternalViewChangeListener(task);

    LOG.debug("Starting task for " + _partition + "...");
    int partitionNum = Integer.parseInt(_partition.split("_")[1]);
    task.execute(resourceId.stringify(), numPartitions, partitionNum);
    LOG.debug("Task for " + _partition + " done");
View Full Code Here


  public void testSpectator() throws Exception {
    HelixManager relayHelixManager =
        HelixManagerFactory.getZKHelixManager(CLUSTER_NAME, null, InstanceType.SPECTATOR, _zkaddr);

    relayHelixManager.connect();
    relayHelixManager.addExternalViewChangeListener(this);

    _setupTool.addResourceToCluster(CLUSTER_NAME, "NextDB", 64, STATE_MODEL);
    _setupTool.rebalanceStorageCluster(CLUSTER_NAME, "NextDB", 3);

    boolean result =
View Full Code Here

      if (notificationType == ChangeType.LIVE_INSTANCE) {
        manager.addLiveInstanceChangeListener(_particHolder);
      } else if (notificationType == ChangeType.CONFIG) {
        manager.addInstanceConfigChangeListener(_particHolder);
      } else if (notificationType == ChangeType.EXTERNAL_VIEW) {
        manager.addExternalViewChangeListener(_particHolder);
      } else {
        LOG.error("Unsupport notificationType:" + notificationType.toString());
      }
    }
  }
View Full Code Here

    Set<String> parentIds = node.getParentIds();
    ResourceId resourceId = message.getResourceId();
    int numPartitions = node.getNumPartitions();
    Task task =
        _taskFactory.createTask(resourceId.stringify(), parentIds, manager, _taskResultStore);
    manager.addExternalViewChangeListener(task);

    LOG.debug("Starting task for " + _partition + "...");
    int partitionNum = Integer.parseInt(_partition.split("_")[1]);
    task.execute(resourceId.stringify(), numPartitions, partitionNum);
    LOG.debug("Task for " + _partition + " done");
View Full Code Here

      if (notificationType == ChangeType.LIVE_INSTANCE) {
        manager.addLiveInstanceChangeListener(_particHolder);
      } else if (notificationType == ChangeType.CONFIG) {
        manager.addConfigChangeListener(_particHolder);
      } else if (notificationType == ChangeType.EXTERNAL_VIEW) {
        manager.addExternalViewChangeListener(_particHolder);
      } else {
        LOG.error("Unsupport notificationType:" + notificationType.toString());
      }
    }
  }
View Full Code Here

    Dag.Node node = Dag.Node.fromJson(json);
    Set<String> parentIds = node.getParentIds();
    String resourceName = message.getResourceName();
    int numPartitions = node.getNumPartitions();
    Task task = _taskFactory.createTask(resourceName, parentIds, manager, _taskResultStore);
    manager.addExternalViewChangeListener(task);

    LOG.debug("Starting task for " + _partition + "...");
    int partitionNum = Integer.parseInt(_partition.split("_")[1]);
    task.execute(resourceName, numPartitions, partitionNum);
    LOG.debug("Task for " + _partition + " done");
View Full Code Here

    Dag.Node node = Dag.Node.fromJson(json);
    Set<String> parentIds = node.getParentIds();
    String resourceName = message.getResourceName();
    int numPartitions = node.getNumPartitions();
    Task task = _taskFactory.createTask(resourceName, parentIds, manager, _taskResultStore);
    manager.addExternalViewChangeListener(task);
   
    LOG.debug("Starting task for " + _partition + "...");
    int partitionNum = Integer.parseInt(_partition.split("_")[1]);
    task.execute(resourceName, numPartitions, partitionNum);
    LOG.debug("Task for " + _partition + " done");
View Full Code Here

      {
        manager.addConfigChangeListener(_particHolder);
      }
      else if (notificationType == ChangeType.EXTERNAL_VIEW)
      {
        manager.addExternalViewChangeListener(_particHolder);
      }
      else
      {
        LOG.error("Unsupport notificationType:" + notificationType.toString());
      }
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.