org.apache.uima.ducc.rm.scheduler
Class Scheduler

java.lang.Object
  extended by org.apache.uima.ducc.rm.scheduler.Scheduler
All Implemented Interfaces:
ISchedulerMain, SchedConstants

public class Scheduler
extends Object
implements ISchedulerMain, SchedConstants

This process orchestrates scheduling. - Receives requests from clients ( job manager, service manager, etc ) for resources - Forwards requests and current state to pluggable scheduling implementation - Receives a schedule, updates state, sends responses to requestors - Maintains state as needed (work item life cycle etc)


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.uima.ducc.rm.scheduler.SchedConstants
SchedConstants.EvictionPolicy, SchedConstants.Policy
 
Field Summary
 
Fields inherited from interface org.apache.uima.ducc.rm.scheduler.SchedConstants
COMPONENT_NAME, DEFAULT_INIT_STABILITY_COUNT, DEFAULT_INSTANCES, DEFAULT_MAX_INSTANCES, DEFAULT_MAX_PROCESSES, DEFAULT_NODE_METRICS_RATE, DEFAULT_PRIORITY, DEFAULT_PROCESSES, DEFAULT_SCHEDULING_RATE, DEFAULT_SCHEDULING_RATIO, DEFAULT_SHARE_WEIGHT, DEFAULT_STABILITY_COUNT
 
Constructor Summary
Scheduler()
           
 
Method Summary
 String getDefaultFairShareName()
           
 int getDefaultMemory()
           
 int getDefaultNTasks()
           
 int getDefaultNThreads()
           
 String getDefaultReserveName()
           
 IRmJob getJob(org.apache.uima.ducc.common.utils.id.DuccId id)
           
 Machine getMachine(org.apache.uima.ducc.common.Node n)
           
 Machine getMachine(org.apache.uima.ducc.common.NodeIdentity ni)
           
 ResourceClass getResourceClass(String name)
           
 Share getShare(org.apache.uima.ducc.common.utils.id.DuccId id)
           
protected  void handleDeadNodes()
           
 void init()
           
 boolean isInitialized()
           
 void jobCancelled(org.apache.uima.ducc.common.utils.id.DuccId id)
           
static org.apache.uima.ducc.common.utils.id.DuccId newId()
           
static org.apache.uima.ducc.common.utils.id.DuccId newId(long id)
           
 void nodeArrives(org.apache.uima.ducc.common.Node node)
           
 void nodeDeath(Map<org.apache.uima.ducc.common.Node,org.apache.uima.ducc.common.Node> nodes)
           
 void processRecovery(IRmJob j)
          Make this public for log following.
 void queryMachines()
           
 boolean ready()
          We don't accept new work or even Orchestrator state updates until "ready".
 void resetNodepools()
          Log following / reconstruction, needed to init before recovery.
 JobManagerUpdate schedule()
          We first accept any changes and requests from the outside world and place them where they can be acted on in this epoch.
 void setJobManager(IJobManager jobmanager)
           
 void shutdown()
           
 void signalCompletion(org.apache.uima.ducc.common.utils.id.DuccId id)
          Callback from job manager when a job completes.
 void signalCompletion(IRmJob job, Share share)
          Callback from job manager when a specific share exits but the job is still alive.
 void signalInitialized(IRmJob job)
           
 void signalNewWork(IRmJob job)
          Callback from job manager, need shares for a new fair-share job.
 void signalRecovery(IRmJob job)
           
 void start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Scheduler

public Scheduler()
Method Detail

init

public void init()
          throws Exception
Specified by:
init in interface ISchedulerMain
Throws:
Exception

isInitialized

public boolean isInitialized()
Specified by:
isInitialized in interface ISchedulerMain

getMachine

public Machine getMachine(org.apache.uima.ducc.common.Node n)

getMachine

public Machine getMachine(org.apache.uima.ducc.common.NodeIdentity ni)
Specified by:
getMachine in interface ISchedulerMain

setJobManager

public void setJobManager(IJobManager jobmanager)

getDefaultFairShareName

public String getDefaultFairShareName()
Specified by:
getDefaultFairShareName in interface ISchedulerMain

getDefaultReserveName

public String getDefaultReserveName()
Specified by:
getDefaultReserveName in interface ISchedulerMain

getDefaultNThreads

public int getDefaultNThreads()
Specified by:
getDefaultNThreads in interface ISchedulerMain

getDefaultNTasks

public int getDefaultNTasks()
Specified by:
getDefaultNTasks in interface ISchedulerMain

getDefaultMemory

public int getDefaultMemory()
Specified by:
getDefaultMemory in interface ISchedulerMain

getResourceClass

public ResourceClass getResourceClass(String name)
Specified by:
getResourceClass in interface ISchedulerMain

getJob

public IRmJob getJob(org.apache.uima.ducc.common.utils.id.DuccId id)
Specified by:
getJob in interface ISchedulerMain

getShare

public Share getShare(org.apache.uima.ducc.common.utils.id.DuccId id)
Specified by:
getShare in interface ISchedulerMain

ready

public boolean ready()
We don't accept new work or even Orchestrator state updates until "ready". We do want machines, but be sure the internal structures are protected.

Specified by:
ready in interface ISchedulerMain

start

public void start()
Specified by:
start in interface ISchedulerMain

handleDeadNodes

protected void handleDeadNodes()

schedule

public JobManagerUpdate schedule()
We first accept any changes and requests from the outside world and place them where they can be acted on in this epoch. We then pass all relevent requests and resources to the IScheduler. This returns a SchedulingUpdate which is passed to the dispatcher to be acted upon.

Specified by:
schedule in interface ISchedulerMain

shutdown

public void shutdown()

nodeArrives

public void nodeArrives(org.apache.uima.ducc.common.Node node)
Specified by:
nodeArrives in interface ISchedulerMain

nodeDeath

public void nodeDeath(Map<org.apache.uima.ducc.common.Node,org.apache.uima.ducc.common.Node> nodes)
Specified by:
nodeDeath in interface ISchedulerMain

signalNewWork

public void signalNewWork(IRmJob job)
Callback from job manager, need shares for a new fair-share job.

Specified by:
signalNewWork in interface ISchedulerMain

signalInitialized

public void signalInitialized(IRmJob job)
Specified by:
signalInitialized in interface ISchedulerMain

signalRecovery

public void signalRecovery(IRmJob job)
Specified by:
signalRecovery in interface ISchedulerMain

jobCancelled

public void jobCancelled(org.apache.uima.ducc.common.utils.id.DuccId id)

signalCompletion

public void signalCompletion(org.apache.uima.ducc.common.utils.id.DuccId id)
Callback from job manager when a job completes. We just believe him, no sanity checks or other such stuff.

Specified by:
signalCompletion in interface ISchedulerMain

signalCompletion

public void signalCompletion(IRmJob job,
                             Share share)
Callback from job manager when a specific share exits but the job is still alive.

Specified by:
signalCompletion in interface ISchedulerMain

resetNodepools

public void resetNodepools()
Log following / reconstruction, needed to init before recovery.


processRecovery

public void processRecovery(IRmJob j)
Make this public for log following.


newId

public static org.apache.uima.ducc.common.utils.id.DuccId newId()

newId

public static org.apache.uima.ducc.common.utils.id.DuccId newId(long id)

queryMachines

public void queryMachines()
Specified by:
queryMachines in interface ISchedulerMain


Copyright © 2012–2014 The Apache Software Foundation. All rights reserved.