gridbroker
Class Broker

Object
  |
  +--Thread
        |
        +--eduni.simjava.Sim_entity
              |
              +--gridsim.GridSim
                    |
                    +--gridbroker.Broker
All Implemented Interfaces:
Runnable

public class Broker
extends GridSim

Broker class simulates the Grid resource broker. On receiving an experiment from the user entity, it carries out resource discovery, and determines deadline and budget values based on D- and B-factor, and then proceeds with scheduling.

Broker class schedules Gridlets on resources depending on user constraints, optimization strategy, and cost of resources and their availability. When it receives the results of application processing, it records parameters of interest with the gridsim.Statistics entity. When it has no more processing requirements, it sends the END_OF_SIMULATION event to the gridsim.GridSimShutdown entity.

Version:
2.1, June 2003
Author:
Manzur Murshed and Rajkumar Buyya
Invariant:
$none

Field Summary
 
Fields inherited from class gridsim.GridSim
input, output, rand, SimulationStartDate
 
Fields inherited from class eduni.simjava.Sim_entity
 
Fields inherited from class Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Broker(String name, double baudRate)
          Allocates a new Broker class
 
Method Summary
 void aggregatedScheduleReport(Experiment expt, LinkedList BRList)
          Writes a summary of the schedule report mentioning the total results of the experiment.
 void AggregatedScheduleReport(Experiment expt, LinkedList BRList)
          Deprecated. As of GridBroker 2.1, replaced by aggregatedScheduleReport(Experiment, LinkedList)
 void body()
          Processes one event at one time.
 void scheduleReport(Experiment expt, LinkedList BRList, boolean reportHeaderFlag)
          Invokes a schedule report for every scheduling event.
 void ScheduleReport(Experiment expt, LinkedList BRList, boolean reportHeaderFlag)
          Deprecated. As of GridBroker 2.1, replaced by scheduleReport(Experiment, LinkedList, boolean)
 void writeAggregateScheduleReport(String reportTitle, String reportFileFullname, int parameter, Experiment expt, LinkedList BRList, boolean reportHeaderFlag)
          Writes a schedule report
 void WriteAggregateScheduleReport(String reportTitle, String reportFileFullname, int parameter, Experiment expt, LinkedList BRList, boolean reportHeaderFlag)
          Deprecated. As of GridBroker 2.1, replaced by writeAggregateScheduleReport(String, String, int, Experiment, LinkedList, boolean)
 void writeScheduleReport(String reportTitle, String reportFileFullname, int parameter, Experiment expt, LinkedList BRList, boolean reportHeaderFlag)
          Writes a schedule report
 void WriteScheduleReport(String reportTitle, String reportFileFullname, int parameter, Experiment expt, LinkedList BRList, boolean reportHeaderFlag)
          Deprecated. As of GridBroker 2.1, replaced by writeScheduleReport(String, String, int, Experiment, LinkedList, boolean)
 
Methods inherited from class gridsim.GridSim
clock, Clock, finalize, finalizeGridSimulation, getEntityId, GetEntityId, getEntityName, GetEntityName, getEntityName, GetEntityName, getGridInfoServiceEntityId, getGridResourceList, GetGridResourceList, getGridSimShutdownEntityId, getGridStatisticsEntityId, getResourceCharacteristics, GetResourceCharacteristics, getResourceDynamicInfo, GetResourceDynamicInformation, getSimulationStartDate, GetSimulationStartDate, GridInformationServiceEntityId, GridletCancel, gridletReceive, GridletReceive, gridletSubmit, GridletSubmit, gridSimHold, GridSimHold, GridSimShutdownEntityId, GridStatisticsEntityId, init, Init, isNetworked, IsNetworked, receiveEventObject, ReceiveEventObject, receiveEventObject, ReceiveEventObject, recordStatistics, RecordStatistics, recordStatistics, RecordStatistics, recordStatistics, RecordStatistics, recordStatistics, RecordStatistics, send, Send, send, Send, send, Send, send, Send, send, Send, send, Send, shutdownGridStatisticsEntity, ShutdownGridStatisticsEntity, shutdownUserEntity, ShutdownUserEntity, Start, startGridSimulation, Stop, stopGridSimulation, TerminateInputOutputEntities, terminateIOEntities
 
Methods inherited from class eduni.simjava.Sim_entity
add_param, add_port, get_id, get_name, get_port, get_port, run, send_on, set_invisible, sim_cancel, sim_current, sim_get_next, sim_get_next, sim_hold_for, sim_hold, sim_putback, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_select, sim_trace, sim_wait_for, sim_wait, sim_waiting, sim_waiting
 
Methods inherited from class Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Broker

public Broker(String name,
              double baudRate)
       throws Exception
Allocates a new Broker class

Parameters:
name - the entity name
baudRate - the communication speed
Throws:
Exception - This happens when creating this entity before initializing GridSim package or this entity name is null or empty
See Also:
GridSim.init(int, Calendar, boolean, String[], String[], String)
Pre Condition:
name != null, baudRate >= 0.0
Post Condition:
$none
Method Detail

ScheduleReport

public void ScheduleReport(Experiment expt,
                           LinkedList BRList,
                           boolean reportHeaderFlag)
Deprecated. As of GridBroker 2.1, replaced by scheduleReport(Experiment, LinkedList, boolean)

Invokes a schedule report for every scheduling event.

In addition, creates report files with ".sched1", ".sched2", ".sched3" and ".sched31" extension.

Parameters:
expt - an Experiment object
BRList - a linked-list of broker resource
reportHeaderFlag - a report header flag
Pre Condition:
expt != null, BRList != null
Post Condition:
$none

scheduleReport

public void scheduleReport(Experiment expt,
                           LinkedList BRList,
                           boolean reportHeaderFlag)
Invokes a schedule report for every scheduling event.

In addition, creates report files with ".sched1", ".sched2", ".sched3" and ".sched31" extension.

Parameters:
expt - an Experiment object
BRList - a linked-list of broker resource
reportHeaderFlag - a report header flag
Pre Condition:
expt != null, BRList != null
Post Condition:
$none

WriteScheduleReport

public void WriteScheduleReport(String reportTitle,
                                String reportFileFullname,
                                int parameter,
                                Experiment expt,
                                LinkedList BRList,
                                boolean reportHeaderFlag)
Deprecated. As of GridBroker 2.1, replaced by writeScheduleReport(String, String, int, Experiment, LinkedList, boolean)

Writes a schedule report

Parameters:
reportTitle - the title of a report
reportFileFullname - the name of a report
parameter - a resource paramter
expt - an object of Experiment
BRList - a linked-list of broker resource
reportHeaderFlag - a report header flag
See Also:
Experiment
Pre Condition:
reportTitle != null, reportFileFullname != null, parameter >= 0, expt != null, BRList != null
Post Condition:
$none

writeScheduleReport

public void writeScheduleReport(String reportTitle,
                                String reportFileFullname,
                                int parameter,
                                Experiment expt,
                                LinkedList BRList,
                                boolean reportHeaderFlag)
Writes a schedule report

Parameters:
reportTitle - the title of a report
reportFileFullname - the name of a report
parameter - a resource paramter
expt - an object of Experiment
BRList - a linked-list of broker resource
reportHeaderFlag - a report header flag
See Also:
Experiment
Pre Condition:
reportTitle != null, reportFileFullname != null, parameter >= 0, expt != null, BRList != null
Post Condition:
$none

AggregatedScheduleReport

public void AggregatedScheduleReport(Experiment expt,
                                     LinkedList BRList)
Deprecated. As of GridBroker 2.1, replaced by aggregatedScheduleReport(Experiment, LinkedList)

Writes a summary of the schedule report mentioning the total results of the experiment.

In addition, creates report files with ".sched4", ".sched5", and ".sched6" extension.

Parameters:
expt - an Experiment object
BRList - a linked-list of BrokerResource objects
Pre Condition:
expt != null, BRList != null
Post Condition:
$none

aggregatedScheduleReport

public void aggregatedScheduleReport(Experiment expt,
                                     LinkedList BRList)
Writes a summary of the schedule report mentioning the total results of the experiment.

In addition, creates report files with ".sched4", ".sched5", and ".sched6" extension.

Parameters:
expt - an Experiment object
BRList - a linked-list of BrokerResource objects
Pre Condition:
expt != null, BRList != null
Post Condition:
$none

WriteAggregateScheduleReport

public void WriteAggregateScheduleReport(String reportTitle,
                                         String reportFileFullname,
                                         int parameter,
                                         Experiment expt,
                                         LinkedList BRList,
                                         boolean reportHeaderFlag)
Deprecated. As of GridBroker 2.1, replaced by writeAggregateScheduleReport(String, String, int, Experiment, LinkedList, boolean)

Writes a schedule report

Parameters:
reportTitle - the report title
reportFileFullname - the file name
parameter - the parameter of a broker resource
expt - an Experiment object
BRList - a linked-list of BrokerResource objects
reportHeaderFlag - a flag to denote writing header titles or
Pre Condition:
reportTitle != null, reportFileFullname != null, parameter >= 0, expt != null, BRList != null
Post Condition:
$none

writeAggregateScheduleReport

public void writeAggregateScheduleReport(String reportTitle,
                                         String reportFileFullname,
                                         int parameter,
                                         Experiment expt,
                                         LinkedList BRList,
                                         boolean reportHeaderFlag)
Writes a schedule report

Parameters:
reportTitle - the report title
reportFileFullname - the file name
parameter - the parameter of a broker resource
expt - an Experiment object
BRList - a linked-list of BrokerResource objects
reportHeaderFlag - a flag to denote writing header titles or
Pre Condition:
reportTitle != null, reportFileFullname != null, parameter >= 0, expt != null, BRList != null
Post Condition:
$none

body

public void body()
Processes one event at one time. Then calculating the gridlet deadline and budget. In addition, starting the experiment time, records statistics, and constructs report files.

Overrides:
body in class eduni.simjava.Sim_entity
Pre Condition:
$none
Post Condition:
$none