Class SessionCachingMetadataDomainRepository.PentahoAsyncThreadRunner

    • Constructor Detail

      • 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 Detail

      • 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.