hu.mta.sztaki.lpds.cloud.simulator.iaas.pmscheduling
Class SchedulingDependentMachines.CapacityChangeManager

java.lang.Object
  extended by hu.mta.sztaki.lpds.cloud.simulator.iaas.pmscheduling.SchedulingDependentMachines.CapacityChangeManager
All Implemented Interfaces:
PhysicalMachine.StateChangeListener, VMManager.CapacityChangeEvent<ResourceConstraints>
Enclosing class:
SchedulingDependentMachines

private class SchedulingDependentMachines.CapacityChangeManager
extends Object
implements VMManager.CapacityChangeEvent<ResourceConstraints>, PhysicalMachine.StateChangeListener

The main PM control mechanisms are implemented in this class The class basically controls a single PM. It switches off its PM when the PM's free resources reach its complete resource set and there are no VM requests queuing at the IaaS service's VM scheduler.

Author:
"Gabor Kecskemeti, Distributed and Parallel Systems Group, University of Innsbruck (c) 2013" "Gabor Kecskemeti, Laboratory of Parallel and Distributed Systems, MTA SZTAKI (c) 2012"

Field Summary
(package private)  PhysicalMachine observed
          the physical machine that this capacity manager will target with its operations
 
Constructor Summary
SchedulingDependentMachines.CapacityChangeManager(PhysicalMachine pm)
          This constructor is expected to be used once a PM is registered to the parent IaaSService.
 
Method Summary
private  void cancelEvents()
          if the PM gets dropped from the parent IaaSService then we no longer need to control its behavior.
 void capacityChanged(ResourceConstraints newCapacity, List<ResourceConstraints> newlyFreeCapacities)
          This function is called when the observed PM has newly freed up resources.
 void stateChanged(PhysicalMachine pm, PhysicalMachine.State oldState, PhysicalMachine.State newState)
          This function is called when the PM's power state changes.
private  void switchoffmachine()
          Allows the observed PM to be switched off and its exceptions handled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

observed

final PhysicalMachine observed
the physical machine that this capacity manager will target with its operations

Constructor Detail

SchedulingDependentMachines.CapacityChangeManager

public SchedulingDependentMachines.CapacityChangeManager(PhysicalMachine pm)
This constructor is expected to be used once a PM is registered to the parent IaaSService. From that point on the newly registered PM will be considered for switching off/turning on.

Parameters:
pm - the PM to be managed to follow the demand patterns of the VM requests to the IaaSService.
Method Detail

cancelEvents

private void cancelEvents()
if the PM gets dropped from the parent IaaSService then we no longer need to control its behavior. So the class's active behavior is disabled by calling this function.


switchoffmachine

private void switchoffmachine()
Allows the observed PM to be switched off and its exceptions handled


capacityChanged

public void capacityChanged(ResourceConstraints newCapacity,
                            List<ResourceConstraints> newlyFreeCapacities)
This function is called when the observed PM has newly freed up resources. It ensures that the PM is switched off if the PM is completely free and there are no more VMs queuing at the VM scheduler (i.e., there will be no chance to receive a new VM for the capacities of this PM).

Specified by:
capacityChanged in interface VMManager.CapacityChangeEvent<ResourceConstraints>
Parameters:
newCapacity - the size of the new capacity in terms of physical resources
newlyFreeCapacities - the list of those objects (representing the computing capacity of the particular VMManager) that were added/removed during the change

stateChanged

public void stateChanged(PhysicalMachine pm,
                         PhysicalMachine.State oldState,
                         PhysicalMachine.State newState)
This function is called when the PM's power state changes. This event handler manages situations when the PM is turned on but there are no longer tasks for it. Also, it initiates a new PM's switchon if the newly switched on machine will not be enough to host the queued VM requests found at the VM scheduler of the parent IaaS service.

Specified by:
stateChanged in interface PhysicalMachine.StateChangeListener
Parameters:
pm - the physical machine that is involved in the state change
oldState - the state the PM was in before this state change event was delivered
newState - the new state the PM will be in after the event is complete


Copyright © 2012–2015 University of Innsbruck & MTA SZTAKI. All rights reserved.