org.globus.cog.karajan.scheduler
Class LateBindingScheduler
java.lang.Object
java.lang.Thread
org.globus.cog.karajan.scheduler.AbstractScheduler
org.globus.cog.karajan.scheduler.LateBindingScheduler
- All Implemented Interfaces:
- Runnable, Scheduler, StatusListener
- Direct Known Subclasses:
- DefaultScheduler, WeightedHostScoreScheduler
- public abstract class LateBindingScheduler
- extends AbstractScheduler
- implements StatusListener
| 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, setResources, 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 |
executionHandlers
protected Hashtable executionHandlers
propertyNames
public static String[] propertyNames
LateBindingScheduler
public LateBindingScheduler()
allocateContact
public Contact allocateContact()
throws NoFreeResourceException
- Description copied from interface:
Scheduler
- Attempt to allocate a host. The returned object should be used later by
the requestor as a constraint while enqueuing a task.
- Specified by:
allocateContact in interface Scheduler
- Throws:
NoFreeResourceException
releaseContact
public void releaseContact(BoundContact 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
resolveVirtualContact
public BoundContact resolveVirtualContact(Contact contact)
throws NoFreeResourceException
- Throws:
NoFreeResourceException
getVirtualContacts
public HashMap getVirtualContacts()
setVirtualContacts
public void setVirtualContacts(HashMap virtualContacts)
getNextContact
protected abstract BoundContact getNextContact()
throws NoFreeResourceException
- Throws:
NoFreeResourceException
enqueue
public void enqueue(Task task,
Object constraints)
- Description copied from interface:
Scheduler
- Adds a task to the queue.
- Specified by:
enqueue in interface Scheduler
- Parameters:
constraints - Can be used to specify constraints under which the task should
be scheduler. While the semantics of the constraints are left
to the implementation, such an implementation should be able
to handle at least constraints of the type Contact.- See Also:
org.globus.karajan.util.Contact
isDone
public boolean isDone()
getRunning
public int getRunning()
checkGlobalLoadConditions
protected void checkGlobalLoadConditions()
throws NoFreeResourceException
- Throws:
NoFreeResourceException
checkFreeMemory
public boolean checkFreeMemory()
incRunning
protected int incRunning()
decRunning
protected int decRunning()
run
public void run()
- Specified by:
run in interface Runnable
terminate
public void terminate()
resolveContact
public BoundContact resolveContact(Contact contact)
throws NoFreeResourceException
- Throws:
NoFreeResourceException
resolveService
public Service resolveService(BoundContact contact,
int taskType)
throws NoFreeResourceException
- Throws:
NoFreeResourceException
getHandlerType
public int getHandlerType(int taskType)
findTaskHandler
public TaskHandler findTaskHandler(Task task,
Service[] services)
throws TaskSubmissionException,
InvalidProviderException,
ProviderMethodException
- Throws:
TaskSubmissionException
InvalidProviderException
ProviderMethodException
submitBoundToServices
public void submitBoundToServices(Task t,
Contact[] contacts,
Service[] services)
throws TaskSubmissionException
- Throws:
TaskSubmissionException
getJobsPerCPU
protected int getJobsPerCPU()
getHandler
protected TaskHandler getHandler(Task t)
setHandler
protected void setHandler(Task t,
TaskHandler th)
removeHandler
protected void removeHandler(Task t)
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 AbstractScheduler
statusChanged
public void statusChanged(StatusEvent e)
- Specified by:
statusChanged in interface StatusListener
cancelTask
public void cancelTask(Task task)
- Description copied from interface:
Scheduler
- Prematurely terminates a task that is either enqueued or running
- Specified by:
cancelTask in interface Scheduler
checkLoad
protected boolean checkLoad(BoundContact contact)
throws NoFreeResourceException
- Throws:
NoFreeResourceException
getPropertyNames
public String[] getPropertyNames()
- Specified by:
getPropertyNames in interface Scheduler- Overrides:
getPropertyNames in class AbstractScheduler
getContacts
protected Contact[] getContacts(Task t)