public class RuleRegistry extends java.lang.Object
Rule
and allows for either asserts, transforms, and partitioning
of pipe assembly process graphs.
Process graphs are initially a standard Pipe assembly and connected Taps. And depending on the underlying platform
are partitioned into units of execution along the process hierarchy of
ProcessLevel.Assembly
, ProcessLevel.Step
,
ProcessLevel.Node
, and ProcessLevel.Pipeline
.
Where the Assembly is the user created pipe assembly and taps. The Steps are physical jobs executed by a platform.
Nodes are internal elements of work within a job (a Mapper or Reducer in the case of MapReduce). And Pipelines,
which are non-blocking streamed paths within a node. These can be optional.
Rules rely on a 'language' for sub-graph pattern matching and can be applied against a given process type
(Assembly, or Step, etc), to test its correctness, or make changes to the graph. Or they can be used to partition a
large graph into a smaller graph, converting an Assembly into Steps.
Debugging rule sets can be done by enabling system properties, see FlowPlanner
.
The RuleExec
class is responsible for executing on a given rule set.Constructor and Description |
---|
RuleRegistry() |
Modifier and Type | Method and Description |
---|---|
boolean |
addDefaultElementFactory(java.lang.String name,
ElementFactory elementFactory)
Adds the named elementFactory if it does not already exist.
|
ElementFactory |
addElementFactory(java.lang.String name,
ElementFactory elementFactory) |
boolean |
addRule(Rule rule) |
void |
enableDebugLogging()
Method enableDebugLogging forces log4j to emit DEBUG level stats for the planner classes.
|
boolean |
enabledResolveElements() |
boolean |
equals(java.lang.Object object) |
ElementFactory |
getElementFactory(java.lang.String factoryName) |
java.lang.String |
getName() |
java.util.Set<ProcessLevel> |
getProcessLevels() |
java.util.LinkedList<Rule> |
getRulesFor(PlanPhase phase) |
boolean |
hasElementFactory(java.lang.String factoryName) |
int |
hashCode() |
boolean |
hasRule(java.lang.String ruleName) |
void |
restoreLogging() |
void |
setResolveElementsEnabled(boolean resolveElementsEnabled) |
public RuleRegistry()
public void enableDebugLogging()
restoreLogging()
to resume normal logging levels.
For planner tracing, see FlowPlanner
properties.public void restoreLogging()
public boolean addDefaultElementFactory(java.lang.String name, ElementFactory elementFactory)
name
- elementFactory
- public ElementFactory addElementFactory(java.lang.String name, ElementFactory elementFactory)
public ElementFactory getElementFactory(java.lang.String factoryName)
public boolean hasElementFactory(java.lang.String factoryName)
public java.util.LinkedList<Rule> getRulesFor(PlanPhase phase)
public boolean hasRule(java.lang.String ruleName)
public void setResolveElementsEnabled(boolean resolveElementsEnabled)
public boolean enabledResolveElements()
public java.util.Set<ProcessLevel> getProcessLevels()
public java.lang.String getName()
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Copyright © 2007-2015 Xplenty, Inc. All Rights Reserved.