I
- input symbol typeD
- output domain type@ParametersAreNonnullByDefault public class StaticParallelOracle<I,D> extends Object implements ParallelOracle<I,D>
An incoming set of queries is divided into a given number of batches, such that the sizes of all batches differ by at most one. This keeps the required synchronization effort low, but if some batches are "harder" (for whatever reason) than others, the load can be very unbalanced.
ParallelOracle.PoolPolicy
MembershipOracle.DFAMembershipOracle<I>, MembershipOracle.MealyMembershipOracle<I,O>
Modifier and Type | Field and Description |
---|---|
static int |
MIN_BATCH_SIZE |
static int |
NUM_INSTANCES |
static ParallelOracle.PoolPolicy |
POOL_POLICY |
Constructor and Description |
---|
StaticParallelOracle(Collection<? extends MembershipOracle<I,D>> oracles,
int minBatchSize,
ParallelOracle.PoolPolicy policy) |
Modifier and Type | Method and Description |
---|---|
void |
processQueries(Collection<? extends Query<I,D>> queries)
Processes the specified collection of queries.
|
void |
shutdown()
Shuts down all worker threads, but waits for any queued queries to be processed.
|
void |
shutdownNow()
Shuts down all worker threads, and attempts to abort any query processing currently taking place.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
answerQuery, answerQuery, asOracle, processQuery
public static final int MIN_BATCH_SIZE
public static final int NUM_INSTANCES
public static final ParallelOracle.PoolPolicy POOL_POLICY
public StaticParallelOracle(Collection<? extends MembershipOracle<I,D>> oracles, @Nonnegative int minBatchSize, ParallelOracle.PoolPolicy policy)
public void processQueries(Collection<? extends Query<I,D>> queries)
MembershipOracle
Query.answer(Object)
method should have been called with an argument reflecting the SUL response to the
respective query.processQueries
in interface MembershipOracle<I,D>
queries
- the queries to processQuery.answer(Object)
public void shutdown()
ParallelOracle
shutdown
in interface ParallelOracle<I,D>
ExecutorService.shutdown()
public void shutdownNow()
ParallelOracle
shutdownNow
in interface ParallelOracle<I,D>
ExecutorService.shutdownNow()
Copyright © 2018. All rights reserved.