Class WorkerGroup<I,​O>


  • public class WorkerGroup<I,​O>
    extends java.lang.Object
    The WorkerGroup manages the WorkerPool for a particular Device.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void configureWorkers​(int minWorkers, int maxWorkers)
      Configures minimum and maximum number of workers.
      ai.djl.Device getDevice()
      Returns the device of the worker group.
      int getMaxWorkers()
      Returns the max number of workers for the model and device.
      int getMinWorkers()
      Returns the min number of workers for the model and device.
      java.util.List<WorkerThread<I,​O>> getWorkers()
      Returns a list of workers.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getDevice

        public ai.djl.Device getDevice()
        Returns the device of the worker group.
        Returns:
        the device of the worker group
      • getWorkers

        public java.util.List<WorkerThread<I,​O>> getWorkers()
        Returns a list of workers.
        Returns:
        a list of workers
      • getMinWorkers

        public int getMinWorkers()
        Returns the min number of workers for the model and device.
        Returns:
        the min number of workers for the model and device
      • getMaxWorkers

        public int getMaxWorkers()
        Returns the max number of workers for the model and device.
        Returns:
        the max number of workers for the model and device
      • configureWorkers

        public void configureWorkers​(int minWorkers,
                                     int maxWorkers)
        Configures minimum and maximum number of workers.
        Parameters:
        minWorkers - the minimum number of workers
        maxWorkers - the maximum number of workers