cascading.flow.planner.rule

## Class RuleRegistry

- java.lang.Object
- - cascading.flow.planner.rule.RuleRegistry

-     public class RuleRegistry
      extends java.lang.Object

  RuleRegistry contains all planner rules for a given platform. Where a rule is of type `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 Summary

    Constructors
    Constructor and Description
    `RuleRegistry()`

  - ### Method Summary

    Methods
    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)`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### RuleRegistry

          public RuleRegistry()

  - ### Method Detail

    - #### enableDebugLogging

          public void enableDebugLogging()

      Method enableDebugLogging forces log4j to emit DEBUG level stats for the planner classes.

      Use `restoreLogging()` to resume normal logging levels.

      For planner tracing, see `FlowPlanner` properties.

    - #### restoreLogging

          public void restoreLogging()

    - #### addDefaultElementFactory

          public boolean addDefaultElementFactory(java.lang.String name,
                                         ElementFactory elementFactory)

      Adds the named elementFactory if it does not already exist.
      Parameters:
        `name` -
        `elementFactory` -
      Returns:
        true if the factory was added

    - #### addElementFactory

          public ElementFactory addElementFactory(java.lang.String name,
                                         ElementFactory elementFactory)

    - #### getElementFactory

          public ElementFactory getElementFactory(java.lang.String factoryName)

    - #### hasElementFactory

          public boolean hasElementFactory(java.lang.String factoryName)

    - #### getRulesFor

          public java.util.LinkedList<Rule> getRulesFor(PlanPhase phase)

    - #### addRule

          public boolean addRule(Rule rule)

    - #### hasRule

          public boolean hasRule(java.lang.String ruleName)

    - #### setResolveElementsEnabled

          public void setResolveElementsEnabled(boolean resolveElementsEnabled)

    - #### enabledResolveElements

          public boolean enabledResolveElements()

    - #### getProcessLevels

          public java.util.Set<ProcessLevel> getProcessLevels()

    - #### getName

          public java.lang.String getName()

    - #### equals

          public boolean equals(java.lang.Object object)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

Copyright © 2007-2015 Xplenty, Inc. All Rights Reserved.