org.globus.cog.karajan.scheduler
Class WeightedHostScoreScheduler

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

public class WeightedHostScoreScheduler
extends LateBindingScheduler


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 POLICY
           
static int POLICY_BEST_SCORE
           
static int POLICY_WEIGHTED_RANDOM
           
static String RENORMALIZATION_DELAY
           
static String SCORE_HIGH_CAP
           
static String SCORE_LOW_CAP
           
 
Fields inherited from class org.globus.cog.karajan.scheduler.LateBindingScheduler
executionHandlers
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
WeightedHostScoreScheduler()
           
 
Method Summary
protected  void addToSorted(WeightedHost wh)
           
protected  double checkCaps(double score)
           
protected  double getFactor(String name)
           
protected  BoundContact getNextContact()
           
 String[] getPropertyNames()
           
protected  void multiplyScore(WeightedHost wh, double factor)
           
protected  void renormalize()
           
protected  void setDefaultFactors()
           
protected  void setFactor(String name, double value)
           
 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)
           
 
Methods inherited from class org.globus.cog.karajan.scheduler.LateBindingScheduler
allocateContact, cancelTask, checkFreeMemory, checkGlobalLoadConditions, checkLoad, decRunning, enqueue, findTaskHandler, getContacts, getHandler, getHandlerType, getJobsPerCPU, getRunning, getVirtualContacts, incRunning, isDone, releaseContact, removeHandler, resolveContact, resolveService, resolveVirtualContact, run, setHandler, setVirtualContacts, submitBoundToServices, terminate
 
Methods inherited from class org.globus.cog.karajan.scheduler.AbstractScheduler
addJobStatusListener, addTaskHandler, combineNames, fireJobStatusChangeEvent, fireJobStatusChangeEvent, getConstraints, getJobQueue, getMaxSimultaneousJobs, getProperty, getResources, getTaskHadlerWrapper, getTaskHandlers, getTaskHandlerWrapper, getTaskHandlerWrappers, removeJobStatusListener, setConstraints, setMaxSimultaneousJobs, setTaskHandlers
 
Methods inherited from class java.lang.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 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

SCORE_LOW_CAP

public static final String SCORE_LOW_CAP
See Also:
Constant Field Values

RENORMALIZATION_DELAY

public static final String RENORMALIZATION_DELAY
See Also:
Constant Field Values

POLICY

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

WeightedHostScoreScheduler

public WeightedHostScoreScheduler()
Method Detail

setDefaultFactors

protected void setDefaultFactors()

setFactor

protected void setFactor(String name,
                         double value)

getFactor

protected double getFactor(String name)

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

addToSorted

protected void addToSorted(WeightedHost wh)

multiplyScore

protected void multiplyScore(WeightedHost wh,
                             double factor)

checkCaps

protected double checkCaps(double score)

getNextContact

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

renormalize

protected void renormalize()

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

statusChanged

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