Pe

public interface Pe extends ChangeableId, ResourceManageable

A interface to be implemented by each class that provides the basic features of a virtual or physical Processing Element (PE) of a PM or VM. Each Pe represents a virtual or physical processor core.

It also implements the Null Object Design Pattern in order to start avoiding NullPointerException when using the Pe.NULL object instead of attributing null to Pe variables.

Author:Manzur Murshed, Rajkumar Buyya, Manoel Campos da Silva Filho

Fields

NULL

Pe NULL

An attribute that implements the Null Object Design Pattern for Pe objects.

Methods

getCapacity

long getCapacity()

Gets the capacity of this Pe in MIPS (Million Instructions Per Second).

Returns:the MIPS capacity

getPeProvisioner

PeProvisioner getPeProvisioner()

Gets the PE provisioner that manages the allocation of this physical PE to virtual machines.

Returns:the PE provisioner

getStatus

Status getStatus()

Gets the status of the PE.

Returns:the PE status

isBuzy

boolean isBuzy()

Checks if the PE is buzy to be used (it’s being used).

isFailed

boolean isFailed()

Checks if the PE is failed.

isFree

boolean isFree()

Checks if the PE is free to be used (it’s idle).

isWorking

boolean isWorking()

Checks if the PE is working (not failed).

setCapacity

boolean setCapacity(long mipsCapacity)

Sets the capacity of this Pe in MIPS (Million Instructions Per Second).

Parameters:
  • mipsCapacity – the MIPS capacity to set
Returns:

true if mipsCapacity > 0, false otherwise

setCapacity

boolean setCapacity(double mipsCapacity)

Sets the capacity of this Pe in MIPS (Million Instructions Per Second).

It receives the amount of MIPS as a double value but converts it internally to a long. The method is just provided as a handy-way to define the PE capacity using a double value that usually is generated from some computations.

Parameters:
  • mipsCapacity – the MIPS capacity to set
Returns:

true if mipsCapacity > 0, false otherwise

setPeProvisioner

Pe setPeProvisioner(PeProvisioner peProvisioner)

Sets the getPeProvisioner() that manages the allocation of this physical PE to virtual machines. This method is automatically called when a PeProvisioner is created passing a Pe instance. Thus, the PeProvisioner for a Pe doesn’t have to be set manually.

Parameters:
  • peProvisioner – the new PE provisioner

setStatus

boolean setStatus(Status status)

Sets the status of the PE.

Parameters:
  • status – the new PE status
Returns:

true if the status was set, false otherwise