Package org.apache.helix.controller.strategy

Examples of org.apache.helix.controller.strategy.AutoRebalanceStrategy


      LOG.info("maxPartition: " + maxPartition);
    }
    ReplicaPlacementScheme placementScheme = new DefaultPlacementScheme();
    placementScheme.init(_manager);
    _algorithm =
        new AutoRebalanceStrategy(resourceName, partitions, stateCountMap, maxPartition,
            placementScheme);
    ZNRecord newMapping =
        _algorithm.computePartitionAssignment(liveNodes, currentMapping, allNodes);

    if (LOG.isInfoEnabled()) {
View Full Code Here


      LOG.info("maxPartition: " + maxPartition);
    }
    ReplicaPlacementScheme placementScheme = new DefaultPlacementScheme();
    placementScheme.init(_manager);
    _algorithm =
        new AutoRebalanceStrategy(resourceName, partitions, stateCountMap, maxPartition,
            placementScheme);
    ZNRecord newMapping =
        _algorithm.computePartitionAssignment(liveNodes, currentMapping, allNodes);

    if (LOG.isInfoEnabled()) {
View Full Code Here

      allPreviousDecisionMap.putAll(currStateOutput.getPendingStateMap(resourceId, partition));
      currentMapping.put(partition, allPreviousDecisionMap);
    }

    // Get the assignment keyed on partition
    AutoRebalanceStrategy strategy =
        new AutoRebalanceStrategy(resourceId, partitions, states, Integer.MAX_VALUE,
            new AutoRebalanceStrategy.DefaultPlacementScheme());
    List<ParticipantId> allNodes =
        Lists.newArrayList(getEligibleInstances(jobCfg, currStateOutput, instances, cache));
    Collections.sort(allNodes);
    ZNRecord record = strategy.typedComputePartitionAssignment(allNodes, currentMapping, allNodes);
    Map<String, List<String>> preferenceLists = record.getListFields();

    // Convert to an assignment keyed on participant
    Map<ParticipantId, SortedSet<Integer>> taskAssignment = Maps.newHashMap();
    for (Map.Entry<String, List<String>> e : preferenceLists.entrySet()) {
View Full Code Here

      LOG.debug("allNodes: " + allParticipantList);
      LOG.debug("maxPartition: " + maxPartition);
    }
    ReplicaPlacementScheme placementScheme = new DefaultPlacementScheme();
    _algorithm =
        new AutoRebalanceStrategy(idealState.getResourceId(), partitions, stateCountMap,
            maxPartition, placementScheme);
    ZNRecord newMapping =
        _algorithm.typedComputePartitionAssignment(liveParticipantList, currentMapping,
            allParticipantList);
View Full Code Here

      LOG.info("allNodes: " + allParticipantList);
      LOG.info("maxPartition: " + maxPartition);
    }
    ReplicaPlacementScheme placementScheme = new DefaultPlacementScheme();
    _algorithm =
        new AutoRebalanceStrategy(config.getResourceId(), partitions, stateCountMap, maxPartition,
            placementScheme);
    ZNRecord newMapping =
        _algorithm.typedComputePartitionAssignment(liveParticipantList, currentMapping,
            allParticipantList);
View Full Code Here

        ConstraintBasedAssignment.stateCount(upperBounds, stateModelDef, participantSet.size(),
            getReplicaCount());
    ReplicaPlacementScheme placementScheme = new DefaultPlacementScheme();
    List<ParticipantId> participantList = new ArrayList<ParticipantId>(participantSet);
    List<PartitionId> partitionList = new ArrayList<PartitionId>(getPartitionSet());
    AutoRebalanceStrategy strategy =
        new AutoRebalanceStrategy(ResourceId.from(""), partitionList, stateCounts,
            getMaxPartitionsPerParticipant(), placementScheme);
    Map<String, List<String>> rawPreferenceLists =
        strategy.typedComputePartitionAssignment(participantList, currentMapping, participantList)
            .getListFields();
    Map<PartitionId, List<ParticipantId>> preferenceLists =
        Maps.newHashMap(IdealState.preferenceListsFromStringLists(rawPreferenceLists));
    setPreferenceLists(preferenceLists);
  }
View Full Code Here

        ConstraintBasedAssignment.stateCount(upperBounds, stateModelDef, participantSet.size(),
            getReplicaCount());
    ReplicaPlacementScheme placementScheme = new DefaultPlacementScheme();
    List<ParticipantId> participantList = new ArrayList<ParticipantId>(participantSet);
    List<PartitionId> partitionList = new ArrayList<PartitionId>(getPartitionSet());
    AutoRebalanceStrategy strategy =
        new AutoRebalanceStrategy(ResourceId.from(""), partitionList, stateCounts,
            getMaxPartitionsPerParticipant(), placementScheme);
    Map<String, Map<String, String>> rawPreferenceMaps =
        strategy.typedComputePartitionAssignment(participantList, currentMapping, participantList)
            .getMapFields();
    Map<PartitionId, Map<ParticipantId, State>> preferenceMaps =
        Maps.newHashMap(ResourceAssignment.replicaMapsFromStringMaps(rawPreferenceMaps));
    setPreferenceMaps(preferenceMaps);
  }
View Full Code Here

      allPreviousDecisionMap.putAll(currStateOutput.getPendingStateMap(resourceId, partition));
      currentMapping.put(partition.getPartitionName(), allPreviousDecisionMap);
    }

    // Get the assignment keyed on partition
    AutoRebalanceStrategy strategy =
        new AutoRebalanceStrategy(resourceId, partitions, states, Integer.MAX_VALUE,
            new AutoRebalanceStrategy.DefaultPlacementScheme());
    List<String> allNodes =
        Lists.newArrayList(getEligibleInstances(jobCfg, currStateOutput, instances, cache));
    Collections.sort(allNodes);
    ZNRecord record = strategy.computePartitionAssignment(allNodes, currentMapping, allNodes);
    Map<String, List<String>> preferenceLists = record.getListFields();

    // Convert to an assignment keyed on participant
    Map<String, SortedSet<Integer>> taskAssignment = Maps.newHashMap();
    for (Map.Entry<String, List<String>> e : preferenceLists.entrySet()) {
View Full Code Here

      LOG.info("maxPartition: " + maxPartition);
    }
    ReplicaPlacementScheme placementScheme = new DefaultPlacementScheme();
    placementScheme.init(_manager);
    _algorithm =
        new AutoRebalanceStrategy(resourceName, partitions, stateCountMap, maxPartition,
            placementScheme);
    ZNRecord newMapping =
        _algorithm.computePartitionAssignment(liveNodes, currentMapping, allNodes);

    if (LOG.isInfoEnabled()) {
View Full Code Here

TOP

Related Classes of org.apache.helix.controller.strategy.AutoRebalanceStrategy

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.