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

Karthik Kambatla commented on YARN-1068:
----------------------------------------

bq. Another downside is having yet another port to configure on the RM. 1 for 
HAProtocol and 1 for HAAdmin. Do we envisage an RM where one of them are 
present without the other?
Only the RMHAAdminService listens on a port, not the RMHAProtocolService. Am I 
missing something here?

Let me be more elaborate. The MockRM overrides several RM#create*() methods to 
create services which don't start the listening servers. Similarly, I wanted to 
override createRMHAProtocolService in MockRM to create an instance of 
RMHAProtocolService which doesn't start the HA admin listener. Now, consider 
the two scenarios:
- HAAdmin functionality embedded in RMHAProtocolService
RMHAProtocolService#serviceStart() would look like the following:
{code}
protected void serviceStart() {
  if (haEnabled) {
    transitionToStandby(true);

    // create admin server logic
    // start admin server


  } else {
    transitionToActive();
  }
  super.serviceStart();
{code}

and the MockRM override would look like:
{code}
@Override
protected void createRMHAProtocolService() {
  return new RMHAProtocolService() {
    @Override
    protected void serviceStart() {
      if (haEnabled) {
        transitionToStandby(true);
      } else {
        transitionToActive();
      }
      super.serviceStart();
    }
  };
}
{code}
Any changes to RMHAProtocolService#serviceStart should be replicated to MockRM.
- RMHAAdminService implements the admin functionality and is part of 
RMHAProtocolService (latest patch)
RMHAProtocolService#createRMHAAdminService() creates the admin service to use. 
If not null, the service is added to RMHAProtocolService and is 
inited/started/stopped along with it. Now, all MockRM needs to do is return 
null in MockRM#createRMHAAdminService.
                
> Add admin support for HA operations
> -----------------------------------
>
>                 Key: YARN-1068
>                 URL: https://issues.apache.org/jira/browse/YARN-1068
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: resourcemanager
>    Affects Versions: 2.1.0-beta
>            Reporter: Karthik Kambatla
>            Assignee: Karthik Kambatla
>              Labels: ha
>         Attachments: yarn-1068-1.patch, yarn-1068-2.patch, yarn-1068-3.patch, 
> yarn-1068-4.patch, yarn-1068-prelim.patch
>
>
> Support HA admin operations to facilitate transitioning the RM to Active and 
> Standby states.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to