-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/37875/
-----------------------------------------------------------

Review request for Ambari, Srimanth Gunturi, Sid Wagle, and Yusaku Sako.


Bugs: AMBARI-12910
    https://issues.apache.org/jira/browse/AMBARI-12910


Repository: ambari


Description
-------

The logic for getting the Active RM Url is modified. It is decribed below:

```
* If the view is attached to a cluster
** If RM HA is enabled(Check *"yarn.resourcemanager.ha.enabled"*)
*** get the RM-IDs(Using *"yarn.resourcemanager.ha.rm-ids"*)
*** get all the RM Hosts using the RM ids
*** For each RM host
**** hit *"<RM URL>/ws/v1/cluster/info"*
**** If "haState" is "*ACTIVE*", this is the active URL and return the 
corresponding RM Url
**** If "haState" is "*STANDBY*" this is the standby URL and continue loop with 
rest RM Url
**** If the URL is not reachable, this cannot be a ACTIVE RM and hence ignore 
considering as STANDBY
*** Throw Exception if none of the URL is reachable.
** if RM HA is disabled
*** get the RM Url from "*yarn.resourcemanager.webapp.address*" or 
"*yarn.resourcemanager.webapp.https.address*"
* if view is not attached to a cluster
** get the "*yarn.resourcemanager.url*" from the view property. This has been 
modified to take comma separated RM urls(all in HA)
** if no of Urls configured is 1
*** return that URL as active URL
** else 
*** get the Active RM Url using the same method as described above by hitting 
"*/ws/v1/cluster/info*" endpoint for each of the configured URL
```

This common util code is used in capacity schedular and hive, so these two 
components are fixed using these changes. For tez view we will have to fix 
separately in a different bug.


Diffs
-----

  contrib/views/hive/src/main/resources/view.xml ed97213 
  
contrib/views/utils/src/main/java/org/apache/ambari/view/utils/ambari/Services.java
 0b49076 
  
contrib/views/utils/src/test/java/org/apache/ambari/view/utils/ambari/ServicesTest.java
 PRE-CREATION 

Diff: https://reviews.apache.org/r/37875/diff/


Testing
-------

Unit Test cases added to check the business logic. Locally ran unit tests and 
also manually tested in local VM.


Thanks,

DIPAYAN BHOWMICK

Reply via email to