org.apache.uima.ducc.rm.scheduler
Interface IRmJob

All Superinterfaces:
SchedConstants
All Known Implementing Classes:
RmJob

public interface IRmJob
extends SchedConstants

This class represents a job inside the scheduler.


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
 
Method Summary
 void assignShare(Share s)
          Scheduler found us a new toy, make it pending until it's given to job manager.
 int calculateCap(int order, int basis)
           
 void cancelPending(Share s)
          Cancel a pending assignment, part of defrag
 void clearPendingRemoves()
          And finally, dump the pending shrinkage.
 void clearRecoveredShares()
          Shares recovered, clear the structures.
 void clearShares()
          Used during scheduling cycle only, keep track of number of shares given out to this job.
 int countInstances()
           
 int countNShares()
          Find number of nShares this machine has assigned already.
 int countNSharesGiven()
           
 int countNSharesLost()
           
 int countQSharesGiven()
           
 Comparator<org.apache.uima.ducc.rm.scheduler.IEntity> getApportionmentSorter()
           
 HashMap<Share,Share> getAssignedShares()
          Get the actual shares that are assigned to this job.
 String getClassName()
           
 org.apache.uima.ducc.transport.event.common.IDuccTypes.DuccType getDuccType()
           
 long getFriendlyId()
           
 int[] getGivenByOrder()
           
 org.apache.uima.ducc.common.utils.id.DuccId getId()
           
 int getJobCap()
          This returns the largest number that can actually be used, which will be either the share cap itself, or nProcess / nThreads, in quantum shares.
 Map<Machine,Machine> getMachines()
           
 int getMaxShares()
           
 int getMemory()
           
 int getMinShares()
           
 String getName()
           
 HashMap<Share,Share> getPendingRemoves()
          Return the reclaimed shares.
 HashMap<Share,Share> getPendingShares()
          Newly allocated shares that have not been dispatched.
 int getPureFairShare()
           
 HashMap<Share,Share> getRecoveredShares()
          Get the shares that are scheduled for (job) recovery.
 String getRefusalReason()
           
 ResourceClass getResourceClass()
           
 SchedConstants.Policy getSchedulingPolicy()
           
 int getSchedulingPriority()
           
 int getShareOrder()
           
 Map<Machine,Map<Share,Share>> getSharesByMachine()
          For defrag, we want to know what machines a job is running on.
 int getShareWeight()
           
 long getTimestamp()
           
 User getUser()
           
 String getUserName()
           
 int getUserPriority()
           
 int[] getWantedByOrder()
           
 void init()
          read the props file and set inital values for internal fields
 void initJobCap()
           
 void initWantedByOrder(ResourceClass rc)
           
 boolean isCompleted()
           
 boolean isDormant()
           
 boolean isExpanded()
          What is result of latest scheduling epoch?
 boolean isInitialized()
           
 boolean isPendingShare(Share s)
           
 boolean isRefused()
           
 boolean isReservation()
           
 boolean isShrunken()
           
 boolean isStable()
           
 void markComplete()
          The job is compolete but may linger a bit because of the defrag code.
 int nQuestions()
          Number of questions submitted.
 int nQuestionsRemaining()
          Number of questions still to be answered.
 int nThreads()
           
 String printShares()
          Logging and debugging - nice to know what my assigned shares are.
 HashMap<Share,Share> promoteShares()
          We're dispatching, move machines to active list, and clear pending list.
 void recoverShare(Share s)
          Set a share for recovery.
 void refuse(String refusal)
          Can't schedudle this nohow.
 void removeAllShares()
          Clear the job, it has no resources of any form.
 void removeShare(Share share)
          I've shrunk or this share has nothing left to do.
 void setClassName(String n)
           
 void setDuccType(org.apache.uima.ducc.transport.event.common.IDuccTypes.DuccType dt)
           
 void setGivenByOrder(int[] gbo)
           
 boolean setInitWait(boolean w)
           
 void setJobName(String name)
           
 void setMaxShares(int s)
           
 void setMemory(int memory)
           
 void setMinShares(int s)
           
 void setNInstances(int m)
           
 void setNQuestions(int allq, int remainingq, double time_per_item)
           
 void setPureFairShare(int s)
           
 void setReservation()
           
 void setResourceClass(ResourceClass cl)
          Save ref to the class we are in, and init class-based structures.
 void setShareOrder(int s)
          Scheduler looks at job memory and decides what its share order is.
 void setThreads(int threads)
           
 void setTimestamp(long t)
           
 void setUser(User u)
           
 void setUserName(String n)
           
 void setUserPriority(int p)
           
 int shrinkByInvestment(int shares, int order, boolean force, org.apache.uima.ducc.rm.scheduler.NodePool np)
           
 void shrinkByOne(Share share)
          Pick a share, any share, and remove it from active.
 int shrinkByOrderByMachine(int shares, int order, boolean force, org.apache.uima.ducc.rm.scheduler.NodePool np)
          Eviction policies, configurable.
 

Method Detail

init

void init()
read the props file and set inital values for internal fields


getId

org.apache.uima.ducc.common.utils.id.DuccId getId()

getFriendlyId

long getFriendlyId()

getName

String getName()

setJobName

void setJobName(String name)

setResourceClass

void setResourceClass(ResourceClass cl)
Save ref to the class we are in, and init class-based structures.


nQuestions

int nQuestions()
Number of questions submitted.


setNQuestions

void setNQuestions(int allq,
                   int remainingq,
                   double time_per_item)

nQuestionsRemaining

int nQuestionsRemaining()
Number of questions still to be answered. Used by scheduler to determing current machine requirement.


setReservation

void setReservation()

isReservation

boolean isReservation()

setInitWait

boolean setInitWait(boolean w)

clearShares

void clearShares()
Used during scheduling cycle only, keep track of number of shares given out to this job.


countNSharesGiven

int countNSharesGiven()

countQSharesGiven

int countQSharesGiven()

countNSharesLost

int countNSharesLost()

shrinkByOrderByMachine

int shrinkByOrderByMachine(int shares,
                           int order,
                           boolean force,
                           org.apache.uima.ducc.rm.scheduler.NodePool np)
Eviction policies, configurable.


shrinkByInvestment

int shrinkByInvestment(int shares,
                       int order,
                       boolean force,
                       org.apache.uima.ducc.rm.scheduler.NodePool np)

getAssignedShares

HashMap<Share,Share> getAssignedShares()
Get the actual shares that are assigned to this job.


getPendingShares

HashMap<Share,Share> getPendingShares()
Newly allocated shares that have not been dispatched. They're unavailable for scheduling but job manager doesn't know about them yet. When we tell job manager we'll "promote" them to the assignedShares list.


getRecoveredShares

HashMap<Share,Share> getRecoveredShares()
Get the shares that are scheduled for (job) recovery.


promoteShares

HashMap<Share,Share> promoteShares()
We're dispatching, move machines to active list, and clear pending list. Tell caller which machines are affected so it can dispatch them.


getSharesByMachine

Map<Machine,Map<Share,Share>> getSharesByMachine()
For defrag, we want to know what machines a job is running on.


getMachines

Map<Machine,Machine> getMachines()

assignShare

void assignShare(Share s)
Scheduler found us a new toy, make it pending until it's given to job manager.


recoverShare

void recoverShare(Share s)
Set a share for recovery.


cancelPending

void cancelPending(Share s)
Cancel a pending assignment, part of defrag


isExpanded

boolean isExpanded()
What is result of latest scheduling epoch?


isStable

boolean isStable()

isShrunken

boolean isShrunken()

isDormant

boolean isDormant()

isPendingShare

boolean isPendingShare(Share s)

removeAllShares

void removeAllShares()
Clear the job, it has no resources of any form.


markComplete

void markComplete()
The job is compolete but may linger a bit because of the defrag code. Mark it complete so it doesn't accidentally get used.


isCompleted

boolean isCompleted()

removeShare

void removeShare(Share share)
I've shrunk or this share has nothing left to do. Remove this specific share.


shrinkByOne

void shrinkByOne(Share share)
Pick a share, any share, and remove it from active. Set to pending so jm can kill it.


getPendingRemoves

HashMap<Share,Share> getPendingRemoves()
Return the reclaimed shares.


clearPendingRemoves

void clearPendingRemoves()
And finally, dump the pending shrinkage.


clearRecoveredShares

void clearRecoveredShares()
Shares recovered, clear the structures.


countNShares

int countNShares()
Find number of nShares this machine has assigned already. If things are slow in the cluster the pending removes might be non-zero. This is an extreme corner case it's best to be safe.


refuse

void refuse(String refusal)
Can't schedudle this nohow. Here's why.


getRefusalReason

String getRefusalReason()

isRefused

boolean isRefused()

setShareOrder

void setShareOrder(int s)
Scheduler looks at job memory and decides what its share order is.


getShareOrder

int getShareOrder()

getJobCap

int getJobCap()
This returns the largest number that can actually be used, which will be either the share cap itself, or nProcess / nThreads, in quantum shares.


initJobCap

void initJobCap()

getUserName

String getUserName()

setUserName

void setUserName(String n)

getUser

User getUser()

setUser

void setUser(User u)

getTimestamp

long getTimestamp()

setTimestamp

void setTimestamp(long t)

getUserPriority

int getUserPriority()

setUserPriority

void setUserPriority(int p)

getClassName

String getClassName()

setClassName

void setClassName(String n)

getSchedulingPriority

int getSchedulingPriority()

getSchedulingPolicy

SchedConstants.Policy getSchedulingPolicy()

getResourceClass

ResourceClass getResourceClass()

countInstances

int countInstances()

setNInstances

void setNInstances(int m)

nThreads

int nThreads()

setThreads

void setThreads(int threads)

getMemory

int getMemory()

setMemory

void setMemory(int memory)

printShares

String printShares()
Logging and debugging - nice to know what my assigned shares are.


getMaxShares

int getMaxShares()

getMinShares

int getMinShares()

setMaxShares

void setMaxShares(int s)

setMinShares

void setMinShares(int s)

setPureFairShare

void setPureFairShare(int s)

getPureFairShare

int getPureFairShare()

setDuccType

void setDuccType(org.apache.uima.ducc.transport.event.common.IDuccTypes.DuccType dt)

getDuccType

org.apache.uima.ducc.transport.event.common.IDuccTypes.DuccType getDuccType()

isInitialized

boolean isInitialized()

getShareWeight

int getShareWeight()

initWantedByOrder

void initWantedByOrder(ResourceClass rc)

getWantedByOrder

int[] getWantedByOrder()

getGivenByOrder

int[] getGivenByOrder()

setGivenByOrder

void setGivenByOrder(int[] gbo)

calculateCap

int calculateCap(int order,
                 int basis)

getApportionmentSorter

Comparator<org.apache.uima.ducc.rm.scheduler.IEntity> getApportionmentSorter()


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