public final class BatchedPagedProcessor extends Object
Licensing: this class can be used with valid LicenseGlobals.MADFAST license.
| Modifier and Type | Method and Description |
|---|---|
static <S,T> long |
process(int pagesize,
int maxQueueSize,
SubProgressObserver po,
ExecutorService ex,
Iterator<S> source,
Function<S,T> process,
ErrorHandler<S> error,
ResultHandler<S,T> target)
Launch a long running process.
|
static <S,T> long |
processManaged(MBeanServer mbs,
ObjectName on,
int pagesize,
int maxQueueSize,
SubProgressObserver po,
ListeningExecutorService ex,
Iterator<S> source,
Function<S,T> process,
ErrorHandler<S> error,
ResultHandler<S,T> target)
Launch a managed long running process.
|
public static <S,T> long processManaged(MBeanServer mbs, ObjectName on, int pagesize, int maxQueueSize, SubProgressObserver po, ListeningExecutorService ex, Iterator<S> source, Function<S,T> process, ErrorHandler<S> error, ResultHandler<S,T> target) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException
This method blocks until done or cancelled through the supplied ProgressObserver. Note that management through JMX might use thread interruption for signalling
S - Source typeT - Target typembs - MBeanServer to provide instrumentationon - ObjectName to pass to mbspagesize - Number of sources to bundlemaxQueueSize - Max queue size.po - Progress observer to track execution. Method ProgressObserver.done() will be invoked before
returningex - ListeningExecutorService to use. Note that using MoreExecutors#sameThreadExecutor() results in
sequentially consistent master thread execution. Use
MoreExecutors.listeningDecorator(java.util.concurrent.ExecutorService) to acquire a
ListeningExecutorService from an ExecutorService.source - Inputs to processprocess - Function to apply on each inputerror - Handler for errorstarget - Handler for resultsInstanceAlreadyExistsException - thrownMBeanRegistrationException - thrownNotCompliantMBeanException - thrownLicenseException - when appropriate license is not availablepublic static <S,T> long process(int pagesize,
int maxQueueSize,
SubProgressObserver po,
ExecutorService ex,
Iterator<S> source,
Function<S,T> process,
ErrorHandler<S> error,
ResultHandler<S,T> target)
S - Source typeT - Target typepagesize - Number of sources to bundlemaxQueueSize - Max queue size.po - Progress observer to track execution. Method ProgressObserver.done() will be invoked before
returningex - ExecutorService to use. Note that using MoreExecutors#sameThreadExecutor() results in
sequentially consistent master thread executionsource - Inputs to processprocess - Function to apply on each inputerror - Handler for errorstarget - Handler for resultsResultHandler.result(int, java.lang.Object, java.lang.Object)LicenseException - when appropriate license is not available