public class InternalSlotManager extends Object implements SlotManager
Job.ExecutionTime.SHORTEST
Job.ExecutionTime.SHORT
Job.ExecutionTime.MEDIUM
Job.ExecutionTime.LONG
Modifier and Type | Field and Description |
---|---|
private Agent |
agent |
private static org.slf4j.Logger |
log |
private int[] |
maxSlots |
private int[] |
usedSlots |
Constructor and Description |
---|
InternalSlotManager() |
Modifier and Type | Method and Description |
---|---|
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.
|
private static final org.slf4j.Logger log
private Agent agent
private int[] maxSlots
private int[] usedSlots
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 executepublic 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