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 (ieCallable). Contains logic that correctly sets theIPentahoSessionfor each spawned thread. Wrapper aroundExecutorService.
-
-
Constructor Summary
Constructors Constructor Description PentahoAsyncThreadRunner(int numberOfThreads, org.pentaho.platform.api.engine.IPentahoSession pentahoSession)Constructor to set necessary information for underlyingExecutorServiceinstance.PentahoAsyncThreadRunner(int numberOfThreads, org.pentaho.platform.api.engine.IPentahoSession pentahoSession, String threadMasterName, String threadExecutorNamingPattern)Constructor to set necessary information for underlyingExecutorServiceinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> ThreadasyncRun(Collection<? extends Callable<T>> tasks)Asynchronously execute alltasks.
-
-
-
Constructor Detail
-
PentahoAsyncThreadRunner
public PentahoAsyncThreadRunner(int numberOfThreads, org.pentaho.platform.api.engine.IPentahoSession pentahoSession, String threadMasterName, String threadExecutorNamingPattern)Constructor to set necessary information for underlyingExecutorServiceinstance.- Parameters:
numberOfThreads-pentahoSession-threadMasterName-threadExecutorNamingPattern-
-
PentahoAsyncThreadRunner
public PentahoAsyncThreadRunner(int numberOfThreads, org.pentaho.platform.api.engine.IPentahoSession pentahoSession)Constructor to set necessary information for underlyingExecutorServiceinstance.- Parameters:
numberOfThreads-pentahoSession-
-
-
Method Detail
-
asyncRun
public <T> Thread asyncRun(Collection<? extends Callable<T>> tasks)
Asynchronously execute alltasks. Setup overhead for initialization of threading infrastructure will have minimal or no effect on runtime execution of calling class. Wrapper aroundExecutorService.- 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 functionThread.start()will have already been called.
-
-