Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.apache.hadoop.ha.HAServiceProtocol;
import org.apache.hadoop.service.Service.STATE;
import org.apache.hadoop.util.VersionInfo;
import org.apache.hadoop.yarn.conf.YarnConfiguration;
import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
import org.apache.hadoop.yarn.util.YarnVersionInfo;

Expand All @@ -45,6 +46,7 @@ public class ClusterInfo {
protected String haZooKeeperConnectionState;

private String subClusterId;
private boolean schedulerUiEnabled;

public ClusterInfo() {
} // JAXB needs this
Expand All @@ -66,6 +68,10 @@ public ClusterInfo(ResourceManager rm) {
this.hadoopVersionBuiltOn = VersionInfo.getDate();
this.haZooKeeperConnectionState =
rm.getRMContext().getHAZookeeperConnectionState();
this.schedulerUiEnabled = rm.getConfig().getBoolean(
YarnConfiguration.YARN_WEBAPP_SCHEDULER_UI_ENABLE,
YarnConfiguration.DEFAULT_YARN_WEBAPP_SCHEDULER_UI_ENABLE
);
}

public String getState() {
Expand Down Expand Up @@ -123,4 +129,12 @@ public String getSubClusterId() {
public void setSubClusterId(String subClusterId) {
this.subClusterId = subClusterId;
}

public boolean isSchedulerUiEnabled() {
return schedulerUiEnabled;
}

public void setSchedulerUiEnabled(boolean schedulerUiEnabled) {
this.schedulerUiEnabled = schedulerUiEnabled;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ public void verifyClusterInfo(JSONObject json) throws JSONException,
Exception {
assertEquals(1, json.length(), "incorrect number of elements");
JSONObject info = json.getJSONObject("clusterInfo");
assertEquals(12, info.length(), "incorrect number of elements");
assertEquals(13, info.length(), "incorrect number of elements");
verifyClusterGeneric(info.getLong("id"), info.getLong("startedOn"),
info.getString("state"), info.getString("haState"),
info.getString("haZooKeeperConnectionState"),
Expand All @@ -354,7 +354,6 @@ public void verifyClusterInfo(JSONObject json) throws JSONException,
info.getString("resourceManagerVersionBuiltOn"),
info.getString("resourceManagerBuildVersion"),
info.getString("resourceManagerVersion"));

}

public void verifyClusterGeneric(long clusterid, long startedon,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,12 @@ export default Ember.Controller.extend({
return this.model.timelineHealth.get('isTimelineUnHealthy');
}
return true;
}.property('model.timelineHealth')
}.property('model.timelineHealth'),

isSchedulerUiEnabled: function() {
if (this.model && this.model.clusterInfo) {
return this.model.clusterInfo.get('firstObject').get('schedulerUiEnabled');
}
return false;
}.property('model.isSchedulerUiEnabled')
});
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ export default DS.Model.extend({
hadoopVersionBuiltOn: DS.attr('string'),
getYARNBuildHash: function() {
return this.get("hadoopVersion") + " from " + this.get("resourceManagerBuildVersion").split(" ")[2];
}.property("yarnHash")
}.property("yarnHash"),
schedulerUiEnabled: DS.attr('string')
});
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@
<span class="sr-only">(current)</span>
{{/link-to}}
{{/link-to}}
{{#if isSchedulerUiEnabled}}
<li><a href="/scheduler-ui" class="navigation-link ember-view">Scheduler UI</a></li>
{{/if}}
</ul>
{{#if userInfo}}
<div class="loggedin-user">
Expand Down