|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthu.mta.sztaki.lpds.cloud.simulator.iaas.resourcemodel.ConsumptionEventAdapter
hu.mta.sztaki.lpds.cloud.simulator.iaas.PhysicalMachine.PowerStateDelayer
public class PhysicalMachine.PowerStateDelayer
This class handles the delays and activites during the power state change procedures (e.g., switching off/turning on)
Field Summary | |
---|---|
(package private) ResourceConsumption |
currentConsumption
What is the actual resource consumption (task) that is executed on the PM's direct consumer (i.e. |
private PhysicalMachine.State |
newState
The state that the delayer must switch to after the power state change has finished its activites. |
(package private) gnu.trove.list.linked.TDoubleLinkedList |
tasksDue
The list of tasks to do for the particular power state change. |
long |
transitionStart
when did the particular power state transition start |
Constructor Summary | |
---|---|
PhysicalMachine.PowerStateDelayer(double[] tasklist,
PhysicalMachine.State newPowerState)
The constructor of the delayer, it allows the specification of the tasks (that represent the boot/shutdown or similar operations) to be done before the power state can be achieved. |
Method Summary | |
---|---|
void |
addFurtherTasks(double[] tasklist)
if there seems to be further operations needed before the particular power state can be achieved then this function should be called. |
void |
conCancelled(ResourceConsumption problematic)
if we receive a cancelled event we consider it as an unexpected behavior and throw an exception. |
void |
conComplete()
the notification handler when a task from the tasklist is complete this handler actually sends the next task in. |
private void |
sendTask()
this function picks the next item (i.e. |
void |
setNewState(PhysicalMachine.State newState)
if after the list of tasks are completed we need to reach a different power state than initially planned then this is the function to go for. |
Methods inherited from class hu.mta.sztaki.lpds.cloud.simulator.iaas.resourcemodel.ConsumptionEventAdapter |
---|
isCancelled, isCompleted |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private PhysicalMachine.State newState
final gnu.trove.list.linked.TDoubleLinkedList tasksDue
public final long transitionStart
ResourceConsumption currentConsumption
Constructor Detail |
---|
public PhysicalMachine.PowerStateDelayer(double[] tasklist, PhysicalMachine.State newPowerState)
tasklist
- the tasks to execute in a serial order before the the
specific power state can be set.
IMPORTANT: For performance reasons, the list is handled
from its tailing:
newPowerState
- the power state to be set after completing all the above
tasks.Method Detail |
---|
private void sendTask()
public void conComplete()
conComplete
in interface ResourceConsumption.ConsumptionEvent
conComplete
in class ConsumptionEventAdapter
public void conCancelled(ResourceConsumption problematic)
conCancelled
in interface ResourceConsumption.ConsumptionEvent
conCancelled
in class ConsumptionEventAdapter
problematic
- the task that did not succeedpublic void addFurtherTasks(double[] tasklist)
tasklist
- the new tasks to be includedpublic void setNewState(PhysicalMachine.State newState)
newState
- the new power state to switch to after all tasks complete
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |