Class SessionCachingMetadataDomainRepository.PentahoAsyncThreadRunner

java.lang.Object
org.pentaho.platform.plugin.services.metadata.SessionCachingMetadataDomainRepository.PentahoAsyncThreadRunner
Enclosing class:
SessionCachingMetadataDomainRepository

public static class SessionCachingMetadataDomainRepository.PentahoAsyncThreadRunner extends Object
Asynchronously executes a collection of tasks (ie Callable ). Contains logic that correctly sets the IPentahoSession for each spawned thread. Wrapper around ExecutorService.
  • Constructor Details

    • PentahoAsyncThreadRunner

      public PentahoAsyncThreadRunner(int numberOfThreads, org.pentaho.platform.api.engine.IPentahoSession pentahoSession, String threadMasterName, String threadExecutorNamingPattern)
      Constructor to set necessary information for underlying ExecutorService instance.
      Parameters:
      numberOfThreads -
      pentahoSession -
      threadMasterName -
      threadExecutorNamingPattern -
    • PentahoAsyncThreadRunner

      public PentahoAsyncThreadRunner(int numberOfThreads, org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
      Constructor to set necessary information for underlying ExecutorService instance.
      Parameters:
      numberOfThreads -
      pentahoSession -
  • Method Details

    • asyncRun

      public <T> Thread asyncRun(Collection<? extends Callable<T>> tasks)
      Asynchronously execute all tasks. Setup overhead for initialization of threading infrastructure will have minimal or no effect on runtime execution of calling class. Wrapper around ExecutorService.
      Parameters:
      tasks - Collection of tasks that will be executed. For each callable, Return non-empty string for success, null otherwise.
      Returns:
      thread used to execute the running of the tasks. The function Thread.start() will have already been called.