GridComputing
Job Management in Grid Computing
|
#include <job.h>
Classes | |
struct | PriorityLess |
Job::PriorityLess struct. More... | |
Public Member Functions | |
Job (uint id) | |
"Search" Constructor | |
Job (const std::string &name, uint8 priority, double requiredRAM, double requiredDiskSpace, uint executionTime) | |
Constructor. | |
uint | GetId () const |
void | SetId (uint val) |
const std::string & | GetName () const |
Returns the name of the Job. | |
uint8 | GetPriority () const |
Returns the priority of the Job. | |
void | SetPriority (uint8 val) |
Sets job's priority with val. | |
double | GetRequiredRAM () const |
Returns the required amount of RAM (MB) | |
double | GetRequiredDiskSpace () const |
Returns the required amount of disk space (MB) | |
uint | GetTotalExecutionTime () const |
Returns the total number of seconds to execute the Job. | |
uint | GetElapsedTime () const |
Returns the number of seconds since the Job was created. | |
double | GetPrice () const |
Returns the price of the Job (5 cents per MB of RAM) | |
bool | Finished () const |
Returns true if the Job finished. | |
void | Finish () |
Forces the Job to abruptly end. | |
bool | Save (ByteBuffer &bb) const override |
Saves Job data to a ByteBuffer. | |
void | Update (uint32 diff) |
Updates Jobs timers. | |
void | Print (std::ostream &os=std::cout) const override |
Representation of the class in a row form. | |
void | PrintWithId (std::ostream &os=std::cout) const |
void | AddRequiredSoftware (const Software &sw) |
bool | IsRequiredSoftware (const Software &sw) const |
Deletes Software from the set of required Software. | |
const SoftwareSet & | GetRequiredSoftware () const |
Returns the set of required Software. | |
Static Public Member Functions | |
static Job * | Load (ByteBuffer &bb) |
Loads a Job from a ByteBuffer. | |
static void | PrintHeader (std::ostream &os=std::cout, bool withId=false) |
Private Member Functions | |
Job (const Job &) | |
Job & | operator= (Job const &) |
Private Attributes | |
const double | _requiredRAM |
Amount of required RAM to execute the Job (MB) | |
const double | _requiredDiskSpace |
Amount of required disk space to execute the Job (MB) | |
const uint | _totalExecutionTime |
The total number of seconds to execute the Job. | |
uint | _elapsedTime |
The number of seconds since the Job was created. | |
uint | _ms |
Helper member to count the number of milliseconds since _elapsedTime was changed. | |
SoftwareSet | _requiredSoftware |
Set of required software to execute the Job. | |
uint8 | _priority |
Priority. | |
const std::string | _name |
Name of the job. | |
uint | _id |
Static Private Attributes | |
static uint | _maxNameLength = 0 |
Length of the biggest name. | |
Job::Job | ( | uint | id | ) |
"Search" Constructor
Job::Job | ( | const std::string & | name, |
uint8 | priority, | ||
double | requiredRAM, | ||
double | requiredDiskSpace, | ||
uint | executionTime | ||
) |
Constructor.
|
private |
void Job::Finish | ( | ) |
Forces the Job to abruptly end.
bool Job::Finished | ( | ) | const |
Returns true if the Job finished.
uint Job::GetId | ( | ) | const |
const std::string& Job::GetName | ( | ) | const |
Returns the name of the Job.
double Job::GetPrice | ( | ) | const |
Returns the price of the Job (5 cents per MB of RAM)
double Job::GetRequiredDiskSpace | ( | ) | const |
Returns the required amount of disk space (MB)
double Job::GetRequiredRAM | ( | ) | const |
Returns the required amount of RAM (MB)
const SoftwareSet& Job::GetRequiredSoftware | ( | ) | const |
Returns the set of required Software.
bool Job::IsRequiredSoftware | ( | const Software & | sw | ) | const |
|
static |
Loads a Job from a ByteBuffer.
|
overridevirtual |
|
static |
void Job::PrintWithId | ( | std::ostream & | os = std::cout | ) | const |
|
overridevirtual |
Saves Job data to a ByteBuffer.
Implements ISave.
void Job::SetId | ( | uint | val | ) |
void Job::SetPriority | ( | uint8 | val | ) |
Sets job's priority with val.
|
private |
|
staticprivate |
Length of the biggest name.
|
private |
Helper member to count the number of milliseconds since _elapsedTime was changed.
|
private |
Name of the job.
|
private |
Priority.
|
private |
Amount of required disk space to execute the Job (MB)
|
private |
Amount of required RAM to execute the Job (MB)
|
private |
Set of required software to execute the Job.