Class WorkerThread.Builder

  • Enclosing class:
    WorkerThread

    public static class WorkerThread.Builder
    extends java.lang.Object
    A Builder to construct a WorkerThread.
    • Method Detail

      • self

        protected WorkerThread.Builder self()
        Returns self reference to this builder.
        Returns:
        self reference to this builder
      • preBuildProcessing

        protected void preBuildProcessing()
      • validate

        protected void validate()
      • setModel

        public WorkerThread.Builder setModel​(ModelInfo model)
        Sets the ModelInfo the thread will be responsible for.
        Parameters:
        model - the model to set
        Returns:
        self-reference to this builder.
      • optAggregator

        public WorkerThread.Builder optAggregator​(ai.djl.serving.wlm.BatchAggregator aggregator)
        Sets a BatchAggregator which overrides the instantiated default BatchAggregator.
        Parameters:
        aggregator - the BatchAggregator to set
        Returns:
        self-reference to this builder.
      • setJobQueue

        public WorkerThread.Builder setJobQueue​(java.util.concurrent.LinkedBlockingDeque<WorkerJob> jobQueue)
        Sets the jobQueue used to poll for new jobs. The jobQueue is passed to the created standard BatchAggregators if the Batch-Aggregator is not override using optAggregator(BatchAggregator)
        Parameters:
        jobQueue - the jobQueue to set
        Returns:
        self-reference to this builder.
      • optFixPoolThread

        public WorkerThread.Builder optFixPoolThread​(boolean fixPoolThread)
        Sets if the workerThread should be part of the fixed pool. Fixed Pool workers don't terminate themself but are managed by WorkLoadManager min/max-worker scale functionality.
        Parameters:
        fixPoolThread - the fixPoolThread to set
        Returns:
        self-reference to this builder.