Package de.learnlib.oracle.parallelism
Class AbstractStaticBatchProcessorBuilder<Q,P extends BatchProcessor<Q>,OR>
- java.lang.Object
-
- de.learnlib.oracle.parallelism.AbstractStaticBatchProcessorBuilder<Q,P,OR>
-
- Type Parameters:
Q
- query typeP
- (sub-) processor typeOR
- constructed oracle type
- Direct Known Subclasses:
StaticParallelAdaptiveOracleBuilder
,StaticParallelOmegaOracleBuilder
,StaticParallelOracleBuilder
public abstract class AbstractStaticBatchProcessorBuilder<Q,P extends BatchProcessor<Q>,OR> extends Object
A builder for aAbstractStaticBatchProcessor
.
-
-
Constructor Summary
Constructors Constructor Description AbstractStaticBatchProcessorBuilder(Collection<? extends P> oracles)
AbstractStaticBatchProcessorBuilder(Supplier<? extends P> oracleSupplier)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract OR
buildOracle(Collection<? extends P> oracleInstances, int minBatchSize, ExecutorService executor)
OR
create()
Create the batch processor.AbstractStaticBatchProcessorBuilder<Q,P,OR>
withCustomExecutor(ExecutorService executor)
Sets the executor service to use for submitting batches.AbstractStaticBatchProcessorBuilder<Q,P,OR>
withMinBatchSize(@org.checkerframework.checker.index.qual.NonNegative int minBatchSize)
Sets the minimal size of batches that are submitted.AbstractStaticBatchProcessorBuilder<Q,P,OR>
withNumInstances(@org.checkerframework.checker.index.qual.NonNegative int numInstances)
Sets the number of instances that should process batches.AbstractStaticBatchProcessorBuilder<Q,P,OR>
withPoolPolicy(ThreadPool.PoolPolicy policy)
Sets the pool policy in case the builder creates its own executor for processing batches.
-
-
-
Constructor Detail
-
AbstractStaticBatchProcessorBuilder
public AbstractStaticBatchProcessorBuilder(Supplier<? extends P> oracleSupplier)
-
AbstractStaticBatchProcessorBuilder
public AbstractStaticBatchProcessorBuilder(Collection<? extends P> oracles)
-
-
Method Detail
-
withCustomExecutor
public AbstractStaticBatchProcessorBuilder<Q,P,OR> withCustomExecutor(ExecutorService executor)
Sets the executor service to use for submitting batches.- Parameters:
executor
- the executor to use- Returns:
this
-
withMinBatchSize
public AbstractStaticBatchProcessorBuilder<Q,P,OR> withMinBatchSize(@org.checkerframework.checker.index.qual.NonNegative int minBatchSize)
Sets the minimal size of batches that are submitted.- Parameters:
minBatchSize
- the minimal size of batches- Returns:
this
-
withNumInstances
public AbstractStaticBatchProcessorBuilder<Q,P,OR> withNumInstances(@org.checkerframework.checker.index.qual.NonNegative int numInstances)
Sets the number of instances that should process batches. Note that this value is ignored if the builder has been initialized with a collection of processors in order to guarantee that no unavailable resources are accessed.- Parameters:
numInstances
- the number of instances to delegate batches to- Returns:
this
-
withPoolPolicy
public AbstractStaticBatchProcessorBuilder<Q,P,OR> withPoolPolicy(ThreadPool.PoolPolicy policy)
Sets the pool policy in case the builder creates its own executor for processing batches.- Parameters:
policy
- the policy- Returns:
this
-
create
public OR create()
Create the batch processor.- Returns:
- the batch processor
-
buildOracle
protected abstract OR buildOracle(Collection<? extends P> oracleInstances, int minBatchSize, ExecutorService executor)
-
-