|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthu.mta.sztaki.lpds.cloud.simulator.DeferredEvent
hu.mta.sztaki.lpds.cloud.simulator.iaas.PhysicalMachine.ResourceAllocation
public class PhysicalMachine.ResourceAllocation
This class is strongly connected with the physical machine's class, the two are collaborating to allow a fluid and minimal hassle operation of allocating resources on a PM. This allocation is then later on expected to be used by virtual machines to use. Before resource allocations are used they are allocated for a fixed amount of time. Thus if a user forgets about the allocation, the PMs resources are not occupied forever.
Field Summary | |
---|---|
ResourceConstraints |
allocated
The resource set that is virtually offered to the VM that uses this allocation. |
private int |
myPromisedIndex
The index of this allocation in the allocation list located in the PM. |
private ResourceConstraints |
realAllocated
The resource set that is actually reserved on the PM. |
private boolean |
swept
If the resource allocation is not used before its expiry time then this is going to be true! |
private VirtualMachine |
user
The VM that utilizes the allocation in question |
Constructor Summary | |
---|---|
private |
PhysicalMachine.ResourceAllocation(ResourceConstraints realAlloc,
ResourceConstraints alloc,
int until)
The constructor of the resource allocation to be used by the physical machine only! |
Method Summary | |
---|---|
void |
cancel()
if a resource allocation is no longer needed (e.g. |
protected void |
eventAction()
This function is called by deferred event when the allocation is expired. |
PhysicalMachine |
getHost()
Allows to determine the Physical Machine the particular allocation is bound to. |
boolean |
isAvailable()
Determines if the allocation is still available to use |
boolean |
isUnUsed()
Allows users to determine if the allocation is already taken by a VM. |
private void |
promisedCapacityUpdater()
updates the PM's respective fields about resource availability |
(package private) void |
release()
If a VM no longer needs the resources then this function must be called. |
void |
stateChanged(VirtualMachine vm,
VirtualMachine.State oldState,
VirtualMachine.State newState)
This function is called by the user VM if it is switching states. |
String |
toString()
Shows basic information about the allocation useful for debugging |
(package private) void |
use(VirtualMachine vm)
To complete the allocation process the VM must be told to use a particular allocation (e.g. |
Methods inherited from class hu.mta.sztaki.lpds.cloud.simulator.DeferredEvent |
---|
isCancelled |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final ResourceConstraints allocated
private final ResourceConstraints realAllocated
private VirtualMachine user
private final int myPromisedIndex
private boolean swept
Constructor Detail |
---|
private PhysicalMachine.ResourceAllocation(ResourceConstraints realAlloc, ResourceConstraints alloc, int until)
realAlloc
- defines the actually reserved resources with the
allocationalloc
- defines the promised resources for the useruntil
- defines the duration in ticks for which the allocation
will be kept for the user. This period is useful to allow
advanced scheduling operations where some resources are
occupied in advance in order to ensure rapid VM creation.Method Detail |
---|
protected void eventAction()
eventAction
in class DeferredEvent
private void promisedCapacityUpdater()
public void cancel()
cancel
in class DeferredEvent
void use(VirtualMachine vm) throws VMManager.VMManagementException
vm
- the virtual machine that will use the allocated resources
in the future
VMManagementException
- if the allocation passed to the VM is already expired or
if the allocation is already used by some VM.
VMManager.VMManagementException
public void stateChanged(VirtualMachine vm, VirtualMachine.State oldState, VirtualMachine.State newState)
stateChanged
in interface VirtualMachine.StateChange
oldState
- the state before the change was issuednewState
- the state after the change took effectvoid release()
public boolean isUnUsed()
public boolean isAvailable()
public String toString()
toString
in class Object
public PhysicalMachine getHost()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |