hu.mta.sztaki.lpds.cloud.simulator.iaas.vmscheduling
Class FirstFitScheduler

java.lang.Object
  extended by hu.mta.sztaki.lpds.cloud.simulator.iaas.vmscheduling.Scheduler
      extended by hu.mta.sztaki.lpds.cloud.simulator.iaas.vmscheduling.FirstFitScheduler
Direct Known Subclasses:
NonQueueingScheduler, RandomScheduler, RoundRobinScheduler, SmallestFirstScheduler

public class FirstFitScheduler
extends Scheduler

This class implements one of the simplest VM schedulers: it places every VM on the first PM that would actually accept it. The scheduler does not rearrange the queue, thus if there would be some queued entities that would be possible to schedule this scheduler just ignores them until they reach the head of the queue.

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

Nested Class Summary
 
Nested classes/interfaces inherited from class hu.mta.sztaki.lpds.cloud.simulator.iaas.vmscheduling.Scheduler
Scheduler.QueueingEvent
 
Field Summary
private  PMIterator it
          the iterator of the running PMs allowing to easily traverse the PM set in a predefined order.
(package private)  PhysicalMachine.ResourceAllocation raBiggestNotSuitable
          the largest allocation that was possible to collect from all running PMs in the infrastructure.
(package private)  PhysicalMachine.ResourceAllocation[] ras
          The set of resource allocations made for the current VM request (this is important for multi VM requests)
 
Fields inherited from class hu.mta.sztaki.lpds.cloud.simulator.iaas.vmscheduling.Scheduler
freeCapacity, parent, pmComparator, pmstateChanged, publicTQ, queue
 
Constructor Summary
FirstFitScheduler(IaaSService parent)
          the constructor of the scheduler that passes on the parent IaaS service and initiates the basic PM iterator for this scheduler which will
 
Method Summary
protected  PMIterator getPMIterator()
          Resets the iterator then offers it to the caller
protected  PMIterator instantiateIterator()
          Allows the customization of the PM iterator by subclasses.
protected  ConstantConstraints scheduleQueued()
          The actual first fit scheduling implementation.
 
Methods inherited from class hu.mta.sztaki.lpds.cloud.simulator.iaas.vmscheduling.Scheduler
dropVMrequest, getQueuedVMs, getQueueLength, getTotalQueued, manageQueueRemoval, manageQueueRemoval, scheduleVMrequest, subscribeQueueingEvents, unsubscribeQueueingEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ras

PhysicalMachine.ResourceAllocation[] ras
The set of resource allocations made for the current VM request (this is important for multi VM requests)


raBiggestNotSuitable

PhysicalMachine.ResourceAllocation raBiggestNotSuitable
the largest allocation that was possible to collect from all running PMs in the infrastructure. this is important to determine the amount of resources that need to become free before the scheduler would be able to place the head of the queue to any of the PMs in the infrastructure.


it

private final PMIterator it
the iterator of the running PMs allowing to easily traverse the PM set in a predefined order. The iterator plays a crucial role in this implementation as several FirstFit derivatives only differ in their handling of the PMs.

Constructor Detail

FirstFitScheduler

public FirstFitScheduler(IaaSService parent)
the constructor of the scheduler that passes on the parent IaaS service and initiates the basic PM iterator for this scheduler which will

Parameters:
parent -
Method Detail

instantiateIterator

protected PMIterator instantiateIterator()
Allows the customization of the PM iterator by subclasses. This function is not intended to be used by anything else but the constructor of this class.

Returns:
the desired PM iterator to be used for traversing the PMs while doing the scheduling

getPMIterator

protected PMIterator getPMIterator()
Resets the iterator then offers it to the caller

Returns:
the PMIterator that is ready to be used during the scheduling process

scheduleQueued

protected ConstantConstraints scheduleQueued()
The actual first fit scheduling implementation. This implementation supports requests with multiple VMs. It assumes that users want to deploy all VMs or nothing so it waits until all VMs could be deployed at once.

Specified by:
scheduleQueued in class Scheduler
Returns:
the amount of free resources that the IaaS service needs to offer before this scheduler could actually proceed with its next VM placement.


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