GigaSpaces XAP 10.0.1 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()
           
 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 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinPackingSolver

public BinPackingSolver()
Method Detail

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


GigaSpaces XAP 10.0.1 API

Copyright © GigaSpaces.