Uploaded image for project: 'Hadoop Map/Reduce'
  1. Hadoop Map/Reduce
  2. MAPREDUCE-206

Implement a generic DFA

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      Owen alluded to it HADOOP-1183 and Devaraj talked about this in HADOOP-1337 ... I believe this will be a generally useful feature in other parts of hadoop too...

      The proposal is to implement a generic state machine which can be configured as needed and could be used to track states/transitions of various entities. This will hopefully make code less complex (for e.g. in the shuffle) and more maintainable/understandable since the state transitions of entities will be visible in one place (for e.g. where it is configured) and not scattered across myriad sections.

      The idea is quite simple:

      class StateMachine {

      // Register a legal 'transition' from pre to post state on a given event and
      // a user-provided hook/callback
      void registerTransition(State pre, State post, Event event, Hook hook)
      throws IllegalStateTransitionException;

      // Effect a transition from the state on the event, return the resulting state or
      // throw an exception if the transition is illegal.
      // cause/victim are user objects i.e. context/result of the transition.
      State doTransition(State state, Event event, Object cause, Object victim)
      throws IllegalStateTransitionException;
      }

      -

      Thoughts?

      Attachments

        1. HADOOP-1395_1_20070521.patch
          10 kB
          Arun Murthy

        Issue Links

          Activity

            People

              acmurthy Arun Murthy
              acmurthy Arun Murthy
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: