|
@@ -24,7 +24,10 @@ import java.util.Map;
|
|
|
|
|
|
import org.apache.ambari.view.ViewContext;
|
|
|
import org.apache.ambari.view.cluster.Cluster;
|
|
|
+import org.apache.ambari.view.tez.exceptions.ATSUrlFetchException;
|
|
|
+import org.apache.ambari.view.tez.exceptions.ActiveRMFetchException;
|
|
|
import org.apache.ambari.view.utils.ambari.AmbariApi;
|
|
|
+import org.apache.ambari.view.utils.ambari.AmbariApiException;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
@@ -54,10 +57,21 @@ public class ViewControllerImpl implements ViewController {
|
|
|
*/
|
|
|
@Override
|
|
|
public ViewStatus getViewStatus() {
|
|
|
+
|
|
|
ViewStatus status = new ViewStatus();
|
|
|
Map<String, String> parameters = new HashMap<String, String>();
|
|
|
- parameters.put(ViewController.PARAM_YARN_ATS_URL, ambariApi.getServices().getTimelineServerUrl());
|
|
|
- parameters.put(ViewController.PARAM_YARN_RESOURCEMANAGER_URL, ambariApi.getServices().getRMUrl());
|
|
|
+ try {
|
|
|
+ parameters.put(ViewController.PARAM_YARN_ATS_URL, ambariApi.getServices().getTimelineServerUrl());
|
|
|
+ } catch (AmbariApiException ex) {
|
|
|
+ throw new ATSUrlFetchException(ex);
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ parameters.put(ViewController.PARAM_YARN_RESOURCEMANAGER_URL, ambariApi.getServices().getRMUrl());
|
|
|
+ } catch (AmbariApiException ex) {
|
|
|
+ throw new ActiveRMFetchException(ex);
|
|
|
+ }
|
|
|
+
|
|
|
status.setParameters(parameters);
|
|
|
return status;
|
|
|
}
|