|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.clients.jobagent.slotmanager.InternalSlotManager
public class InternalSlotManager
The internal slot manager assigns slot to jobs based on their estimated execution time. The configuration file gives the maximum number of slots for each execution time:
Job.ExecutionTime#SHORTEST
Job.ExecutionTime#SHORT
Job.ExecutionTime#MEDIUM
Job.ExecutionTime#LONG
Field Summary | |
---|---|
private Agent |
agent
|
private static Logger |
log
|
private int[] |
maxSlots
|
private int[] |
usedSlots
|
Constructor Summary | |
---|---|
InternalSlotManager()
|
Method Summary | |
---|---|
void |
close()
This method is called when the job agent is shutting down. |
protected Agent |
getAgent()
Get the job agent this slot manager belongs to. |
protected Slot |
getSlot(Job.ExecutionTime estimated)
Get a slot for a job with the given estimated execution time. |
Slot |
getSlot(Job job)
Get a slot for the specified job. |
void |
init(Agent agent)
Initialize the slot manager. |
void |
releaseSlot(Slot slot)
Called by the job agent when the job has finished exeuting. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final Logger log
private Agent agent
private int[] maxSlots
private int[] usedSlots
Constructor Detail |
---|
public InternalSlotManager()
Method Detail |
---|
public void init(Agent agent)
SlotManager
init
in interface SlotManager
agent
- The job agentpublic void close()
SlotManager
close
in interface SlotManager
public Slot getSlot(Job job)
SlotManager
getSlot
in interface SlotManager
job
- The job that the job agent wants to execute
public void releaseSlot(Slot slot)
SlotManager
releaseSlot
in interface SlotManager
slot
- The slot that was assigned to the jobprotected Agent getAgent()
init(Agent)
protected Slot getSlot(Job.ExecutionTime estimated)
estimated
- The estimated execution time of the slot
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |