com.friendshipsystems.fsshresourcemanager
Interface FIScheduler

All Known Implementing Classes:
FScheduler

public interface FIScheduler

This is the interface that needs to be implemented by classes that are used by the SSH Resource Manager to select a job to run, i.e. the scheduler. Whenever a request to start a job is received, or a job is finished, or additional resources become available, the selectNextJobToRun(List>) method is called in order to determine which job should be executed next.

Author:
FRIENDSHIP SYSTEMS

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.
 

Method Detail

selectNextJobToRun

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. 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

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.

setHostManager

void setHostManager(FHostManager manager)
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).

Parameters:
manager -

setSchedulerHint

void setSchedulerHint(java.lang.String hint)
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.

Parameters:
hint -

setSchedulerDebug

void setSchedulerDebug(boolean debug)
This method allows to enable and disable scheduler debug during the test phase

Parameters:
debug -