public class EvlContextParallel extends ErlContextParallel implements IEvlContextParallel
Modifier and Type | Field and Description |
---|---|
protected ConstraintTrace |
constraintTrace |
protected boolean |
optimizeConstraintTrace |
protected boolean |
shortCircuiting |
protected boolean |
terminate |
protected Collection<UnsatisfiedConstraint> |
unsatisfiedConstraints |
executorService
assertionsEnabled, asyncStatementsQueue, classpathNativeTypeDelegate, errorStream, executorFactory, extendedProperties, frameStack, introspectionManager, methodContributorRegistry, modelRepository, module, nativeTypeDelegates, operationFactory, outputStream, prettyPrinterManager, profilingEnabled, userInput, warningStream
OPTIMIZE_CONSTRAINT_TRACE, SHORT_CIRCUIT
NUM_THREADS_CONFIG
Modifier | Constructor and Description |
---|---|
|
EvlContextParallel() |
protected |
EvlContextParallel(IEolContext other) |
|
EvlContextParallel(int parallelism) |
Modifier and Type | Method and Description |
---|---|
protected IEvlContext |
createShadowThreadLocalContext() |
void |
dispose() |
ConstraintTrace |
getConstraintTrace()
Used internally to determine evaluated constraints.
|
IEvlModule |
getModule()
Casts the IModule to IErlModule
|
IEvlContext |
getShadow()
Can be used to obtain an optimal execution context while executing in parallel.
|
Collection<UnsatisfiedConstraint> |
getUnsatisfiedConstraints()
This collection is written to internally by the engine during execution.
|
boolean |
isOptimizeConstraintTrace()
Return true if the constraint results cache is optimized.
|
boolean |
isShortCircuiting()
Option allowing validation to terminate early when any invariant is unsatisfied.
|
void |
setOptimizeConstraintTrace(boolean optimize)
Set the flag for using optimized contraint result caching.
|
void |
setShortCircuit(boolean shortCircuit)
Sets whether short-circuited validation is enabled.
|
boolean |
shouldShortCircuit(Constraint constraint)
Checks whether the condition for short-circuiting is met, either by previous invocation returning
true or if there are unsatisfied constraints and the
IEvlContext.isShortCircuiting() flag is enabled, or if the specified module element has been annotated
with a termination criteria and an unsatisfied constraint containing the type is already present. |
Set<UnsatisfiedConstraint> |
uniqueUnsatisfiedConstraints()
This method is called internally once all constraints have been processed to convert
the underlying collection in
IEvlContext.getUnsatisfiedConstraints() to a unique one. |
createThreadLocalExecutorFactory, executeJob, getExecutorFactory, setExecutorFactory, setProfilingEnabled
beginParallelTask, clearExecutor, clearThreadLocals, convertToParallel, createThreadLocalFrameStack, createThreadLocalOperationContributorRegistry, endParallelTask, getExecutorService, getFrameStack, getParallelism, initDelegateThreadLocal, initThreadLocals, isParallel, newExecutorService, nullifyThreadLocals, parallelGet, parallelGet, parallelSet, removeAll, setFrameStack, setParallelism, toString, useThreadLocalValue
getAsyncStatementsQueue, getErrorStream, getExtendedProperties, getIntrospectionManager, getModelRepository, getNativeTypeDelegates, getOperationContributorRegistry, getOperationFactory, getOutputStream, getPrettyPrinterManager, getUserInput, getWarningStream, isAssertionsEnabled, isProfilingEnabled, setAssertionsEnabled, setErrorStream, setExtendedProperties, setIntrospectionManager, setModelRepository, setModule, setNativeTypeDelegates, setOperationFactory, setOutputStream, setPrettyPrinterManager, setUserInput, setWarningStream
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getConstraintsDependedOn, getUnsatisfiedConstraintsBySize, hasFixes, sortUnsatisfiedConstraints
getExecutorFactory
beginParallelTask, beginParallelTask, configureContext, endParallelTask, ensureNotNested, executeAll, executeAny, getExecutorService, getParallelism, isParallel, isParallelisationLegal, setParallelism
getAsyncStatementsQueue, getErrorStream, getExtendedProperties, getFrameStack, getIntrospectionManager, getModelRepository, getNativeTypeDelegates, getOperationContributorRegistry, getOperationFactory, getOutputStream, getPrettyPrinterManager, getUserInput, getWarningStream, isAssertionsEnabled, isProfilingEnabled, setAssertionsEnabled, setErrorStream, setExecutorFactory, setExtendedProperties, setFrameStack, setIntrospectionManager, setModelRepository, setModule, setNativeTypeDelegates, setOperationFactory, setOutputStream, setPrettyPrinterManager, setProfilingEnabled, setUserInput, setWarningStream
protected Collection<UnsatisfiedConstraint> unsatisfiedConstraints
protected ConstraintTrace constraintTrace
protected boolean optimizeConstraintTrace
protected boolean shortCircuiting
protected boolean terminate
public EvlContextParallel()
public EvlContextParallel(int parallelism)
parallelism
- The number of threads to use.threadSafeBaseFrames
- whether the base FrameStack should use a thread-safe collection.
default is true
protected EvlContextParallel(IEolContext other)
protected IEvlContext createShadowThreadLocalContext()
createShadowThreadLocalContext
in class ErlContextParallel
public IEvlContext getShadow()
EolContextParallel
getShadow
in class ErlContextParallel
public Set<UnsatisfiedConstraint> uniqueUnsatisfiedConstraints()
IEvlContext
IEvlContext.getUnsatisfiedConstraints()
to a unique one.uniqueUnsatisfiedConstraints
in interface IEvlContext
public Collection<UnsatisfiedConstraint> getUnsatisfiedConstraints()
IEvlContext
IEvlModule.execute()
mandates the results to be a Set,
for performance optimisation reasons this method is permitted to return
any collection, so long as once execution is complete, the results contain
no duplicates. This collection should therefore only be used to add elements,
and is expected not to be queried during execution.getUnsatisfiedConstraints
in interface IEvlContext
public ConstraintTrace getConstraintTrace()
IEvlContext
getConstraintTrace
in interface IEvlContext
null
if
the trace is disabled.public void setOptimizeConstraintTrace(boolean optimize)
IEvlContext
setOptimizeConstraintTrace
in interface IEvlContext
IEvlContext.isOptimizeConstraintTrace()
public boolean isOptimizeConstraintTrace()
IEvlContext
The default value is false;
isOptimizeConstraintTrace
in interface IEvlContext
public boolean isShortCircuiting()
IEvlContext
isShortCircuiting
in interface IEvlContextParallel
isShortCircuiting
in interface IEvlContext
public void setShortCircuit(boolean shortCircuit)
IEvlContext
setShortCircuit
in interface IEvlContextParallel
setShortCircuit
in interface IEvlContext
shortCircuit
- The new value for the flag.public boolean shouldShortCircuit(Constraint constraint) throws EolRuntimeException
IEvlContext
IEvlContext.isShortCircuiting()
flag is enabled, or if the specified module element has been annotated
with a termination criteria and an unsatisfied constraint containing the type is already present.shouldShortCircuit
in interface IEvlContext
EolRuntimeException
public IEvlModule getModule()
IErlContext
getModule
in interface IEolContext
getModule
in interface IErlContext
getModule
in interface IEvlContext
getModule
in class ErlContextParallel
IEolContext.getModule()
public void dispose()
dispose
in interface IEolContext
dispose
in class EolContextParallel
Copyright © 2020. All rights reserved.