Package org.apache.helix.controller.stages

Examples of org.apache.helix.controller.stages.ClusterDataCache.refresh()


    try
    {
      Builder keyBuilder = accessor.keyBuilder();
      // read cluster once and do verification
      ClusterDataCache cache = new ClusterDataCache();
      cache.refresh(accessor);

      Map<String, IdealState> idealStates = cache.getIdealStates();
      if (idealStates == null// || idealStates.isEmpty())
      {
        // ideal state is null because ideal state is dropped
View Full Code Here


    {
      HelixDataAccessor accessor = new ZKHelixDataAccessor( _clusterName, new ZkBaseDataAccessor(_client));
      Builder keyBuilder = accessor.keyBuilder();
      int numberOfPartitions = accessor.getProperty(keyBuilder.idealStates(_resourceName)).getRecord().getListFields().size();
      ClusterDataCache cache = new ClusterDataCache();
      cache.refresh(accessor);
      String masterValue = cache.getStateModelDef(cache.getIdealState(_resourceName).getStateModelDefRef()).getStatesPriorityList().get(0);
      int replicas = Integer.parseInt(cache.getIdealState(_resourceName).getReplicas());
      return verifyBalanceExternalView(accessor.getProperty(keyBuilder.externalView(_resourceName)).getRecord(), numberOfPartitions, masterValue, replicas, cache.getLiveInstances().size());
    }
View Full Code Here

      Map<String, Map<String, String>> errStates) {
    try {
      Builder keyBuilder = accessor.keyBuilder();
      // read cluster once and do verification
      ClusterDataCache cache = new ClusterDataCache();
      cache.refresh(accessor);

      Map<String, IdealState> idealStates = cache.getIdealStates();
      if (idealStates == null) // || idealStates.isEmpty())
      {
        // ideal state is null because ideal state is dropped
View Full Code Here

      Builder keyBuilder = accessor.keyBuilder();
      int numberOfPartitions =
          accessor.getProperty(keyBuilder.idealStates(_resourceName)).getRecord().getListFields()
              .size();
      ClusterDataCache cache = new ClusterDataCache();
      cache.refresh(accessor);
      String masterValue =
          cache.getStateModelDef(cache.getIdealState(_resourceName).getStateModelDefRef())
              .getStatesPriorityList().get(0);
      int replicas = Integer.parseInt(cache.getIdealState(_resourceName).getReplicas());
      String instanceGroupTag = cache.getIdealState(_resourceName).getInstanceGroupTag();
View Full Code Here

      for (String node : _liveNodes) {
        LiveInstance liveInstance = new LiveInstance(node);
        liveInstance.setSessionId("testSession");
        accessor.setProperty(keyBuilder.liveInstance(node), liveInstance);
      }
      cache.refresh(accessor);
      for (String partition : _partitions) {
        List<String> preferenceList = listResult.get(partition);
        Map<String, String> currentStateMap = _currentMapping.get(partition);
        Set<String> disabled = Collections.emptySet();
        Map<String, String> assignment =
View Full Code Here

                .size();
      } catch (Exception e) {
        return false;
      }
      ClusterDataCache cache = new ClusterDataCache();
      cache.refresh(accessor);

      IdealState idealState = cache.getIdealState(_resourceName);
      if (idealState == null) {
        return false;
      }
View Full Code Here

  }

  @Override
  public boolean verify() throws Exception {
    ClusterDataCache cache = new ClusterDataCache();
    cache.refresh(_accessor);

    List<String> liveInstances = new ArrayList<String>();
    liveInstances.addAll(cache.getLiveInstances().keySet());
    boolean success = verifyLiveNodes(liveInstances);
    if (!success) {
View Full Code Here

      Map<String, Map<String, String>> errStates, String clusterName, Set<String> resources) {
    try {
      Builder keyBuilder = accessor.keyBuilder();
      // read cluster once and do verification
      ClusterDataCache cache = new ClusterDataCache();
      cache.refresh(accessor);

      Map<String, IdealState> idealStates = cache.getIdealStates();
      if (idealStates == null) // || idealStates.isEmpty())
      {
        // ideal state is null because ideal state is dropped
View Full Code Here

      Builder keyBuilder = accessor.keyBuilder();
      int numberOfPartitions =
          accessor.getProperty(keyBuilder.idealStates(_resourceName)).getRecord().getListFields()
              .size();
      ClusterDataCache cache = new ClusterDataCache();
      cache.refresh(accessor);
      String masterValue =
          cache.getStateModelDef(cache.getIdealState(_resourceName).getStateModelDefRef())
              .getStatesPriorityList().get(0);
      int replicas = Integer.parseInt(cache.getIdealState(_resourceName).getReplicas());
      return verifyBalanceExternalView(accessor.getProperty(keyBuilder.externalView(_resourceName))
View Full Code Here

        Builder keyBuilder = accessor.keyBuilder();
        int numberOfPartitions =
            accessor.getProperty(keyBuilder.idealStates(_resourceName)).getRecord().getListFields()
                .size();
        ClusterDataCache cache = new ClusterDataCache();
        cache.refresh(accessor);
        String masterValue =
            cache.getStateModelDef(cache.getIdealState(_resourceName).getStateModelDefRef())
                .getStatesPriorityList().get(0);
        int replicas = Integer.parseInt(cache.getIdealState(_resourceName).getReplicas());
        String instanceGroupTag = cache.getIdealState(_resourceName).getInstanceGroupTag();
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.