public class WorkLoadManager
extends java.lang.Object
| Constructor and Description |
|---|
WorkLoadManager()
Constructs a
WorkLoadManager instance. |
| Modifier and Type | Method and Description |
|---|---|
int |
getNumRunningWorkers(ModelInfo modelInfo)
Returns the number of running workers of a model.
|
int |
getQueueLength(ModelInfo modelInfo)
Returns the current number of request in the queue.
|
java.util.List<WorkerThread> |
getWorkers(ModelInfo modelInfo)
Returns the workers for the specific model.
|
void |
modelChanged(ModelInfo modelInfo)
Triggers a model change event.
|
java.util.concurrent.CompletableFuture<ai.djl.modality.Output> |
runJob(Job job)
Adds an inference job to the job queue of the next free worker.
|
public WorkLoadManager()
WorkLoadManager instance.public java.util.List<WorkerThread> getWorkers(ModelInfo modelInfo)
modelInfo - the name of the model we are looking for.public java.util.concurrent.CompletableFuture<ai.djl.modality.Output> runJob(Job job)
job - an inference job to be executed.true if submit success, false otherwise.public int getNumRunningWorkers(ModelInfo modelInfo)
modelInfo - the model we are interested in.public void modelChanged(ModelInfo modelInfo)
modelInfo - the changed model.public int getQueueLength(ModelInfo modelInfo)
modelInfo - the model