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 |
executorServiceassertionsEnabled, asyncStatementsQueue, classpathNativeTypeDelegate, errorStream, executorFactory, extendedProperties, frameStack, introspectionManager, methodContributorRegistry, modelRepository, module, nativeTypeDelegates, operationFactory, outputStream, prettyPrinterManager, profilingEnabled, userInput, warningStreamOPTIMIZE_CONSTRAINT_TRACE, SHORT_CIRCUITNUM_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, setProfilingEnabledbeginParallelTask, clearExecutor, clearThreadLocals, convertToParallel, createThreadLocalFrameStack, createThreadLocalOperationContributorRegistry, endParallelTask, getExecutorService, getFrameStack, getParallelism, initDelegateThreadLocal, initThreadLocals, isParallel, newExecutorService, nullifyThreadLocals, parallelGet, parallelGet, parallelSet, removeAll, setFrameStack, setParallelism, toString, useThreadLocalValuegetAsyncStatementsQueue, getErrorStream, getExtendedProperties, getIntrospectionManager, getModelRepository, getNativeTypeDelegates, getOperationContributorRegistry, getOperationFactory, getOutputStream, getPrettyPrinterManager, getUserInput, getWarningStream, isAssertionsEnabled, isProfilingEnabled, setAssertionsEnabled, setErrorStream, setExtendedProperties, setIntrospectionManager, setModelRepository, setModule, setNativeTypeDelegates, setOperationFactory, setOutputStream, setPrettyPrinterManager, setUserInput, setWarningStreamclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetConstraintsDependedOn, getUnsatisfiedConstraintsBySize, hasFixes, sortUnsatisfiedConstraintsgetExecutorFactorybeginParallelTask, beginParallelTask, configureContext, endParallelTask, ensureNotNested, executeAll, executeAny, getExecutorService, getParallelism, isParallel, isParallelisationLegal, setParallelismgetAsyncStatementsQueue, 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, setWarningStreamprotected 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 trueprotected EvlContextParallel(IEolContext other)
protected IEvlContext createShadowThreadLocalContext()
createShadowThreadLocalContext in class ErlContextParallelpublic IEvlContext getShadow()
EolContextParallelgetShadow in class ErlContextParallelpublic Set<UnsatisfiedConstraint> uniqueUnsatisfiedConstraints()
IEvlContextIEvlContext.getUnsatisfiedConstraints() to a unique one.uniqueUnsatisfiedConstraints in interface IEvlContextpublic Collection<UnsatisfiedConstraint> getUnsatisfiedConstraints()
IEvlContextIEvlModule.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 IEvlContextpublic ConstraintTrace getConstraintTrace()
IEvlContextgetConstraintTrace in interface IEvlContextnull if
the trace is disabled.public void setOptimizeConstraintTrace(boolean optimize)
IEvlContextsetOptimizeConstraintTrace in interface IEvlContextIEvlContext.isOptimizeConstraintTrace()public boolean isOptimizeConstraintTrace()
IEvlContextThe default value is false;
isOptimizeConstraintTrace in interface IEvlContextpublic boolean isShortCircuiting()
IEvlContextisShortCircuiting in interface IEvlContextParallelisShortCircuiting in interface IEvlContextpublic void setShortCircuit(boolean shortCircuit)
IEvlContextsetShortCircuit in interface IEvlContextParallelsetShortCircuit in interface IEvlContextshortCircuit - The new value for the flag.public boolean shouldShortCircuit(Constraint constraint) throws EolRuntimeException
IEvlContextIEvlContext.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 IEvlContextEolRuntimeExceptionpublic IEvlModule getModule()
IErlContextgetModule in interface IEolContextgetModule in interface IErlContextgetModule in interface IEvlContextgetModule in class ErlContextParallelIEolContext.getModule()public void dispose()
dispose in interface IEolContextdispose in class EolContextParallelCopyright © 2020. All rights reserved.