The Processing Pattern Namespace provides the ability to declaratively configure the Processing Pattern.
The implementation is provided by the com.oracle.coherence.patterns.processing.configuration.ProcessingPatternNamespaceHandler
class.
The common prefix used for this namespace in Cache Configurations is processing
,
however as with all XML namespace declarations this can be defined arbitrarily
when declaring the namespace.
To use the namespace you should declare it as follows:
<cache-config xmlns:processing="class://com.oracle.coherence.patterns.processing.configuration.ProcessingPatternNamespaceHandler">
...
</cache-config>
The following section outlines the elements defined by this namespace, the most important of which are the <processing:cluster-config> and the <processing:extend-config> elements. These elements are typically incorporated into Coherence Cache Config <cache-config> elements.
Reference:
The following elements are defined by this namespace.
<processing:attribute-match-policy>
The element will specifies that the attributes declared in a
SubmissionConfiguration
must match those defined by a TaskProcessor
.
Used in:
This element is a child element of <processing:task-dispatcher>.
Example:
<processing:attribute-match-policy />
See Also:
This element defines an attribute for a TaskProcessor
.
Used in:
This element is a child element of <processing:taskprocessordefinition>.
Attributes:
The following attributes must be defined as part of this element:
name
The name of the attribute
Examples:
<processing:attribute name="attribute-name">attribute-value</processing:attribute>
<processing:attribute name="operating-system">WINDOWS</processing:attribute>
See Also:
This element specifies the configuration of a Processing Pattern Cluster Member.
Used in:
This element is to be defined as a child of a <cache-config>
element with in
an Oracle Coherence Cache Configuration file.
Child Elements:
Zero or more the following elements may be defined as a child element ofthis element:
Specifies TaskDispatcher
definitions.
Specifies TaskProcessor
definitions.
This elements defines a Task Dispatch policy that is the composition of two other Task Dispatch Policies.
The first policy is evaluated to select a subset of TaskProcessors, after which the second policy is used to further restrict tasks.
Used in:
This element is a child element of <processing:task-dispatcher>.
Child Elements:
Exactly two of the following elements must be defined as children of this element:
<processing:attribute-match-policy>
Specifies an Attribute Matching Task Dispatch Policy.
Specifies a Composite Task Dispatch Policy.
<processing:round-robin-policy>
Specifies a Round Robin Task Dispatch Policy.
Specifies a Random Task Dispatch Policy.
<instance>
An Oracle Coherence <instance>
element, defining an TaskDispatchPolicy
to be used for instantiating a custom TaskDispatchPolicy
implementation.
<class-scheme>
An Oracle Coherence <class-scheme>
element, defining an TaskDispatchPolicy
to be used for instantiating a custom TaskDispatchPolicy
implementation.
Example:
<processing:composite-policy>
<processing:attribute-match-policy />
<processing:round-robin-policy />
</processing:composite-policy>
<processing:default-taskprocessor>
This element defines a default TaskProcessor
.
Used in:
This element is a child element of <processing:taskprocessordefinition>.
Attributes:
The following attributes must be defined as part of this element:
id
(required)
The unique identity of the TaskProcessor
. This is used for logging and
JMX instrumentation.
threadpoolsize
(required)
The number of threads for the TaskProcessor
. Each thread can execute a Task
concurrently.
Example:
<processing:default-taskprocessor id="GridTaskProcessor" threadpoolsize="10" />
This element defines the dispatcher configuration for a Processing Pattern Cluster Member.
The order of the child elements defines the order of Dispatcher evaluation
Used in:
This element is a child element of <processing:cluster-config>.
Child Elements:
Zero or more the following elements may be defined as a child element ofthis element:
<processing:local-executor-dispatcher>
Specifies a LocalExecutorDispatcher
.
<processing:logging-dispatcher>
Specifies a LoggingDispatcher
.
Specifies a Task Dispatcher.
<instance>
An Oracle Coherence <instance>
element, defining an Dispatcher
to be used for instantiating a custom Dispatcher
implementation.
<class-scheme>
An Oracle Coherence <class-scheme>
element, defining an Dispatcher
to be used for instantiating a custom Dispatcher
implementation.
This element defines configuration for a Processing Pattern Extend Client, that of which may optionally participate and perform calculations on behalf of the Processing Pattern Cluster Members.
An Extend client can serve as a client to the processing pattern submitting work as well as execute tasks using TaskProcessors. However, it can't serve as a Dispatcher. That means that any processing pattern deployment needs Processing Pattern Cluster Members to do the dispatching.
Used in:
This element is to be defined as a child of a <cache-config>
element with in
an Oracle Coherence Cache Configuration file.
Child Elements:
The following elements may be defined as a child element ofthis element:
<
Specifies the Coherence Extend Client connection configuration.
<processing:taskprocessors> (optional)
Specifies the configuration of optional Extend Client-side TaskProcessors
.
<processing:local-executor-dispatcher>
This element defines a LocalExecutorDispatcher
as part of a Dispatcher
chain.
A LocalExecutorDispatcher
will accept Submissions
containing payload that implements
the Java Runnable or
Callable interfaces.
The submitted Runnables/Callables will be executed on the node where the Dispatching takes place.
Used in:
This element is a child element of <processing:dispatchers>.
Attributes:
The following attribute must be defined a part of this element:
displayname
(required)
The display name for the Dispatcher
.
threadpoolsize
(required)
The number of threads for the Dispatcher
may use for concurrently executing
Runnables/Callables.
<processing:logging-dispatcher>
This element defines a LoggingDispatcher
as part of a Dispatcher
chain.
A LoggingDispatcher
logs Submissions
to the java.util.logging
Framework,
instead of accepting them for execution. This allows other Dispatcher
implementations
defined in the <processing:dispatchers> to continue processing.
Used in:
This element is a child element of <processing:dispatchers>.
Attributes:
The following attribute must be defined a part of this element:
displayname
(required)
The display name of the TaskDispatcher
.
The element will specifies that a randomized approach for selecting an appropriate
TaskProcessor
to execute a submitted Task
should be used.
Used in:
This element is a child element of <processing:task-dispatcher>.
Example:
<processing:random-policy />
<processing:round-robin-policy>
The element will specifies that a round-robin
approach for selecting an appropriate TaskProcessor
to execute a submitted Task
should be used.
Used in:
This element is a child element of <processing:task-dispatcher>.
Example:
<processing:round-robin-policy />
This element defines a TaskDispatcher
in the Dispatcher chain.
A TaskDispatcher
dispatches Tasks
to TaskProcessors
using according to a
TaskDispatchPolicy
.
A TaskDispatchPolicy
must be specified as a child element to the TaskDispatcher
.
If no TaskDispatchPolicy
is specified, the RoundRobinPolicy
is used.
Used in:
This element is a child element of <processing:dispatchers>.
Attributes:
The following attribute must be defined a part of this element:
displayname
(required)
The display name of the TaskDispatcher
.
Child Elements:
One of the following elements must be defined as children of this element:
<processing:attribute-match-policy>
Specifies an Attribute Matching Task Dispatch Policy.
Specifies a Composite Task Dispatch Policy.
<processing:round-robin-policy>
Specifies a Round Robin Task Dispatch Policy.
Specifies a Random Task Dispatch Policy.
<instance>
An Oracle Coherence <instance>
element, defining an TaskDispatchPolicy
to be used for instantiating a custom TaskDispatchPolicy
implementation.
<class-scheme>
An Oracle Coherence <class-scheme>
element, defining an TaskDispatchPolicy
to be used for instantiating a custom TaskDispatchPolicy
implementation.
<processing:taskprocessordefinition>
This element defines a TaskProcessor
that of which may be used for executing
Tasks
dispatched by TaskDispatchers
.
Used in:
This element is a child element of <processing:task-processors>.
Attributes:
The following attributes must be defined a part of this element:
id
(required)
The unique identity for the TaskProcessor
.
displayname
(required)
The display name for the TaskProcessor
.
type
(required)
The type of the TaskProcessor
indicates where it will be instantiated.
There are two valid types:
GRID
indicating the TaskProcessor
should be instantiated in every
Cluster Member.
SINGLE
indicating that the TaskProcessor
should be instantiated only
in a single Cluster Member.
Child Elements:
One of the following elements must be defined as child of this element:
<processing:default-taskprocessor>
The default definition of a TaskProcessor
.
<instance>
An Oracle Coherence <instance>
element, defining an TaskProcessor
to be used for instantiating a custom TaskProcessor
implementation.
<class-scheme>
An Oracle Coherence <class-scheme>
element, defining an TaskDispatchPolicy
to be used for instantiating a custom TaskProcessor
implementation.
Zero or more of the following elements may be defined as children of this element:
An attribute that must be part of the Submission
in order for the Task
to be executed by the TaskProcessor
when using the
<processing:attribute-matching-policy>.
This element defines TaskProcessor
s that of which are used by TaskDispatchers
for executing Tasks
.
Used in:
This element is a child element ofeither <processing:cluster-config> or <processing:extend-config>.
Child Elements:
One of the following elements must be defined as child of this element:
<processing:taskprocessordefinition>
The definition of a TaskProcessor
.
Example:
<processing:taskprocessors>
<processing:taskprocessordefinition id="GridTaskProcessor"
displayname="Grid Task Processor"
type="GRID">
<processing:default-taskprocessor id="GridTaskProcessor"
threadpoolsize="10" />
<processing:attribute name="operating-system">LINUX</processing:attribute>
</processing:taskprocessordefinition>
</processing:taskprocessors>