Class RrdSyncThreadPool

java.lang.Object
org.rrd4j.core.RrdSyncThreadPool

public class RrdSyncThreadPool
extends Object
Thread pool used by RrdNioBackend instances to periodically sync the mapped file to disk. Note that instances of RrdSyncThreadPool must be disposed of by calling shutdown().

For ease of use in standalone applications, clients may choose to register a shutdown hook by calling registerShutdownHook(). However, in web applications it is best to explicitly shutdown() the pool when the application is un-deployed, usually within a javax.servlet.ServletContextListener.

Since:
2.2
  • Constructor Details

    • RrdSyncThreadPool

      public RrdSyncThreadPool()
      Creates a new RrdSyncThreadPool with a default pool size of 6.
    • RrdSyncThreadPool

      public RrdSyncThreadPool​(ScheduledExecutorService syncExecutor)
      Creates a new RrdSyncThreadPool with a user-provided ScheduledExecutorService.
      Parameters:
      syncExecutor - the ScheduledExecutorService to use for sync'ing mapped files to disk
    • RrdSyncThreadPool

      public RrdSyncThreadPool​(int syncPoolSize)
      Creates a new RrdSyncThreadPool with the given pool size.
      Parameters:
      syncPoolSize - the number of threads to use to sync the mapped file to disk
    • RrdSyncThreadPool

      public RrdSyncThreadPool​(int syncPoolSize, ThreadFactory threadFactory)
      Creates a new RrdSyncThreadPool with the given pool size. Threads will be created by threadFactory.
      Parameters:
      syncPoolSize - the number of threads to use to sync the mapped file to disk
      threadFactory - the ThreadFactory to use for creating threads
  • Method Details