public final class WorkLoadManager.WorkerPool
extends java.lang.Object
| Constructor and Description |
|---|
WorkerPool(ModelInfo model)
Construct and initial data structure.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cleanup()
removes all stopped workers and workers in state error from the pool.
|
java.util.concurrent.LinkedBlockingDeque<WorkerJob> |
getJobQueue()
Returns the
JobQueue for this model. |
int |
getMaxWorkers()
Returns the maximum number of workers for a model.
|
int |
getMinWorkers()
Returns the minimum number of workers for a model.
|
java.util.List<WorkerThread> |
getWorkers()
Returns a list of worker thread.
|
void |
log()
Logs the current state of this
WorkerPool when level "Debug" is enabled. |
WorkLoadManager.WorkerPool |
scaleWorkers(java.lang.String deviceName,
int newMinWorkers,
int newMaxWorkers)
Sets new worker capcities for this model.
|
public WorkerPool(ModelInfo model)
model - the model this WorkerPool belongs to.public java.util.List<WorkerThread> getWorkers()
public java.util.concurrent.LinkedBlockingDeque<WorkerJob> getJobQueue()
JobQueue for this model.public int getMinWorkers()
public int getMaxWorkers()
public WorkLoadManager.WorkerPool scaleWorkers(java.lang.String deviceName, int newMinWorkers, int newMaxWorkers)
deviceName - the device for the modelnewMinWorkers - minimum amount of workers.newMaxWorkers - maximum amount of workers.ModelInfopublic void log()
WorkerPool when level "Debug" is enabled.
Logs all thread-ids in the pool.
public void cleanup()