Class ThreadPoolProvider

java.lang.Object
com.yahoo.component.AbstractComponent
com.yahoo.container.handler.ThreadPoolProvider
All Implemented Interfaces:
com.yahoo.component.Component, com.yahoo.component.Deconstructable, com.yahoo.container.di.componentgraph.Provider<Executor>, Comparable<com.yahoo.component.Component>

public class ThreadPoolProvider extends com.yahoo.component.AbstractComponent implements com.yahoo.container.di.componentgraph.Provider<Executor>
A configurable thread pool provider for the jdisc default threadpool. This provides the worker threads used for normal request processing. Request an Executor injected in your component constructor if you want to use it.
Author:
Steinar Knutsen, baldersheim, bratseth
  • Field Summary

    Fields inherited from class com.yahoo.component.AbstractComponent

    isDeconstructable
  • Constructor Summary

    Constructors
    Constructor
    Description
    ThreadPoolProvider(ThreadpoolConfig config, com.yahoo.jdisc.Metric metric)
     
    ThreadPoolProvider(ThreadpoolConfig config, com.yahoo.jdisc.Metric metric, ProcessTerminator processTerminator)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Shut down the thread pool, give a grace period of 1 second before forcibly shutting down all worker threads.
    get()
    Get the Executor provided by this class.

    Methods inherited from class com.yahoo.component.AbstractComponent

    clone, compareTo, getClassName, getId, getIdString, hasInitializedId, initId, isDeconstructable, setIsDeconstructable, toString

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ThreadPoolProvider

      @Inject public ThreadPoolProvider(ThreadpoolConfig config, com.yahoo.jdisc.Metric metric)
    • ThreadPoolProvider

      public ThreadPoolProvider(ThreadpoolConfig config, com.yahoo.jdisc.Metric metric, ProcessTerminator processTerminator)
  • Method Details

    • get

      public Executor get()
      Get the Executor provided by this class. This Executor will by default also be used for search queries and processing requests.
      Specified by:
      get in interface com.yahoo.container.di.componentgraph.Provider<Executor>
      Returns:
      a possibly shared executor
    • deconstruct

      public void deconstruct()
      Shut down the thread pool, give a grace period of 1 second before forcibly shutting down all worker threads.
      Specified by:
      deconstruct in interface com.yahoo.component.Deconstructable
      Overrides:
      deconstruct in class com.yahoo.component.AbstractComponent