YARN-7760. [UI2] Clicking 'Master Node' or link next to 'AM Node Web UI' under application's appAttempt page goes to OLD RM UI. (Vasudevan Skm / Sunil G via wangda)

Change-Id: Ia7e2b955d3551ca43c6852fe253fd01983b56565
This commit is contained in:
Wangda Tan 2018-01-26 15:44:55 +08:00
parent e0cfb0a31a
commit 75618c0dec
5 changed files with 70 additions and 42 deletions

View File

@ -92,6 +92,7 @@ public class AppInfo {
protected String amContainerLogs;
protected String amHostHttpAddress;
private String amRPCAddress;
private String masterNodeId;
private long allocatedMB;
private long allocatedVCores;
private long reservedMB;
@ -162,6 +163,7 @@ public AppInfo(ResourceManager rm, RMApp app, Boolean hasAccess,
this.name = app.getName().toString();
this.queue = app.getQueue().toString();
this.priority = 0;
this.masterNodeId = "";
if (app.getApplicationPriority() != null) {
this.priority = app.getApplicationPriority().getPriority();
@ -192,6 +194,7 @@ public AppInfo(ResourceManager rm, RMApp app, Boolean hasAccess,
schemePrefix + masterContainer.getNodeHttpAddress(),
masterContainer.getId().toString(), app.getUser());
this.amHostHttpAddress = masterContainer.getNodeHttpAddress();
this.masterNodeId = masterContainer.getNodeId().toString();
}
this.amRPCAddress = getAmRPCAddressFromRMAppAttempt(attempt);
@ -615,4 +618,12 @@ public void setState(YarnApplicationState state) {
public void setName(String name) {
this.name = name;
}
public String getMasterNodeId() {
return masterNodeId;
}
public void setMasterNodeId(String masterNodeId) {
this.masterNodeId = masterNodeId;
}
}

View File

@ -1603,7 +1603,7 @@ public void verifyAppsXML(NodeList nodes, RMApp app, boolean hasResourceReq)
public void verifyAppInfo(JSONObject info, RMApp app, boolean hasResourceReqs)
throws JSONException, Exception {
int expectedNumberOfElements = 38 + (hasResourceReqs ? 2 : 0);
int expectedNumberOfElements = 39 + (hasResourceReqs ? 2 : 0);
String appNodeLabelExpression = null;
String amNodeLabelExpression = null;
if (app.getApplicationSubmissionContext()

View File

@ -20,42 +20,43 @@ import Converter from 'yarn-ui/utils/converter';
import DS from 'ember-data';
export default DS.Model.extend({
appName: DS.attr('string'),
user: DS.attr('string'),
queue: DS.attr('string'),
state: DS.attr('string'),
startTime: DS.attr('string'),
elapsedTime: DS.attr('string'),
finalStatus: DS.attr('string'),
finishedTime: DS.attr('finishedTime'),
progress: DS.attr('number'),
diagnostics: DS.attr('string'),
amContainerLogs: DS.attr('string'),
amHostHttpAddress: DS.attr('string'),
logAggregationStatus: DS.attr('string'),
unmanagedApplication: DS.attr('boolean'),
amNodeLabelExpression: DS.attr('string'),
applicationTags: DS.attr('string'),
applicationType: DS.attr('string'),
priority: DS.attr('string'),
allocatedMB: DS.attr('number'),
allocatedVCores: DS.attr('number'),
runningContainers: DS.attr('number'),
memorySeconds: DS.attr('number'),
vcoreSeconds: DS.attr('number'),
preemptedResourceMB: DS.attr('number'),
preemptedResourceVCores: DS.attr('number'),
numNonAMContainerPreempted: DS.attr('number'),
numAMContainerPreempted: DS.attr('number'),
clusterUsagePercentage: DS.attr('number'),
queueUsagePercentage: DS.attr('number'),
currentAppAttemptId: DS.attr('string'),
remainingTimeoutInSeconds: DS.attr('number'),
applicationExpiryTime: DS.attr('string'),
resourceRequests: DS.attr('array'),
appName: DS.attr("string"),
user: DS.attr("string"),
queue: DS.attr("string"),
state: DS.attr("string"),
startTime: DS.attr("string"),
elapsedTime: DS.attr("string"),
finalStatus: DS.attr("string"),
finishedTime: DS.attr("finishedTime"),
progress: DS.attr("number"),
diagnostics: DS.attr("string"),
amContainerLogs: DS.attr("string"),
amHostHttpAddress: DS.attr("string"),
masterNodeId: DS.attr("string"),
logAggregationStatus: DS.attr("string"),
unmanagedApplication: DS.attr("boolean"),
amNodeLabelExpression: DS.attr("string"),
applicationTags: DS.attr("string"),
applicationType: DS.attr("string"),
priority: DS.attr("string"),
allocatedMB: DS.attr("number"),
allocatedVCores: DS.attr("number"),
runningContainers: DS.attr("number"),
memorySeconds: DS.attr("number"),
vcoreSeconds: DS.attr("number"),
preemptedResourceMB: DS.attr("number"),
preemptedResourceVCores: DS.attr("number"),
numNonAMContainerPreempted: DS.attr("number"),
numAMContainerPreempted: DS.attr("number"),
clusterUsagePercentage: DS.attr("number"),
queueUsagePercentage: DS.attr("number"),
currentAppAttemptId: DS.attr("string"),
remainingTimeoutInSeconds: DS.attr("number"),
applicationExpiryTime: DS.attr("string"),
resourceRequests: DS.attr("array"),
isFailed: function() {
return this.get('finalStatus') === "FAILED";
return this.get("finalStatus") === "FAILED";
}.property("finalStatus"),
validatedFinishedTs: function() {
@ -70,27 +71,42 @@ export default DS.Model.extend({
}.property("hasFinishedTime"),
formattedElapsedTime: function() {
return Converter.msToElapsedTimeUnit(this.get('elapsedTime'));
}.property('elapsedTime'),
return Converter.msToElapsedTimeUnit(this.get("elapsedTime"));
}.property("elapsedTime"),
allocatedResource: function() {
return Converter.resourceToString(this.get("allocatedMB"), this.get("allocatedVCores"));
return Converter.resourceToString(
this.get("allocatedMB"),
this.get("allocatedVCores")
);
}.property("allocatedMB", "allocatedVCores"),
preemptedResource: function() {
return Converter.resourceToString(this.get("preemptedResourceMB"), this.get("preemptedResourceVCores"));
return Converter.resourceToString(
this.get("preemptedResourceMB"),
this.get("preemptedResourceVCores")
);
}.property("preemptedResourceMB", "preemptedResourceVCores"),
aggregatedResourceUsage: function() {
return Converter.resourceToString(this.get("memorySeconds"), this.get("vcoreSeconds")) + " (× Secs)";
return (
Converter.resourceToString(
this.get("memorySeconds"),
this.get("vcoreSeconds")
) + " (× Secs)"
);
}.property("memorySeconds", "vcoreSeconds"),
masterNodeURL: function() {
return `#/yarn-node/${this.get("masterNodeId")}/${this.get("amHostHttpAddress")}/info/`;
}.property("masterNodeId", "amHostHttpAddress"),
progressStyle: function() {
return "width: " + this.get("progress") + "%";
}.property("progress"),
runningContainersNumber: function() {
if(this.get("runningContainers") < 0) {
if (this.get("runningContainers") < 0) {
return 0;
}
return this.get("runningContainers");

View File

@ -51,6 +51,7 @@ export default DS.JSONAPISerializer.extend({
diagnostics: (payload.diagnostics && payload.diagnostics !== 'null')? payload.diagnostics : '',
amContainerLogs: payload.amContainerLogs,
amHostHttpAddress: payload.amHostHttpAddress,
masterNodeId: payload.masterNodeId,
logAggregationStatus: payload.logAggregationStatus,
unmanagedApplication: payload.unmanagedApplication,
amNodeLabelExpression: payload.amNodeLabelExpression,

View File

@ -65,7 +65,7 @@
<div class="flex-right">
<div class="links">
<a href="{{model.app.amContainerLogs}}" target="_blank">Master Container Log</a> &nbsp;|&nbsp;
<a href="{{amHostHttpAddressFormatted}}" target="_blank">Master Node</a> &nbsp;|&nbsp;
<a href="{{model.app.masterNodeURL}}">Master Node</a> &nbsp;|&nbsp;
{{#if isRunningService}}
<div class="btn-group">
<button type="button" class="btn btn-unstyled dropdown-toggle" title="Settings" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">