com.friendshipsystems.fsshresourcemanager
Class FScheduler

java.lang.Object
  extended by com.friendshipsystems.fsshresourcemanager.FScheduler
All Implemented Interfaces:
FIScheduler

public class FScheduler
extends java.lang.Object
implements FIScheduler

The default implementation of the FIScheduler Interface.

Author:
FRIENDSHIP SYSTEMS

Constructor Summary
FScheduler()
           
 
Method Summary
 FJob selectNextJobToRun(java.util.List<java.util.List<FJob>> waitingQueues, java.util.Map<java.lang.String,java.util.Date> blockedAddresses)
          This method is called to determine the next FJob that should be run depending on the available resources and the scheduling algorithm.
 void setHostManager(FHostManager manager)
          The FHostManager handles the automatic host management of the SshResourceManager.
 void setSchedulerDebug(boolean debug)
          This method allows to enable and disable scheduler debug during the test phase
 void setSchedulerHint(java.lang.String hint)
          This method allows the admin to pass a scheduling hint to the scheduler using the properties file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FScheduler

public FScheduler()
Method Detail

selectNextJobToRun

public FJob selectNextJobToRun(java.util.List<java.util.List<FJob>> waitingQueues,
                               java.util.Map<java.lang.String,java.util.Date> blockedAddresses)
Description copied from interface: FIScheduler
This method is called to determine the next FJob that should be run depending on the available resources and the scheduling algorithm. If it is a valid FJob, it will be started right away. It is the responsibility of this method to assign the FApplicationInfo to the job which holds the info on which host the FJob will be executed.
The method is called from a synchronized method, therefore thread safety should be no issue

Specified by:
selectNextJobToRun in interface FIScheduler
Parameters:
waitingQueues - A list of lists of FJob that are currently waiting for execution. This is a list of lists where each list represents the FJob that were executed by the same user.
blockedAddresses - A Map of FrameworkAddresses that are currently blocked from scheduling. The values in the map are the times the blocking was done.
Returns:
The next FJob that should be run. If it is null, the scheduling will be blocked until a new FJob arrives or a FJob has finished.

setSchedulerHint

public void setSchedulerHint(java.lang.String hint)
Description copied from interface: FIScheduler
This method allows the admin to pass a scheduling hint to the scheduler using the properties file. The value of the property schedulerHint is directly passed to the scheduler upon creation.

Specified by:
setSchedulerHint in interface FIScheduler

setSchedulerDebug

public void setSchedulerDebug(boolean debug)
Description copied from interface: FIScheduler
This method allows to enable and disable scheduler debug during the test phase

Specified by:
setSchedulerDebug in interface FIScheduler

setHostManager

public void setHostManager(FHostManager manager)
Description copied from interface: FIScheduler
The FHostManager handles the automatic host management of the SshResourceManager. The default scheduler implementation uses the FHostManager, for two things:
  1. Determine whether a host is currently auto-disabled
  2. Send a notification email if no possible executors are left for a queued job (e.g. due to being auto-disabled).
If you want your custom scheduler implementation to include that functionality, make sure to store the FHostManager passed in this method (it is called right after creation of the Scheduler).

Specified by:
setHostManager in interface FIScheduler