org.globus.cog.karajan.scheduler
Class WeightedHostScoreScheduler

java.lang.Object
  extended by java.lang.Thread
      extended by org.globus.cog.karajan.scheduler.AbstractScheduler
          extended by org.globus.cog.karajan.scheduler.LateBindingScheduler
              extended by org.globus.cog.karajan.scheduler.WeightedHostScoreScheduler
All Implemented Interfaces:
Runnable, StatusListener, Scheduler

public class WeightedHostScoreScheduler
extends LateBindingScheduler


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
static String FACTOR_CONNECTION_REFUSED
           
static String FACTOR_CONNECTION_TIMEOUT
           
static String FACTOR_FAILURE
           
static String FACTOR_FILEOP_TASK_LOAD
           
static String FACTOR_SUBMISSION_TASK_LOAD
           
static String FACTOR_SUCCESS
           
static String FACTOR_TRANSFER_TASK_LOAD
           
static String JOB_THROTTLE
           
static String POLICY
           
static int POLICY_BEST_SCORE
           
static int POLICY_WEIGHTED_RANDOM
           
static String SCORE_HIGH_CAP
           
 
Fields inherited from class org.globus.cog.karajan.scheduler.LateBindingScheduler
DEFAULT_JOBS_PER_CPU, DEFAULT_MAX_FILE_OPERATIONS, DEFAULT_MAX_TRANSFERS, DEFAULT_SSH_INITIAL_RATE, executionHandlers, HOST_SUBMIT_THROTTLE, JOBS_PER_CPU, K, MAX_FILE_OPERATIONS, MAX_TRANSFERS, SSH_INITIAL_RATE, SUBMIT_THROTTLE, THREAD_STACK_SIZE
 
Fields inherited from class org.globus.cog.karajan.scheduler.AbstractScheduler
THROTTLE_OFF
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
WeightedHostScoreScheduler()
           
 
Method Summary
protected  void addToSorted(WeightedHost wh)
           
protected  WeightedHostSet constrain(WeightedHostSet s, ResourceConstraintChecker rcc, TaskConstraints tc)
           
protected  double factor(double score, double factor)
           
protected  BoundContact getNextContact(TaskConstraints t)
           
 String[] getPropertyNames()
           
protected  void multiplyScore(WeightedHost wh, double factor)
           
protected  void multiplyScoreLater(WeightedHost wh, double factor)
           
 void releaseContact(Contact contact)
          Can be used to tell the scheduler that a previously allocated contact (using allocateContact()) is not used any more.
protected  WeightedHostSet removeOverloaded(WeightedHostSet s)
           
protected  void setDefaultFactors()
           
 void setProperty(String name, Object value)
          Sets a scheduler property.
 void setResources(ContactSet grid)
          Sets the set of resources that the scheduler will use
 void statusChanged(StatusEvent e)
           
 void submitBoundToServices(Task t, Contact[] contacts, Service[] services)
           
 
Methods inherited from class org.globus.cog.karajan.scheduler.LateBindingScheduler
allocateContact, allocateContact, cancelTask, checkFreeMemory, checkGlobalLoadConditions, checkLoad, checkTaskLoadConditions, decRunning, enqueue, failTask, findTaskHandler, getContacts, getHandler, getHandlerType, getJobsPerCPU, getNextContact, getRunning, getSubmitQueue, getTaskConstraints, getVirtualContacts, incRunning, isDone, removeHandler, resolveContact, resolveService, resolveVirtualContact, run, setHandler, setVirtualContacts, terminate
 
Methods inherited from class org.globus.cog.karajan.scheduler.AbstractScheduler
addFailureHandler, addJobStatusListener, addTaskHandler, addTaskTransformer, applyTaskTransformers, checkConstraints, checkConstraints, combineNames, fireJobStatusChangeEvent, fireJobStatusChangeEvent, getConstraintChecker, getConstraints, getJobQueue, getMaxSimultaneousJobs, getProperty, getResources, getTaskHadlerWrapper, getTaskHandlers, getTaskHandlerWrapper, getTaskHandlerWrappers, getTaskTransformers, removeConstraints, removeJobStatusListener, runFailureHandlers, setConstraintChecker, setConstraints, setMaxSimultaneousJobs, setTaskHandlers, throttleValue
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

POLICY_WEIGHTED_RANDOM

public static final int POLICY_WEIGHTED_RANDOM
See Also:
Constant Field Values

POLICY_BEST_SCORE

public static final int POLICY_BEST_SCORE
See Also:
Constant Field Values

FACTOR_CONNECTION_REFUSED

public static final String FACTOR_CONNECTION_REFUSED
See Also:
Constant Field Values

FACTOR_CONNECTION_TIMEOUT

public static final String FACTOR_CONNECTION_TIMEOUT
See Also:
Constant Field Values

FACTOR_SUBMISSION_TASK_LOAD

public static final String FACTOR_SUBMISSION_TASK_LOAD
See Also:
Constant Field Values

FACTOR_TRANSFER_TASK_LOAD

public static final String FACTOR_TRANSFER_TASK_LOAD
See Also:
Constant Field Values

FACTOR_FILEOP_TASK_LOAD

public static final String FACTOR_FILEOP_TASK_LOAD
See Also:
Constant Field Values

FACTOR_SUCCESS

public static final String FACTOR_SUCCESS
See Also:
Constant Field Values

FACTOR_FAILURE

public static final String FACTOR_FAILURE
See Also:
Constant Field Values

SCORE_HIGH_CAP

public static final String SCORE_HIGH_CAP
See Also:
Constant Field Values

POLICY

public static final String POLICY
See Also:
Constant Field Values

JOB_THROTTLE

public static final String JOB_THROTTLE
See Also:
Constant Field Values
Constructor Detail

WeightedHostScoreScheduler

public WeightedHostScoreScheduler()
Method Detail

setDefaultFactors

protected final void setDefaultFactors()

setResources

public void setResources(ContactSet grid)
Description copied from interface: Scheduler
Sets the set of resources that the scheduler will use

Specified by:
setResources in interface Scheduler
Overrides:
setResources in class AbstractScheduler
See Also:
ContactSet

addToSorted

protected void addToSorted(WeightedHost wh)

multiplyScore

protected void multiplyScore(WeightedHost wh,
                             double factor)

multiplyScoreLater

protected void multiplyScoreLater(WeightedHost wh,
                                  double factor)

factor

protected final double factor(double score,
                              double factor)

getNextContact

protected BoundContact getNextContact(TaskConstraints t)
                               throws NoFreeResourceException
Specified by:
getNextContact in class LateBindingScheduler
Throws:
NoFreeResourceException

releaseContact

public void releaseContact(Contact contact)
Description copied from interface: Scheduler
Can be used to tell the scheduler that a previously allocated contact (using allocateContact()) is not used any more.

Specified by:
releaseContact in interface Scheduler
Overrides:
releaseContact in class LateBindingScheduler

constrain

protected WeightedHostSet constrain(WeightedHostSet s,
                                    ResourceConstraintChecker rcc,
                                    TaskConstraints tc)

removeOverloaded

protected WeightedHostSet removeOverloaded(WeightedHostSet s)

getPropertyNames

public String[] getPropertyNames()
Specified by:
getPropertyNames in interface Scheduler
Overrides:
getPropertyNames in class LateBindingScheduler

setProperty

public void setProperty(String name,
                        Object value)
Description copied from interface: Scheduler
Sets a scheduler property. The supported property names can be queried using the getPropertyNames method

Specified by:
setProperty in interface Scheduler
Overrides:
setProperty in class LateBindingScheduler

submitBoundToServices

public void submitBoundToServices(Task t,
                                  Contact[] contacts,
                                  Service[] services)
                           throws TaskSubmissionException
Overrides:
submitBoundToServices in class LateBindingScheduler
Throws:
TaskSubmissionException

statusChanged

public void statusChanged(StatusEvent e)
Specified by:
statusChanged in interface StatusListener
Overrides:
statusChanged in class LateBindingScheduler