hadoop-yarn-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (YARN-2030) Use StateMachine to simplify handleStoreEvent() in RMStateStore
Date Tue, 10 Jun 2014 01:16:02 GMT

    [ https://issues.apache.org/jira/browse/YARN-2030?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14026005#comment-14026005
] 

Hudson commented on YARN-2030:
------------------------------

SUCCESS: Integrated in Hadoop-trunk-Commit #5672 (See [https://builds.apache.org/job/Hadoop-trunk-Commit/5672/])
YARN-2030. Augmented RMStateStore with state machine. Contributed by Binglin Chang (jianhe:
http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1601537)
* /hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt


> Use StateMachine to simplify handleStoreEvent() in RMStateStore
> ---------------------------------------------------------------
>
>                 Key: YARN-2030
>                 URL: https://issues.apache.org/jira/browse/YARN-2030
>             Project: Hadoop YARN
>          Issue Type: Improvement
>            Reporter: Junping Du
>            Assignee: Binglin Chang
>             Fix For: 2.5.0
>
>         Attachments: YARN-2030.v1.patch, YARN-2030.v2.patch, YARN-2030.v3.patch, YARN-2030.v4.patch,
YARN-2030.v5.patch, YARN-2030.v6.patch
>
>
> Now the logic to handle different store events in handleStoreEvent() is as following:
> {code}
> if (event.getType().equals(RMStateStoreEventType.STORE_APP)
>         || event.getType().equals(RMStateStoreEventType.UPDATE_APP)) {
>       ...
>       if (event.getType().equals(RMStateStoreEventType.STORE_APP)) {
>         ...
>       } else {
>         ...
>       }
>       ...
>       try {
>         if (event.getType().equals(RMStateStoreEventType.STORE_APP)) {
>           ...
>         } else {
>           ...
>         }
>       } 
>       ...
>     } else if (event.getType().equals(RMStateStoreEventType.STORE_APP_ATTEMPT)
>         || event.getType().equals(RMStateStoreEventType.UPDATE_APP_ATTEMPT)) {
>       ...
>       if (event.getType().equals(RMStateStoreEventType.STORE_APP_ATTEMPT)) {
>         ...
>       } else {
>         ...
>       }
>         ...
>         if (event.getType().equals(RMStateStoreEventType.STORE_APP_ATTEMPT)) {
>           ...
>         } else {
>           ...
>         }
>       }
>       ...
>     } else if (event.getType().equals(RMStateStoreEventType.REMOVE_APP)) {
>     ...
>     } else {
>       ...
>     }
> }
> {code}
> This is not only confuse people but also led to mistake easily. We may leverage state
machine to simply this even no state transitions.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message