diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js index 8a2b3de..359ded8 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js @@ -36,6 +36,10 @@ export default Ember.Component.extend({ return this._selected; }.property(), + isTimelineView: function() { + return this.get("timelineView") + }.property(), + tableComponentName: function() { return "app-attempt-table"; }.property(), @@ -87,7 +91,9 @@ export default Ember.Component.extend({ draw: function(start, end) { // get w/h of the svg - var bbox = d3.select("#" + this.get("parent-id")) + var div = d3.select("#" + this.get("parent-id")).append("div").attr("class", + "col-md-8 container-fluid"); + var bbox = div .node() .getBoundingClientRect(); this.canvas.w = bbox.width; @@ -223,6 +229,16 @@ export default Ember.Component.extend({ }, didInsertElement: function() { + d3.select("#" + this.get("parent-id")).selectAll("*").remove(); + + if (undefined == this.get('isTimelineView')) { + this.set('isTimelineView', true); + } + + if (!this.get('isTimelineView')) { + return; + } + // init tooltip this.initTooltip(); this.modelArr = []; @@ -274,4 +290,13 @@ export default Ember.Component.extend({ this.setSelected(this.modelArr[0]); } }, + + actions: { + switchView: function () { + var timelineEnabled = !this.get('isTimelineView'); + this.set('isTimelineView', timelineEnabled); + + this.didInsertElement(); + } + }, }); \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app-attempt.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app-attempt.js index a8f27f5..d826e02 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app-attempt.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app-attempt.js @@ -39,5 +39,19 @@ export default Ember.Route.extend({ return []; }) }); - } + }, + + timelineView: true, + + isTimelineView: function() { + console.log("0 " + this.timelineView); + return this.timelineView; + }.property(), + + actions: { + switchView: function() { + this.timelineView = !this.timelineView; + console.log(this.timelineView) + } + }, }); \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/app-attempts-table.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/app-attempts-table.hbs new file mode 100644 index 0000000..a6c2ab2 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/app-attempts-table.hbs @@ -0,0 +1,77 @@ +{{! + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +}} + + + + + + + + + + + + + + + + + +{{#if arr1}} + {{#each arr1 as |attempt|}} + + + + + + + + + + + {{/each}} +{{/if}} + +{{#if arr2}} + {{#each arr2 as |attempt|}} + + + + + + + + + + + {{/each}} +{{/if}} + +
Application Attempt IdStart TimeAM Container IdAM Node Web UIAM Node IdLogAttempt StateElapsed Time
+ {{#if attempt.link}} + {{#link-to attempt.linkname attempt.id}}{{attempt.id}}{{/link-to}} + {{else}} + {{attempt.id}} + {{/if}} + {{attempt.attemptStartedTime}}{{attempt.appMasterContainerId}}{{attempt.nodeHttpAddress}}{{attempt.amNodeId}}link{{attempt.attemptState}}{{attempt.elapsedTime}}
+ {{#if attempt.link}} + {{#link-to attempt.linkname attempt.id}}{{attempt.id}}{{/link-to}} + {{else}} + {{attempt.id}} + {{/if}} + {{attempt.attemptStartedTime}}{{attempt.appMasterContainerId}}{{attempt.nodeHttpAddress}}{{attempt.amNodeId}}link{{attempt.attemptState}}{{attempt.elapsedTime}}
\ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/containers-table.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/containers-table.hbs new file mode 100644 index 0000000..3249b21 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/containers-table.hbs @@ -0,0 +1,79 @@ +{{! + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +}} + + + + + + + + + + + + + + + + + + +{{#if arr1}} + {{#each arr1 as |container|}} + + + + + + + + + + + + {{/each}} +{{/if}} +{{#if arr2}} + {{#each arr2 as |container|}} + + + + + + + + + + + + {{/each}} +{{/if}} + +
Container IdStart TimeFinished TimeElapsed TimePriorityLogExit StatusStateNodeManager UI
+ {{#if container.link}} + {{#link-to container.linkname container.id}}{{container.id}}{{/link-to}} + {{else}} + {{container.id}} + {{/if}} + {{container.startedTime}}{{container.validatedFinishedTs}}{{container.elapsedTime}}{{container.priority}}link{{container.containerExitStatus}}{{container.containerState}}{{container.nodeHttpAddress}}
+ {{#if container.link}} + {{#link-to container.linkname container.id}}{{container.id}}{{/link-to}} + {{else}} + {{container.id}} + {{/if}} + {{container.startedTime}}{{container.validatedFinishedTs}}{{container.elapsedTime}}{{container.priority}}link{{container.containerExitStatus}}{{container.containerState}}{{container.nodeHttpAddress}}
\ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/timeline-view.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/timeline-view.hbs index 6f529ba..f60db9a 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/timeline-view.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/timeline-view.hbs @@ -24,28 +24,43 @@ {{else}} Containers {{/if}} - -
-
+
+
+
- -
-
-
- {{#if selected.link}} - {{#link-to selected.linkname selected.id}}{{selected.id}}{{/link-to}} +
+ {{#if isTimelineView}} + +
+
+
+ {{#if selected.link}} + {{#link-to selected.linkname selected.id}}{{selected.id}}{{/link-to}} + {{else}} + {{selected.id}} + {{/if}} +
+ {{#if attemptModel}} + {{app-attempt-table attempt=selected}} {{else}} - {{selected.id}} + {{container-table container=selected}} {{/if}}
- {{#if attemptModel}} - {{app-attempt-table attempt=selected}} - {{else}} - {{container-table container=selected}} - {{/if}}
-
+ {{else}} + {{#if attemptModel}} + {{app-attempts-table arr1=rmModel arr2=tsModel}} + {{else}} + {{containers-table arr1=rmModel arr2=tsModel}} + {{/if}} + {{/if}}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app-attempt.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app-attempt.hbs index b01eceb..82e07bc 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app-attempt.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app-attempt.hbs @@ -26,7 +26,7 @@
{{#if (or model.rmContainers model.tsContainers)}} - {{timeline-view parent-id="containers-timeline-div" my-id="timeline-view" height="400" rmModel=model.rmContainers tsModel=model.tsContainers label="shortAppAttemptId" attemptModel=false}} + {{timeline-view parent-id="containers-timeline-div" my-id="timeline-view" height="400" rmModel=model.rmContainers tsModel=model.tsContainers label="shortAppAttemptId" attemptModel=false timelineView=isTimelineView}} {{/if}}