org.gridbus.broker.farming.common
Class GridbusFarmingEngine

java.lang.Object
  extended byorg.gridbus.broker.farming.common.FarmingEngine
      extended byorg.gridbus.broker.farming.common.GridbusFarmingEngine

public class GridbusFarmingEngine
extends FarmingEngine

This class is a place holder for the jobs and the server objects and is the main interface to applications that talk to the Broker.


Constructor Summary
GridbusFarmingEngine()
          Constructor - initializes GridbusFarmingEngine by looking at the DB.properties file If DB.properties is not found, then nothing is started.
 
Method Summary
 org.ietf.jgss.GSSCredential genProxy()
          To be implemented in a future version.
 java.util.Collection getDataFileList()
          Collection of Data Files
 java.util.Hashtable getDataHostTable()
          Collection of Data Hosts
 java.lang.Object getGkprList()
          Returns an object which represents the Gatekeeper list, used to probe the compute servers
 java.lang.String getLocalDir()
          Returns the local directory the broker
 java.lang.Object getPlanFile()
          Returns the name of the plan file
 org.ietf.jgss.GSSCredential getProxy()
          Get the credential to be using when executing jobs
 void init()
          This method performs initialisation tasks for the farming engine.
 boolean isFeasible()
          Returns whether the current schedule is feasible or not, depending on the given budget,deadline constraints
 boolean isInputDataFilePresent()
          True / False based on whether the input data file is present
 boolean isOutputDataFilePresent()
          To be implemented in future versions.
 boolean isSchedulingFailed()
          Returns if the scheduler has failed due to some reason
 boolean isSchedulingFinished()
          Returns if all the jobs have been executed on the grid
 float returnBudget()
          Returns the budget for the jobs currently scheduled / being scheduled
 long returnDeadline()
          Returns the deadline for the jobs currently scheduled / being scheduled
 void schedule()
          Initialises the appropriate scheduler based on the broker properties, and starts the scheduler on a seperate thread
 void setFeasible(boolean b)
          Sets the feasibility of the broker schedule
 void setGkprList(java.lang.Object o)
          Sets the Gatekeeper list object
 void setLocalDir(java.lang.String val)
          Sets the LocalDir variable within the Broker Properties.
 void setPlanFile(java.lang.Object object)
          Sets the plan file name
 void setProxy(org.ietf.jgss.GSSCredential cred)
          Set the credential to be using when executing jobs No checks are made as to whether it is valid or active
 boolean terminate()
          Terminates the execution by stopping all the running jobs
 void terminateJob(java.lang.String jobID)
          Terminates the job, whose identifier has been passed, if it is running
 
Methods inherited from class org.gridbus.broker.farming.common.FarmingEngine
addJob, addServer, getJobs, getServers, setJobs, setServers
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridbusFarmingEngine

public GridbusFarmingEngine()
                     throws GridBrokerException
Constructor - initializes GridbusFarmingEngine by looking at the DB.properties file If DB.properties is not found, then nothing is started. The DB.properties file must be located in the same directory as the one in which the broker is executing..

Throws:
GridBrokerException
Method Detail

init

public void init()
          throws java.lang.Exception
This method performs initialisation tasks for the farming engine. This includes preparing jobs, probing servers and setting appropriate attributes for the jobs, servers and other internal data structures

Throws:
java.lang.Exception

getGkprList

public java.lang.Object getGkprList()
Returns an object which represents the Gatekeeper list, used to probe the compute servers

Returns:
Gatekeeper List object which could be a java collection or a string

getPlanFile

public java.lang.Object getPlanFile()
Returns the name of the plan file

Returns:
Plan file name

setGkprList

public void setGkprList(java.lang.Object o)
Sets the Gatekeeper list object

Parameters:
o - - object of type string or java collection

setPlanFile

public void setPlanFile(java.lang.Object object)
Sets the plan file name

Parameters:
object - of type string representing the plan filename

isInputDataFilePresent

public boolean isInputDataFilePresent()
True / False based on whether the input data file is present

Returns:
True / False based on whether the input data file is present for the plan file the farming engine is operating on.

isOutputDataFilePresent

public boolean isOutputDataFilePresent()
To be implemented in future versions.

Returns:
true if the output data file is present

getDataFileList

public java.util.Collection getDataFileList()
Collection of Data Files

Returns:
data file collection object

getDataHostTable

public java.util.Hashtable getDataHostTable()
Collection of Data Hosts

Returns:
data host collection object

schedule

public void schedule()
              throws GridBrokerException
Initialises the appropriate scheduler based on the broker properties, and starts the scheduler on a seperate thread

Throws:
GridBrokerException

terminateJob

public void terminateJob(java.lang.String jobID)
                  throws java.lang.Exception
Terminates the job, whose identifier has been passed, if it is running

Parameters:
jobID -
Throws:
java.lang.Exception

terminate

public boolean terminate()
Terminates the execution by stopping all the running jobs

Returns:

getLocalDir

public java.lang.String getLocalDir()
                             throws GridBrokerException
Returns the local directory the broker

Returns:
property value for local directory
Throws:
GridBrokerException

getProxy

public org.ietf.jgss.GSSCredential getProxy()
Get the credential to be using when executing jobs

Returns:
A GSSCredential or null

setProxy

public void setProxy(org.ietf.jgss.GSSCredential cred)
Set the credential to be using when executing jobs No checks are made as to whether it is valid or active

Parameters:
cred -

setLocalDir

public void setLocalDir(java.lang.String val)
                 throws GridBrokerException
Sets the LocalDir variable within the Broker Properties. The LocalDir is used when there are >1 Brokers running within a VM. To distinguish between the inputs and outputs for each Broker, all the files belonging to a Broker can be put into a single LocalDir and specified here. The Broker will grab the files from LocalDir.

Parameters:
val -
Throws:
GridBrokerException

genProxy

public org.ietf.jgss.GSSCredential genProxy()
                                     throws org.ietf.jgss.GSSException
To be implemented in a future version.

Returns:
GSSCredential proxy
Throws:
org.ietf.jgss.GSSException

returnDeadline

public long returnDeadline()
                    throws GridBrokerException
Returns the deadline for the jobs currently scheduled / being scheduled

Returns:
deadline
Throws:
GridBrokerException

returnBudget

public float returnBudget()
                   throws GridBrokerException
Returns the budget for the jobs currently scheduled / being scheduled

Returns:
budget
Throws:
GridBrokerException

isFeasible

public boolean isFeasible()
Returns whether the current schedule is feasible or not, depending on the given budget,deadline constraints

Returns:
feasibility

setFeasible

public void setFeasible(boolean b)
Sets the feasibility of the broker schedule

Parameters:
b -

isSchedulingFinished

public boolean isSchedulingFinished()
Returns if all the jobs have been executed on the grid

Returns:
whether scheduling is finished

isSchedulingFailed

public boolean isSchedulingFailed()
Returns if the scheduler has failed due to some reason

Returns:
whether scheduling is finished