Class PrefetchWorkerExecutorService

java.lang.Object
me.ahoo.cosid.segment.concurrent.PrefetchWorkerExecutorService

public class PrefetchWorkerExecutorService extends Object
Prefetch Worker Executor Service.
  • Field Details

    • DEFAULT_PREFETCH_PERIOD

      public static final Duration DEFAULT_PREFETCH_PERIOD
  • Constructor Details

    • PrefetchWorkerExecutorService

      public PrefetchWorkerExecutorService(Duration prefetchPeriod, int corePoolSize)
    • PrefetchWorkerExecutorService

      public PrefetchWorkerExecutorService(Duration prefetchPeriod, int corePoolSize, boolean shutdownHook)
  • Method Details

    • shared

      public static PrefetchWorkerExecutorService shared()
      The executor shared by segment chains that are not given one, created on first use.

      It has one worker per available processor and shuts down with the JVM. Applications that manage their own lifecycle, like the Spring Boot starter, should pass their own executor instead.

      Returns:
      the shared executor
    • shutdown

      public void shutdown()
    • submit

      public void submit(AffinityJob affinityJob)