Examples of typedComputePartitionAssignment()


Examples of org.apache.helix.controller.strategy.AutoRebalanceStrategy.typedComputePartitionAssignment()

        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

Examples of org.apache.helix.controller.strategy.AutoRebalanceStrategy.typedComputePartitionAssignment()

    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

Examples of org.apache.helix.controller.strategy.AutoRebalanceStrategy.typedComputePartitionAssignment()

    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
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.