GigaSpaces XAP 9.7.2 API

org.openspaces.grid.gsm.machines
Class BinPackingSolver

java.lang.Object
  extended by org.openspaces.grid.gsm.machines.BinPackingSolver

public class BinPackingSolver
extends Object

A greedy 2D bin packing algorithm.

Author:
itaif

Constructor Summary
BinPackingSolver()
           
 
Method Summary
 CapacityRequirementsPerAgent getAllocatedCapacityForPu()
           
 CapacityRequirementsPerAgent getAllocatedCapacityResult()
           
 CapacityRequirementsPerAgent getDeallocatedCapacityResult()
           
 CapacityRequirementsPerAgent getUnallocatedCapacity()
           
 boolean isAllowMoreThanAverageMemoryPerMachine()
           
 void reset()
          cleans AllocatedResult and DeallocatedResult Used for unit testing
 void setAgentAllocationPriority(Map<String,Long> agentPriority)
          The higher the priority the less likely for the machine to be scaled in
 void setAllocatedCapacityForPu(CapacityRequirementsPerAgent allocatedCapacityForPu)
          Sets the currently allocated capacity of PU
 void setAllowMoreThanAverageMemoryPerMachine(boolean allowMoreThanAverageMemoryPerMachine)
           
 void setContainerMemoryCapacityInMB(long containerMemoryCapacityInMB)
          Sets the smallest unit of memory allocation.
 void setLogger(Log logger)
          Sets the processing unit specific logger
 void setMaxAllocatedMemoryCapacityOfPuInMB(long maxMemoryInMB)
          Sets the maximum total memory that can be allocated for PU
 void setMaxAllocatedMemoryCapacityOfPuPerMachineInMB(long maxMemoryCapacityPerMachineInMB)
          Sets the maximum total memory that can be allocated for PU on a single machine
 void setMinimumNumberOfMachines(int minimumNumberOfMachines)
          Used for high availability purposes to calculate maximum cpu and memory per machine.
 void setUnallocatedCapacity(CapacityRequirementsPerAgent unallocatedCapacity)
          Sets the remaining unallocated capacity on existing agents.
 void solveManualCapacityScaleIn(CapacityRequirements capacityToDeallocate)
           
 void solveManualCapacityScaleOut(CapacityRequirements capacityToAllocate)
           
 void solveNumberOfMachines(int numberOfMachines)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BinPackingSolver

public BinPackingSolver()
Method Detail

isAllowMoreThanAverageMemoryPerMachine

public boolean isAllowMoreThanAverageMemoryPerMachine()

setAllowMoreThanAverageMemoryPerMachine

public void setAllowMoreThanAverageMemoryPerMachine(boolean allowMoreThanAverageMemoryPerMachine)

setMinimumNumberOfMachines

public void setMinimumNumberOfMachines(int minimumNumberOfMachines)
Used for high availability purposes to calculate maximum cpu and memory per machine. For example if min number of machines is 2, then max memory per machine is half of the total memory

Parameters:
minimumNumberOfMachines -

setLogger

public void setLogger(Log logger)
Sets the processing unit specific logger


setContainerMemoryCapacityInMB

public void setContainerMemoryCapacityInMB(long containerMemoryCapacityInMB)
Sets the smallest unit of memory allocation.


setUnallocatedCapacity

public void setUnallocatedCapacity(CapacityRequirementsPerAgent unallocatedCapacity)
Sets the remaining unallocated capacity on existing agents.


setAgentAllocationPriority

public void setAgentAllocationPriority(Map<String,Long> agentPriority)
The higher the priority the less likely for the machine to be scaled in

Parameters:
agentPriority - - a map between agent UID and its priority

setAllocatedCapacityForPu

public void setAllocatedCapacityForPu(CapacityRequirementsPerAgent allocatedCapacityForPu)
Sets the currently allocated capacity of PU


setMaxAllocatedMemoryCapacityOfPuInMB

public void setMaxAllocatedMemoryCapacityOfPuInMB(long maxMemoryInMB)
Sets the maximum total memory that can be allocated for PU


setMaxAllocatedMemoryCapacityOfPuPerMachineInMB

public void setMaxAllocatedMemoryCapacityOfPuPerMachineInMB(long maxMemoryCapacityPerMachineInMB)
Sets the maximum total memory that can be allocated for PU on a single machine


solveManualCapacityScaleIn

public void solveManualCapacityScaleIn(CapacityRequirements capacityToDeallocate)

solveManualCapacityScaleOut

public void solveManualCapacityScaleOut(CapacityRequirements capacityToAllocate)

solveNumberOfMachines

public void solveNumberOfMachines(int numberOfMachines)

getAllocatedCapacityResult

public CapacityRequirementsPerAgent getAllocatedCapacityResult()

getDeallocatedCapacityResult

public CapacityRequirementsPerAgent getDeallocatedCapacityResult()

getAllocatedCapacityForPu

public CapacityRequirementsPerAgent getAllocatedCapacityForPu()

getUnallocatedCapacity

public CapacityRequirementsPerAgent getUnallocatedCapacity()

reset

public void reset()
cleans AllocatedResult and DeallocatedResult Used for unit testing


toString

public String toString()
Overrides:
toString in class Object

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.