public class RebalancingUtils extends Object
Constructor and Description |
---|
RebalancingUtils() |
public static String puInstancesToString(Collection<ProcessingUnitInstance> instances)
public static GridServiceContainer[] getReplicationSourceContainers(ProcessingUnitInstance instance)
public static boolean isProcessingUnitIntact(ProcessingUnit pu, GridServiceContainer[] containers)
public static boolean isProcessingUnitHasMinimumNumberOfInstancesPerPartition(ProcessingUnit pu, int minimumNumberOfInstancesPerPartition)
public static boolean isProcessingUnitPartitionIntact(ProcessingUnitInstance instance)
public static boolean isProcessingUnitIntact(ProcessingUnit pu)
public static boolean isProcessingUnitPartitionIntact(ProcessingUnit pu, int instanceId, GridServiceContainer[] containers)
public static Set<ProcessingUnitInstance> getOtherInstancesFromSamePartition(ProcessingUnitInstance instance)
public static Set<ProcessingUnitInstance> getOtherInstancesFromSamePartitionInContainer(GridServiceContainer container, ProcessingUnitInstance instance)
public static Set<ProcessingUnitInstance> getOtherInstancesFromSamePartitionInMachine(Machine machine, ProcessingUnitInstance puInstance)
public static boolean isEvenlyDistributedAcrossMachines(ProcessingUnit pu, CapacityRequirementsPerAgent aggregatedAllocatedCapacity)
public static boolean isRestartRecommended(ProcessingUnit pu, Machine source, Machine target, Fraction optimalCpuCoresPerPrimary, CapacityRequirementsPerAgent allocatedCapacity)
public static GridServiceContainer[] getContainersOnMachines(ProcessingUnit pu)
public static boolean isEvenlyDistributedAcrossContainers(ProcessingUnit pu, GridServiceContainer[] containers)
public static Machine[] getMachinesHostingContainers(GridServiceContainer[] containers)
public static int getPlannedMinimumNumberOfInstancesForContainer(GridServiceContainer container, GridServiceContainer[] approvedContainers, ProcessingUnit pu)
container
- - the container for which planned min number of instances is
requestedapprovedContainers
- - the containers approved for deployment for the specified pupu
- - the processing unitpublic static int getPlannedMaximumNumberOfInstancesForContainer(GridServiceContainer container, GridServiceContainer[] approvedContainers, ProcessingUnit pu)
container
- - the container for which planned min number of instances is
requestedapprovedContainers
- - the containers approved for deployment for the specified pupu
- - the processing unitpublic static List<GridServiceContainer> sortAllContainersByNumberOfInstancesAboveMinimum(ProcessingUnit pu, GridServiceContainer[] approvedContainers)
getPlannedMinimumNumberOfInstancesForContainer(GridServiceContainer,
GridServiceContainer[], ProcessingUnit)
public static List<Machine> sortMachinesByNumberOfPrimaryInstancesPerCpuCore(ProcessingUnit pu, Machine[] machines, CapacityRequirementsPerAgent allocatedCapacity)
public static Fraction getNumberOfPrimaryInstancesPerCpuCore(ProcessingUnit pu, Machine machine, CapacityRequirementsPerAgent allocatedCapacity)
public static int getNumberOfPrimaryInstancesOnMachine(ProcessingUnit pu, Machine machine)
public static FutureStatefulProcessingUnitInstance restartProcessingUnitInstanceAsync(ProcessingUnitInstance candidateInstance, org.apache.commons.logging.Log logger, long timeout, TimeUnit timeUnit)
public static Fraction getAverageCpuCoresPerPrimary(ProcessingUnit pu, CapacityRequirementsPerAgent aggregatedAllocatedCapacity)
public static Fraction getNumberOfCpuCores(Machine machine, CapacityRequirementsPerAgent allocatedCapacity)
public static String puInstanceToString(ProcessingUnitInstance instance)
public static String gscToString(GridComponent container)
public static String gscsToString(List<GridServiceContainer> containers)
public static String processingUnitDeploymentToString(ProcessingUnit pu)
Copyright © GigaSpaces.