Package com.saxonica.ee.parallel
Class MultithreadedForEach
java.lang.Object
net.sf.saxon.expr.Expression
net.sf.saxon.expr.instruct.Instruction
net.sf.saxon.expr.instruct.ForEach
com.saxonica.ee.parallel.MultithreadedForEach
- All Implemented Interfaces:
ContextOriginator
,ContextSwitchingExpression
,ExportAgent
,Locatable
,IdentityComparable
,Traceable
This instruction represents an xsl:for-each instruction using more than one thread
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Nested classes/interfaces inherited from class net.sf.saxon.expr.instruct.ForEach
ForEach.ForEachElaborator
-
Field Summary
Fields inherited from class net.sf.saxon.expr.instruct.ForEach
_isInstruction, actionOp, containsTailCall, selectOp, separatorOp, threadsOp
Fields inherited from class net.sf.saxon.expr.Expression
EFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, MAX_COST, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, PROCESS_METHOD, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, UPDATE_METHOD, WATCH_METHOD
-
Constructor Summary
ConstructorsConstructorDescriptionMultithreadedForEach
(Expression select, Expression action, boolean containsTailCall, Expression threads) -
Method Summary
Modifier and TypeMethodDescriptioncopy
(RebindingMap rebindings) Copy an expression.protected void
Add the value of the saxon:threads attribute to the explain outputMake an elaborator for this expressionGet a name identifying the kind of expression, in terms meaningful to a user.int
An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process().boolean
isMultiThreaded
(Configuration config) Ask whether the expression is multithreaded (that is, whether its operands are evaluated in parallel)iterate
(XPathContext context) Return an Iterator to iterate over the values of the sequence.optimize
(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) Perform optimisation of an expression and its subexpressions.Methods inherited from class net.sf.saxon.expr.instruct.ForEach
addToPathMap, alwaysCreatesNewNodes, checkForUpdatingSubexpressions, checkPermittedContents, computeSpecialProperties, export, getAction, getActionExpression, getInstructionNameCode, getItemType, getNumberOfThreadsExpression, getSelect, getSelectExpression, getSeparatorExpression, getStaticUType, getStreamerName, getThreads, isContainsTailCall, isInstruction, isUpdatingExpression, makeSeparator, mayCreateNewNodes, operands, setAction, setActionExpression, setContainsTailCall, setInstruction, setSelect, setSelectExpression, setSeparatorExpression, setThreads, toShortString, toString, typeCheck, unordered
Methods inherited from class net.sf.saxon.expr.instruct.Instruction
assembleParams, assembleTunnelParams, computeCardinality, dynamicError, evaluateAsString, evaluateItem, getNetCost, getSourceLocator, isXSLT, process, someOperandCreatesNewNodes
Methods inherited from class net.sf.saxon.expr.Expression
adoptChildExpression, allowExtractingCommonSubexpressions, checkedOperands, computeDependencies, computeHashCode, computeStaticProperties, dispatchTailCall, dynamicError, effectiveBooleanValue, equals, explain, getCardinality, getConfiguration, getCost, getDependencies, getEvaluationMethod, getExtraProperty, getIntegerBounds, getIntrinsicDependencies, getLocalRetainedStaticContext, getLocation, getObjectName, getPackageData, getParentExpression, getProperties, getProperty, getRetainedStaticContext, getScopingExpression, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStaticType, getTracingTag, hasCompatibleStaticContext, hashCode, hasSpecialProperty, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isCallOn, isEqual, isIdentical, isLiftable, isStaticPropertiesKnown, isSubtreeExpression, isVacuousExpression, makeElaborator, markTailFunctionCalls, operandList, operandSparseList, optimizeChildren, prepareForStreaming, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setExtraProperty, setFiltered, setFlattened, setLocation, setParentExpression, setRetainedStaticContext, setRetainedStaticContextLocally, setRetainedStaticContextThoroughly, setStaticProperty, simplify, simplifyChildren, staticTypeCheck, supportsLazyEvaluation, suppressValidation, toPattern, typeCheckChildren, typeError, verifyParentPointers, withLocation
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.sf.saxon.trace.Traceable
gatherProperties
-
Constructor Details
-
MultithreadedForEach
public MultithreadedForEach(Expression select, Expression action, boolean containsTailCall, Expression threads)
-
-
Method Details
-
isMultiThreaded
Description copied from class:Expression
Ask whether the expression is multithreaded (that is, whether its operands are evaluated in parallel)- Overrides:
isMultiThreaded
in classExpression
- Parameters:
config
- the Saxon configuration- Returns:
- true if execution will be multithreaded
-
optimize
public Expression optimize(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException Description copied from class:Expression
Perform optimisation of an expression and its subexpressions. This is the third and final phase of static optimization.This method is called after all references to functions and variables have been resolved to the declaration of the function or variable, and after all type checking has been done.
- Overrides:
optimize
in classForEach
- Parameters:
visitor
- an expression visitorcontextInfo
- the static type of "." at the point where this expression is invoked. The parameter is set to null if it is known statically that the context item will be undefined. If the type of the context item is not known statically, the argument is set toType.ITEM_TYPE
- Returns:
- the original expression, rewritten if appropriate to optimize execution
- Throws:
XPathException
- if an error is discovered during this phase (typically a type error)
-
copy
Description copied from class:ForEach
Copy an expression. This makes a deep copy. -
getImplementationMethod
public int getImplementationMethod()An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process(). This method indicates which of these methods is provided. This implementation provides only the process() method natively.- Overrides:
getImplementationMethod
in classForEach
- Returns:
- the implementation method, for example
Expression.ITERATE_METHOD
orExpression.EVALUATE_METHOD
orExpression.PROCESS_METHOD
-
iterate
Return an Iterator to iterate over the values of the sequence.- Overrides:
iterate
in classForEach
- Parameters:
context
- supplies the context for evaluation- Returns:
- a SequenceIterator that can be used to iterate over the result of the expression
- Throws:
XPathException
- if any dynamic error occurs evaluating the expression
-
getExpressionName
Get a name identifying the kind of expression, in terms meaningful to a user.- Overrides:
getExpressionName
in classForEach
- Returns:
- a name identifying the kind of expression, in terms meaningful to a user. The name will always be in the form of a lexical XML QName, and should match the name used in explain() output displaying the expression.
-
explainThreads
Add the value of the saxon:threads attribute to the explain output- Overrides:
explainThreads
in classForEach
- Parameters:
out
- the destination for explain output- Throws:
XPathException
-
getElaborator
Make an elaborator for this expression- Overrides:
getElaborator
in classForEach
- Returns:
- a suitable elaborator
-