You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Arun C Murthy (JIRA)" <ji...@apache.org> on 2007/05/20 21:33:17 UTC

[jira] Created: (HADOOP-1395) Implement a generic DFA

Implement a generic DFA 
------------------------

                 Key: HADOOP-1395
                 URL: https://issues.apache.org/jira/browse/HADOOP-1395
             Project: Hadoop
          Issue Type: New Feature
            Reporter: Arun C Murthy
         Assigned To: Arun C Murthy
             Fix For: 0.14.0


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?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-1395) Implement a generic DFA

Posted by "Sameer Paranjpye (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-1395?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sameer Paranjpye updated HADOOP-1395:
-------------------------------------

    Component/s: mapred

> Implement a generic DFA 
> ------------------------
>
>                 Key: HADOOP-1395
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1395
>             Project: Hadoop
>          Issue Type: New Feature
>          Components: mapred
>            Reporter: Arun C Murthy
>            Assignee: Arun C Murthy
>             Fix For: 0.14.0
>
>         Attachments: HADOOP-1395_1_20070521.patch
>
>
> 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?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-1395) Implement a generic DFA

Posted by "Arun C Murthy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-1395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497287 ] 

Arun C Murthy commented on HADOOP-1395:
---------------------------------------

I've attached a half-baked patch to illustrate how to use the *StateMachine* dfa here (https://issues.apache.org/jira/secure/attachment/12357705/mapred_as_dfa.patch) ... 

> Implement a generic DFA 
> ------------------------
>
>                 Key: HADOOP-1395
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1395
>             Project: Hadoop
>          Issue Type: New Feature
>            Reporter: Arun C Murthy
>         Assigned To: Arun C Murthy
>             Fix For: 0.14.0
>
>         Attachments: HADOOP-1395_1_20070521.patch
>
>
> 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?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-1395) Implement a generic DFA

Posted by "Arun C Murthy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-1395?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Arun C Murthy updated HADOOP-1395:
----------------------------------

    Attachment: HADOOP-1395_1_20070521.patch

Attached is a slightly better illustration of the simple 'state machine' via code. 

Appreciate any feedback/ideas...

> Implement a generic DFA 
> ------------------------
>
>                 Key: HADOOP-1395
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1395
>             Project: Hadoop
>          Issue Type: New Feature
>            Reporter: Arun C Murthy
>         Assigned To: Arun C Murthy
>             Fix For: 0.14.0
>
>         Attachments: HADOOP-1395_1_20070521.patch
>
>
> 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?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-1395) Implement a generic DFA

Posted by "Tom White (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-1395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497435 ] 

Tom White commented on HADOOP-1395:
-----------------------------------

Are there any existing DFA frameworks that we could use, before we implement our own? E.g. http://www.brics.dk/automaton/, although this probably isn't suitable since it doesn't seem to be geared towards hooking into external events. Anyone know of such a library?

> Implement a generic DFA 
> ------------------------
>
>                 Key: HADOOP-1395
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1395
>             Project: Hadoop
>          Issue Type: New Feature
>            Reporter: Arun C Murthy
>         Assigned To: Arun C Murthy
>             Fix For: 0.14.0
>
>         Attachments: HADOOP-1395_1_20070521.patch
>
>
> 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?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.