Id:" + this.get("id") + + "
ElapsedTime:" + + String(this.get("elapsedTime")) + "
"; + }.property(), + + link: function() { + return "/yarn-app-attempt/" + this.get("id"); + }.property(), + + linkname: function() { + return "yarn-app-attempt"; + }.property(), + + attemptState: function() { + return this.get("state"); + }.property(), + +}); \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app.js new file mode 100644 index 0000000..8b5474f --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app.js @@ -0,0 +1,104 @@ +/** + * 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. + */ + +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('string'), + amNodeLabelExpression: DS.attr('string'), + applicationTags: DS.attr('string'), + applicationType: DS.attr('string'), + priority: DS.attr('number'), + 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'), + + isFailed: function() { + return this.get('finalStatus') == "FAILED" + }.property("finalStatus"), + + validatedFinishedTs: function() { + if (this.get("finishedTime") < this.get("startTime")) { + return ""; + } + return this.get("finishedTime"); + }.property("finishedTime"), + + allocatedResource: function() { + return Converter.resourceToString(this.get("allocatedMB"), this.get("allocatedVCores")); + }.property("allocatedMB", "allocatedVCores"), + + preemptedResource: function() { + return Converter.resourceToString(this.get("preemptedResourceMB"), this.get("preemptedResourceVCores")); + }.property("preemptedResourceMB", "preemptedResourceVCores"), + + aggregatedResourceUsage: function() { + return Converter.resourceToString(this.get("memorySeconds"), this.get("vcoreSeconds")) + " (× Secs)"; + }.property("memorySeconds", "vcoreSeconds"), + + progressStyle: function() { + return "width: " + this.get("progress") + "%"; + }.property("progress"), + + runningContainersNumber: function() { + if(this.get("runningContainers") < 0) { + return 0; + } + return this.get("runningContainers"); + }.property("progress"), + + finalStatusStyle: function() { + var finalStatus = this.get("finalStatus"); + var style = ""; + + if (finalStatus == "KILLED") { + style = "warning"; + } else if (finalStatus == "FAILED") { + style = "danger"; + } else if (finalStatus == "SUCCEEDED") { + style = "success"; + } else { + style = "default"; + } + + return "label label-" + style; + }.property("finalStatus") +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-container-log.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-container-log.js new file mode 100644 index 0000000..31cf61e --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-container-log.js @@ -0,0 +1,25 @@ +/** + * 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. + */ + +import DS from 'ember-data'; + +export default DS.Model.extend({ + logs: DS.attr('string'), + containerID: DS.attr('string'), + logFileName: DS.attr('string') +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-container.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-container.js new file mode 100644 index 0000000..bd9cea7 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-container.js @@ -0,0 +1,64 @@ +/** + * 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. + */ + +import DS from 'ember-data'; +import Converter from 'yarn-ui/utils/converter'; + +export default DS.Model.extend({ + allocatedMB: DS.attr('number'), + allocatedVCores: DS.attr('number'), + assignedNodeId: DS.attr('string'), + priority: DS.attr('number'), + startedTime: DS.attr('number'), + finishedTime: DS.attr('number'), + logUrl: DS.attr('string'), + containerExitStatus: DS.attr('number'), + containerState: DS.attr('string'), + nodeHttpAddress: DS.attr('string'), + + startTs: function() { + return Converter.dateToTimeStamp(this.get("startedTime")); + }.property("startedTime"), + + finishedTs: function() { + var ts = Converter.dateToTimeStamp(this.get("finishedTime")); + return ts; + }.property("finishedTime"), + + validatedFinishedTs: function() { + if (this.get("finishedTs") < this.get("startTs")) { + return ""; + } + return this.get("finishedTime"); + }.property("finishedTime"), + + elapsedTime: function() { + var elapsedMs = this.get("finishedTs") - this.get("startTs"); + if (elapsedMs <= 0) { + elapsedMs = Date.now() - this.get("startTs"); + } + + return Converter.msToElapsedTime(elapsedMs); + }.property(), + + tooltipLabel: function() { + return "Id:" + this.get("id") + + "
ElapsedTime:" + + String(this.get("elapsedTime")) + "
"; + }.property(), +}); \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-node-app.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-node-app.js new file mode 100644 index 0000000..6dc69ae --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-node-app.js @@ -0,0 +1,44 @@ +/** + * 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. + */ + +import DS from 'ember-data'; + +export default DS.Model.extend({ + appId: DS.attr('string'), + state: DS.attr('string'), + user: DS.attr('string'), + containers: DS.attr('array'), + /** + * Indicates no rows were retrieved from backend + */ + isDummyApp: function() { + return this.get('id') == "dummy"; + }.property("id"), + + appStateStyle: function() { + var style = "default"; + var appState = this.get("state"); + if (appState == "RUNNING" || appState == "FINISHING_CONTAINERS_WAIT" || + appState == "APPLICATION_RESOURCES_CLEANINGUP") { + style = "primary"; + } else if (appState == "FINISHED") { + style = "success"; + } + return "label label-" + style; + }.property("state") +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-node-container.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-node-container.js new file mode 100644 index 0000000..3ba3216 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-node-container.js @@ -0,0 +1,57 @@ +/** + * 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. + */ + +import DS from 'ember-data'; + +export default DS.Model.extend({ + containerId: DS.attr('string'), + state: DS.attr('string'), + user: DS.attr('string'), + exitCode: DS.attr('string'), + diagnostics: DS.attr('string'), + totalMemoryNeeded: DS.attr('number'), + totalVCoresNeeded: DS.attr('number'), + containerLogFiles: DS.attr('array'), + + /** + * Indicates that there was no container retrieved from backend. + */ + isDummyContainer: function() { + return this.get('id') == "dummy"; + }.property("id"), + + containerStateStyle: function() { + var style = "primary"; + var containerState = this.get('state'); + var containerExitCode = this.get('exitCode'); + if (containerState == "DONE") { + if (containerExitCode == "0") { + style = "success"; + } else if (containerExitCode != "N/A") { + style = "danger"; + } + } + if (containerState == "EXITED_WITH_SUCCESS") { + style = "success"; + } + if (containerState == "EXITED_WITH_FAILURE") { + style = "danger"; + } + return "label label-" + style; + }.property("state", "exitCode") +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-node.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-node.js new file mode 100644 index 0000000..4753983 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-node.js @@ -0,0 +1,33 @@ +/** + * 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. + */ + +import DS from 'ember-data'; + +export default DS.Model.extend({ + totalVmemAllocatedContainersMB: DS.attr('number'), + totalPmemAllocatedContainersMB: DS.attr('number'), + totalVCoresAllocatedContainers: DS.attr('number'), + vmemCheckEnabled: DS.attr('boolean'), + pmemCheckEnabled: DS.attr('boolean'), + nodeHealthy: DS.attr('boolean'), + lastNodeUpdateTime: DS.attr('string'), + healthReport: DS.attr('string'), + nmStartupTime: DS.attr('string'), + nodeManagerBuildVersion: DS.attr('string'), + hadoopBuildVersion: DS.attr('string'), +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-queue.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-queue.js new file mode 100644 index 0000000..7de4ccc --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-queue.js @@ -0,0 +1,94 @@ +/** + * 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. + */ + +import DS from 'ember-data'; + +export default DS.Model.extend({ + name: DS.attr('string'), + children: DS.attr('array'), + parent: DS.attr('string'), + capacity: DS.attr('number'), + maxCapacity: DS.attr('number'), + usedCapacity: DS.attr('number'), + absCapacity: DS.attr('number'), + absMaxCapacity: DS.attr('number'), + absUsedCapacity: DS.attr('number'), + state: DS.attr('string'), + userLimit: DS.attr('number'), + userLimitFactor: DS.attr('number'), + preemptionDisabled: DS.attr('number'), + numPendingApplications: DS.attr('number'), + numActiveApplications: DS.attr('number'), + users: DS.hasMany('YarnUser'), + + isLeafQueue: function() { + var len = this.get("children.length"); + if (!len) { + return true; + } + return len <= 0; + }.property("children"), + + capacitiesBarChartData: function() { + return [ + { + label: "Absolute Capacity", + value: this.get("name") == "root" ? 100 : this.get("absCapacity") + }, + { + label: "Absolute Used", + value: this.get("name") == "root" ? this.get("usedCapacity") : this.get("absUsedCapacity") + }, + { + label: "Absolute Max Capacity", + value: this.get("name") == "root" ? 100 : this.get("absMaxCapacity") + } + ] + }.property("absCapacity", "absUsedCapacity", "absMaxCapacity"), + + userUsagesDonutChartData: function() { + var data = []; + if (this.get("users")) { + this.get("users").forEach(function(o) { + data.push({ + label: o.get("name"), + value: o.get("usedMemoryMB") + }) + }); + } + + return data; + }.property("users"), + + hasUserUsages: function() { + return this.get("userUsagesDonutChartData").length > 0; + }.property(), + + numOfApplicationsDonutChartData: function() { + return [ + { + label: "Pending Apps", + value: this.get("numPendingApplications") || 0 // TODO, fix the REST API so root will return #applications as well. + }, + { + label: "Active Apps", + value: this.get("numActiveApplications") || 0 + } + ] + }.property(), +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-rm-node.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-rm-node.js new file mode 100644 index 0000000..a15a20f --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-rm-node.js @@ -0,0 +1,99 @@ +/** + * 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. + */ + +import DS from 'ember-data'; + +export default DS.Model.extend({ + rack: DS.attr('string'), + state: DS.attr('string'), + nodeHostName: DS.attr('string'), + nodeHTTPAddress: DS.attr('string'), + lastHealthUpdate: DS.attr('string'), + healthReport: DS.attr('string'), + numContainers: DS.attr('number'), + usedMemoryMB: DS.attr('number'), + availMemoryMB: DS.attr('number'), + usedVirtualCores: DS.attr('number'), + availableVirtualCores: DS.attr('number'), + version: DS.attr('string'), + nodeLabels: DS.attr('array'), + + nodeLabelsAsString: function() { + var labels = this.get("nodeLabels"); + var labelToReturn = ""; + // Only one label per node supported. + if (labels && labels.length > 0) { + labelToReturn = labels[0]; + } + return labelToReturn; + }.property("nodeLabels"), + + /** + * Indicates no rows were retrieved from backend + */ + isDummyNode: function() { + return this.get('id') == "dummy"; + }.property("id"), + + nodeStateStyle: function() { + var style = "default"; + var nodeState = this.get("state"); + if (nodeState == "REBOOTED") { + style = "warning"; + } else if (nodeState == "UNHEALTHY" || nodeState == "DECOMMISSIONED" || + nodeState == "LOST" || nodeState == "SHUTDOWN") { + style = "danger"; + } else if (nodeState == "RUNNING") { + style = "success"; + } + return "label label-" + style; + }.property("state"), + + getMemoryDataForDonutChart: function() { + var arr = []; + arr.push({ + label: "Used", + value: this.get("usedMemoryMB") + }); + arr.push({ + label: "Available", + value: this.get("availMemoryMB") + }); + return arr; + }.property("availMemoryMB", "usedMemoryMB"), + + getVCoreDataForDonutChart: function() { + var arr = []; + arr.push({ + label: "Used", + value: this.get("usedVirtualCores") + }); + arr.push({ + label: "Available", + value: this.get("availableVirtualCores") + }); + return arr; + }.property("availableVirtualCores", "usedVirtualCores"), + + toolTipText: function() { + return "Rack: " + this.get("rack") + '
' + + "Host: " + this.get("nodeHostName") + '
' + + "Used Memory: " + Math.round(this.get("usedMemoryMB")) + ' MB
' + + "Available Memory: " + Math.round(this.get("availMemoryMB")) + ' MB
'; + }.property(), +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-user.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-user.js new file mode 100644 index 0000000..7cfd182 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-user.js @@ -0,0 +1,26 @@ +/** + * 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. + */ + +import DS from 'ember-data'; + +export default DS.Model.extend({ + name: DS.attr('string'), + queueName: DS.attr('string'), + usedMemoryMB: DS.attr('number'), + usedVCore: DS.attr('number') +}) \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/router.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/router.js new file mode 100644 index 0000000..87a018d --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/router.js @@ -0,0 +1,58 @@ +/** + * 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. + */ + +import Ember from 'ember'; +import config from './config/environment'; + +var Router = Ember.Router.extend({ + location: config.locationType +}); + +Router.map(function() { + this.route('yarn-apps', function () { + this.route('apps'); + this.route('services'); + }); + this.route('yarn-nodes', function(){ + this.route('table'); + this.route('heatmap'); + }); + this.route('yarn-nodes-heatmap'); + this.route('yarn-node', { path: '/yarn-node/:node_id/:node_addr' }); + this.route('yarn-node-apps', { path: '/yarn-node-apps/:node_id/:node_addr' }); + this.route('yarn-node-app', + { path: '/yarn-node-app/:node_id/:node_addr/:app_id' }); + this.route('yarn-node-containers', + { path: '/yarn-node-containers/:node_id/:node_addr' }); + this.route('yarn-node-container', + { path: '/yarn-node-container/:node_id/:node_addr/:container_id' }); + this.route('yarn-container-log', { path: + '/yarn-container-log/:node_id/:node_addr/:container_id/:filename' }); + this.route('yarn-queue', { path: '/yarn-queue/:queue_name' }); + + this.route('cluster-overview'); + this.route('yarn-app', { path: '/yarn-app/:app_id' }); + this.route('yarn-app-attempt', { path: '/yarn-app-attempt/:app_attempt_id'}); + this.route('error'); + this.route('notfound', { path: '*:' }); + this.route('yarn-app-attempts', { path: '/yarn-app-attempts/:app_id' }); + this.route('yarn-queues', { path: '/yarn-queues/:queue_name' }); + this.route('yarn-queue-apps', { path: '/yarn-queue-apps/:queue_name' }); +}); + +export default Router; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/abstract.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/abstract.js new file mode 100644 index 0000000..3163237 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/abstract.js @@ -0,0 +1,32 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +export default Ember.Route.extend({ + unloadAll() { + // Must be implemented by inheriting classes + }, + + actions: { + refresh: function () { + this.unloadAll(); + this.refresh(); + } + } +}); \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/application.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/application.js new file mode 100644 index 0000000..07b3792 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/application.js @@ -0,0 +1,40 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +export default Ember.Route.extend({ + actions: { + /** + * Base error handler for the application. + * If specific routes do not handle the error, it will bubble up to + * this handler. Here we redirect to either 404 page or a generic + * error handler page. + */ + error: function (error) { + Ember.Logger.log(error.stack); + + if (error && error.errors[0] && + error.errors[0].status == 404) { + this.intermediateTransitionTo('/notfound'); + } else { + this.intermediateTransitionTo('/error'); + } + } + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/cluster-overview.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/cluster-overview.js new file mode 100644 index 0000000..1068126 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/cluster-overview.js @@ -0,0 +1,44 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +import AbstractRoute from './abstract'; + +export default AbstractRoute.extend({ + model() { + return Ember.RSVP.hash({ + clusterMetrics: this.store.findAll('ClusterMetric'), + apps: this.store.query('yarn-app', + { + state: "RUNNING" + }), + queues: this.store.query('yarn-queue', {}), + }); + }, + + afterModel() { + this.controllerFor("ClusterOverview").set("loading", false); + }, + + unloadAll() { + this.store.unloadAll('ClusterMetric'); + this.store.unloadAll('yarn-app'); + this.store.unloadAll('yarn-queue'); + } +}); \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/index.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/index.js new file mode 100644 index 0000000..af26670 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/index.js @@ -0,0 +1,29 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +export default Ember.Route.extend({ + /** + * Redirect root URL to cluster overview page. + */ + beforeModel: function() { + this.replaceWith('cluster-overview'); + } +}); + 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 new file mode 100644 index 0000000..762fb29 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app-attempt.js @@ -0,0 +1,50 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +import AbstractRoute from './abstract'; + +export default AbstractRoute.extend({ + model(param) { + return Ember.RSVP.hash({ + attempt: this.store.findRecord('yarn-app-attempt', param.app_attempt_id), + + rmContainers: this.store.query('yarn-container', + { + app_attempt_id: param.app_attempt_id, + is_rm: true + }), + + tsContainers: this.store.query('yarn-container', + { + app_attempt_id: param.app_attempt_id, + is_rm: false + }).catch (function() { + // Promise rejected, fulfill with some default value to + // use as the route's model and continue on with the transition + return []; + }) + }); + }, + + unloadAll() { + this.store.unloadAll('yarn-app-attempt'); + this.store.unloadAll('yarn-container'); + } +}); \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app-attempts.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app-attempts.js new file mode 100644 index 0000000..121debf --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app-attempts.js @@ -0,0 +1,36 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +import AbstractRoute from './abstract'; + +export default AbstractRoute.extend({ + model(param) { + return this.store.query('yarn-app-attempt', { appId: param.app_id}).then(function (attempts) { + return { + appId: param.app_id, + attempts: attempts + }; + }); + }, + + unloadAll() { + this.store.unloadAll('yarn-app-attempt'); + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app.js new file mode 100644 index 0000000..000b02f --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app.js @@ -0,0 +1,52 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +import AbstractRoute from './abstract'; + +export default AbstractRoute.extend({ + model(param) { + return Ember.RSVP.hash({ + app: this.store.find('yarn-app', param.app_id), + + rmContainers: this.store.find('yarn-app', param.app_id).then(function(app) { + return this.store.query('yarn-app-attempt', {appId: param.app_id}).then(function (attempts) { + if (attempts && attempts.get('firstObject')) { + var appAttemptId = attempts.get('firstObject').get('appAttemptId'); + var rmContainers = this.store.query('yarn-container', + { + app_attempt_id: appAttemptId, + is_rm: true + }); + return rmContainers; + } + }.bind(this)); + }.bind(this)), + + nodes: this.store.findAll('yarn-rm-node'), + }); + }, + + unloadAll() { + this.store.unloadAll('yarn-app'); + this.store.unloadAll('yarn-app-attempt'); + this.store.unloadAll('yarn-container'); + this.store.unloadAll('yarn-rm-node'); + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps.js new file mode 100644 index 0000000..0ac503c --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps.js @@ -0,0 +1,35 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +import AbstractRoute from './abstract'; + +export default AbstractRoute.extend({ + model() { + return Ember.RSVP.hash({ + apps: this.store.findAll('yarn-app'), + clusterMetrics: this.store.findAll('ClusterMetric'), + }); + }, + + unloadAll() { + this.store.unloadAll('yarn-app'); + this.store.unloadAll('ClusterMetric'); + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps/apps.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps/apps.js new file mode 100644 index 0000000..8719170 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps/apps.js @@ -0,0 +1,22 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +export default Ember.Route.extend({ +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps/services.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps/services.js new file mode 100644 index 0000000..8719170 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps/services.js @@ -0,0 +1,22 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +export default Ember.Route.extend({ +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-container-log.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-container-log.js new file mode 100644 index 0000000..9e4c7d3 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-container-log.js @@ -0,0 +1,63 @@ +/** + * 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. + */ + +import Ember from 'ember'; +import Constants from 'yarn-ui/constants'; + +import AbstractRoute from './abstract'; + +export default AbstractRoute.extend({ + model(param) { + var id = param.node_addr + Constants.PARAM_SEPARATOR + param.container_id + + Constants.PARAM_SEPARATOR + param.filename; + return Ember.RSVP.hash({ + containerLog: this.store.findRecord('yarn-container-log', id), + containerInfo: { id: param.container_id }, + nodeInfo: { id: param.node_id, addr: param.node_addr } + }).then(function(hash) { + // Just return as its success. + return hash; + }, function(reason) { + if (reason.errors && reason.errors[0]) { + // This means HTTP error response was sent by adapter. + return reason; + } else { + // Assume empty response received from server. + return { nodeInfo: { id: param.node_id, addr: param.node_addr }, + containerInfo: { id: param.container_id }, + containerLog: { logs: "", containerID: param.container_id, + logFileName: param.filename}}; + } + }); + }, + + afterModel(model) { + // Handle errors and redirect if promise is rejected. + if (model.errors && model.errors[0]) { + if (model.errors[0].status == 404) { + this.replaceWith('/notfound'); + } else { + this.replaceWith('/error'); + } + } + }, + + unloadAll() { + this.store.unloadAll('yarn-container-log'); + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-node-app.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-node-app.js new file mode 100644 index 0000000..0a11930 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-node-app.js @@ -0,0 +1,35 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +import AbstractRoute from './abstract'; + +export default AbstractRoute.extend({ + model(param) { + return Ember.RSVP.hash({ + nodeApp: this.store.queryRecord('yarn-node-app', + { nodeAddr : param.node_addr, appId: param.app_id }), + nodeInfo: { id: param.node_id, addr: param.node_addr } + }); + }, + + unloadAll() { + this.store.unloadAll('yarn-node-app'); + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-node-apps.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-node-apps.js new file mode 100644 index 0000000..6044076 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-node-apps.js @@ -0,0 +1,35 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +import AbstractRoute from './abstract'; + +export default AbstractRoute.extend({ + model(param) { + // Get all apps running on a specific node. Node is contacted by using node_addr. + return Ember.RSVP.hash({ + apps: this.store.query('yarn-node-app', { nodeAddr: param.node_addr }), + nodeInfo: { id: param.node_id, addr: param.node_addr } + }); + }, + + unloadAll() { + this.store.unloadAll('yarn-node-app'); + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-node-container.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-node-container.js new file mode 100644 index 0000000..b7a79de --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-node-container.js @@ -0,0 +1,36 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +import AbstractRoute from './abstract'; + +export default AbstractRoute.extend({ + model(param) { + // Get a specific container running on a specific node. + return Ember.RSVP.hash({ + nodeContainer: this.store.queryRecord('yarn-node-container', + { nodeHttpAddr: param.node_addr, containerId: param.container_id }), + nodeInfo: { id: param.node_id, addr: param.node_addr } + }); + }, + + unloadAll() { + this.store.unloadAll('yarn-node-container'); + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-node-containers.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-node-containers.js new file mode 100644 index 0000000..3c709f7 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-node-containers.js @@ -0,0 +1,34 @@ +/** + * 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. + */ +import Ember from 'ember'; + +import AbstractRoute from './abstract'; + +export default AbstractRoute.extend({ + model(param) { + // Get all containers running on specific node. + return Ember.RSVP.hash({ + containers: this.store.query('yarn-node-container', { nodeHttpAddr: param.node_addr }), + nodeInfo: { id: param.node_id, addr: param.node_addr } + }); + }, + + unloadAll() { + this.store.unloadAll('yarn-node-container'); + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-node.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-node.js new file mode 100644 index 0000000..967d007 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-node.js @@ -0,0 +1,37 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +import AbstractRoute from './abstract'; + +export default AbstractRoute.extend({ + model(param) { + // Fetches data from both NM and RM. RM is queried to get node usage info. + return Ember.RSVP.hash({ + nodeInfo: { id: param.node_id, addr: param.node_addr }, + node: this.store.findRecord('yarn-node', param.node_addr), + rmNode: this.store.findRecord('yarn-rm-node', param.node_id) + }); + }, + + unloadAll() { + this.store.unloadAll('yarn-node'); + this.store.unloadAll('yarn-rm-node'); + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-nodes.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-nodes.js new file mode 100644 index 0000000..4439569 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-nodes.js @@ -0,0 +1,35 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +import AbstractRoute from './abstract'; + +export default AbstractRoute.extend({ + model() { + return Ember.RSVP.hash({ + nodes: this.store.findAll('yarn-rm-node'), + clusterMetrics: this.store.findAll('ClusterMetric'), + }); + }, + + unloadAll() { + this.store.unloadAll('yarn-rm-node'); + this.store.unloadAll('ClusterMetric'); + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-nodes/heatmap.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-nodes/heatmap.js new file mode 100644 index 0000000..8719170 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-nodes/heatmap.js @@ -0,0 +1,22 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +export default Ember.Route.extend({ +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-nodes/table.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-nodes/table.js new file mode 100644 index 0000000..38ae5d1 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-nodes/table.js @@ -0,0 +1,22 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +export default Ember.Route.extend({ +}); \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queue-apps.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queue-apps.js new file mode 100644 index 0000000..373e1be --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queue-apps.js @@ -0,0 +1,42 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +import AbstractRoute from './abstract'; + +export default AbstractRoute.extend({ + model(param) { + return Ember.RSVP.hash({ + selected : param.queue_name, + queues: this.store.findAll('yarn-queue'), + selectedQueue : undefined, + apps: undefined, // apps of selected queue + }); + }, + + afterModel(model) { + model.selectedQueue = this.store.peekRecord('yarn-queue', model.selected); + model.apps = this.store.findAll('yarn-app'); + }, + + unloadAll() { + this.store.unloadAll('yarn-queue'); + this.store.unloadAll('yarn-app'); + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queue.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queue.js new file mode 100644 index 0000000..5342913 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queue.js @@ -0,0 +1,42 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +import AbstractRoute from './abstract'; + +export default AbstractRoute.extend({ + model(param) { + return Ember.RSVP.hash({ + selected : param.queue_name, + queues: this.store.query('yarn-queue', {}), + selectedQueue : undefined, + apps: undefined, // apps of selected queue + }); + }, + + afterModel(model) { + model.selectedQueue = this.store.peekRecord('yarn-queue', model.selected); + model.apps = this.store.findAll('yarn-app'); + }, + + unloadAll() { + this.store.unloadAll('yarn-queue'); + this.store.unloadAll('yarn-app'); + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queues.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queues.js new file mode 100644 index 0000000..5342913 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queues.js @@ -0,0 +1,42 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +import AbstractRoute from './abstract'; + +export default AbstractRoute.extend({ + model(param) { + return Ember.RSVP.hash({ + selected : param.queue_name, + queues: this.store.query('yarn-queue', {}), + selectedQueue : undefined, + apps: undefined, // apps of selected queue + }); + }, + + afterModel(model) { + model.selectedQueue = this.store.peekRecord('yarn-queue', model.selected); + model.apps = this.store.findAll('yarn-app'); + }, + + unloadAll() { + this.store.unloadAll('yarn-queue'); + this.store.unloadAll('yarn-app'); + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queues/index.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queues/index.js new file mode 100644 index 0000000..4ab5716 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queues/index.js @@ -0,0 +1,23 @@ +/** + * 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. + */ + +export default Ember.Route.extend({ + beforeModel() { + this.transitionTo('yarn-queues.root'); + } +}); \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queues/queues-selector.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queues/queues-selector.js new file mode 100644 index 0000000..5d14c6f --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queues/queues-selector.js @@ -0,0 +1,25 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +export default Ember.Route.extend({ + model() { + return this.store.findAll('yarn-queue'); + }, +}); \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/cluster-info.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/cluster-info.js new file mode 100644 index 0000000..fad321a --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/cluster-info.js @@ -0,0 +1,47 @@ +/** + * 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. + */ + +import DS from 'ember-data'; + +export default DS.JSONAPISerializer.extend({ + normalizeSingleResponse(store, primaryModelClass, payload, id, + requestType) { + var fixedPayload = { + id: id, + type: primaryModelClass.modelName, + attributes: payload + }; + + return this._super(store, primaryModelClass, fixedPayload, id, + requestType); + }, + + normalizeArrayResponse(store, primaryModelClass, payload, id, + requestType) { + // return expected is { data: [ {}, {} ] } + var normalizedArrayResponse = {}; + + // payload has apps : { app: [ {},{},{} ] } + // need some error handling for ex apps or app may not be defined. + normalizedArrayResponse.data = [ + this.normalizeSingleResponse(store, primaryModelClass, + payload.clusterInfo, payload.clusterInfo.id, requestType) + ]; + return normalizedArrayResponse; + } +}); \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/cluster-metric.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/cluster-metric.js new file mode 100644 index 0000000..73c4bc5 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/cluster-metric.js @@ -0,0 +1,47 @@ +/** + * 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. + */ + +import DS from 'ember-data'; + +export default DS.JSONAPISerializer.extend({ + normalizeSingleResponse(store, primaryModelClass, payload, id, + requestType) { + var fixedPayload = { + id: id, + type: primaryModelClass.modelName, + attributes: payload + }; + + return this._super(store, primaryModelClass, fixedPayload, id, + requestType); + }, + + normalizeArrayResponse(store, primaryModelClass, payload, id, + requestType) { + // return expected is { data: [ {}, {} ] } + var normalizedArrayResponse = {}; + + // payload has apps : { app: [ {},{},{} ] } + // need some error handling for ex apps or app may not be defined. + normalizedArrayResponse.data = [ + this.normalizeSingleResponse(store, primaryModelClass, + payload.clusterMetrics, 1, requestType) + ]; + return normalizedArrayResponse; + } +}); \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app-attempt.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app-attempt.js new file mode 100644 index 0000000..3de377a --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app-attempt.js @@ -0,0 +1,75 @@ +/** + * 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. + */ + +import DS from 'ember-data'; +import Converter from 'yarn-ui/utils/converter'; + +export default DS.JSONAPISerializer.extend({ + internalNormalizeSingleResponse(store, primaryModelClass, payload, id, + requestType) { + + if (payload.appAttempt) { + payload = payload.appAttempt; + } + + var fixedPayload = { + id: payload.appAttemptId, + type: primaryModelClass.modelName, // yarn-app + attributes: { + startTime: Converter.timeStampToDate(payload.startTime), + startedTime: Converter.timeStampToDate(payload.startedTime), + finishedTime: Converter.timeStampToDate(payload.finishedTime), + containerId: payload.containerId, + amContainerId: payload.amContainerId, + nodeHttpAddress: payload.nodeHttpAddress, + nodeId: payload.nodeId, + hosts: payload.host, + state: payload.appAttemptState, + logsLink: payload.logsLink, + appAttemptId: payload.appAttemptId + } + }; + + return fixedPayload; + }, + + normalizeSingleResponse(store, primaryModelClass, payload, id, + requestType) { + var p = this.internalNormalizeSingleResponse(store, + primaryModelClass, payload, id, requestType); + return { data: p }; + }, + + normalizeArrayResponse(store, primaryModelClass, payload, id, + requestType) { + // return expected is { data: [ {}, {} ] } + var normalizedArrayResponse = {}; + + if (payload.appAttempts && payload.appAttempts.appAttempt) { + // payload has apps : { app: [ {},{},{} ] } + // need some error handling for ex apps or app may not be defined. + normalizedArrayResponse.data = payload.appAttempts.appAttempt.map(singleApp => { + return this.internalNormalizeSingleResponse(store, primaryModelClass, + singleApp, singleApp.id, requestType); + }, this); + } else { + normalizedArrayResponse.data = []; + } + return normalizedArrayResponse; + } +}); \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app.js new file mode 100644 index 0000000..427c3d8 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app.js @@ -0,0 +1,93 @@ +/** + * 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. + */ + +import DS from 'ember-data'; +import Converter from 'yarn-ui/utils/converter'; + +export default DS.JSONAPISerializer.extend({ + internalNormalizeSingleResponse(store, primaryModelClass, payload, id, + requestType) { + if (payload.app) { + payload = payload.app; + } + + var fixedPayload = { + id: id, + type: primaryModelClass.modelName, // yarn-app + attributes: { + appName: payload.name, + user: payload.user, + queue: payload.queue, + state: payload.state, + startTime: Converter.timeStampToDate(payload.startedTime), + elapsedTime: Converter.msToElapsedTime(payload.elapsedTime), + finishedTime: Converter.timeStampToDate(payload.finishedTime), + finalStatus: payload.finalStatus, + progress: payload.progress, + applicationType: payload.applicationType, + diagnostics: payload.diagnostics, + amContainerLogs: payload.amContainerLogs, + amHostHttpAddress: payload.amHostHttpAddress, + logAggregationStatus: payload.logAggregationStatus, + unmanagedApplication: payload.unmanagedApplication, + amNodeLabelExpression: payload.amNodeLabelExpression, + priority: payload.priority, + allocatedMB: payload.allocatedMB, + allocatedVCores: payload.allocatedVCores, + runningContainers: payload.runningContainers, + memorySeconds: payload.memorySeconds, + vcoreSeconds: payload.vcoreSeconds, + preemptedResourceMB: payload.preemptedResourceMB, + preemptedResourceVCores: payload.preemptedResourceVCores, + numNonAMContainerPreempted: payload.numNonAMContainerPreempted, + numAMContainerPreempted: payload.numAMContainerPreempted, + clusterUsagePercentage: payload.clusterUsagePercentage, + queueUsagePercentage: payload.queueUsagePercentage, + currentAppAttemptId: payload.currentAppAttemptId + } + }; + + return fixedPayload; + }, + + normalizeSingleResponse(store, primaryModelClass, payload, id, + requestType) { + var p = this.internalNormalizeSingleResponse(store, + primaryModelClass, payload, id, requestType); + return { data: p }; + }, + + normalizeArrayResponse(store, primaryModelClass, payload, id, + requestType) { + // return expected is { data: [ {}, {} ] } + var normalizedArrayResponse = {}; + + // payload has apps : { app: [ {},{},{} ] } + // need some error handling for ex apps or app may not be defined. + if(payload.apps && payload.apps.app) { + normalizedArrayResponse.data = payload.apps.app.map(singleApp => { + return this.internalNormalizeSingleResponse(store, primaryModelClass, + singleApp, singleApp.id, requestType); + }, this); + } else { + normalizedArrayResponse.data = []; + } + + return normalizedArrayResponse; + } +}); \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-container-log.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-container-log.js new file mode 100644 index 0000000..9e10615 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-container-log.js @@ -0,0 +1,39 @@ +/** + * 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. + */ + +import DS from 'ember-data'; +import Converter from 'yarn-ui/utils/converter'; + +export default DS.JSONAPISerializer.extend({ + normalizeSingleResponse(store, primaryModelClass, payload, id, + requestType) { + // Convert plain text response into JSON. + // ID is of the form nodeAddress!containerId!fileName + var splits = Converter.splitForContainerLogs(id); + var convertedPayload = { + id: id, + type: primaryModelClass.modelName, + attributes: { + logs: payload, + containerID: splits[1], + logFileName: splits[2] + } + }; + return { data: convertedPayload }; + }, +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-container.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-container.js new file mode 100644 index 0000000..b9b923d --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-container.js @@ -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. + */ + +import DS from 'ember-data'; +import Converter from 'yarn-ui/utils/converter'; + +export default DS.JSONAPISerializer.extend({ + internalNormalizeSingleResponse(store, primaryModelClass, payload, id, + requestType) { + + var fixedPayload = { + id: payload.containerId, + type: primaryModelClass.modelName, // yarn-app + attributes: { + allocatedMB: payload.allocatedMB, + allocatedVCores: payload.allocatedVCores, + assignedNodeId: payload.assignedNodeId, + priority: payload.priority, + startedTime: Converter.timeStampToDate(payload.startedTime), + finishedTime: Converter.timeStampToDate(payload.finishedTime), + elapsedTime: payload.elapsedTime, + logUrl: payload.logUrl, + containerExitStatus: payload.containerExitStatus, + containerState: payload.containerState, + nodeHttpAddress: payload.nodeHttpAddress + } + }; + + return fixedPayload; + }, + + normalizeSingleResponse(store, primaryModelClass, payload, id, + requestType) { + var p = this.internalNormalizeSingleResponse(store, + primaryModelClass, payload, id, requestType); + return { data: p }; + }, + + normalizeArrayResponse(store, primaryModelClass, payload, id, + requestType) { + // return expected is { data: [ {}, {} ] } + var normalizedArrayResponse = {}; + + if (payload && payload.container) { + if (Array.isArray(payload.container)) { + // payload has apps : { app: [ {},{},{} ] } + // need some error handling for ex apps or app may not be defined. + normalizedArrayResponse.data = payload.container.map(singleContainer => { + return this.internalNormalizeSingleResponse(store, primaryModelClass, + singleContainer, singleContainer.id, requestType); + }, this); + } else { + normalizedArrayResponse.data = [this.internalNormalizeSingleResponse( + store, primaryModelClass, payload.container, payload.container.id, + requestType)]; + } + return normalizedArrayResponse; + } else { + normalizedArrayResponse.data = []; + } + + return normalizedArrayResponse; + } +}); \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-node-app.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-node-app.js new file mode 100644 index 0000000..3dfd776 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-node-app.js @@ -0,0 +1,83 @@ +/** + * 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. + */ +/** + * 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. + */ + +import DS from 'ember-data'; +import Ember from 'ember'; + +export default DS.JSONAPISerializer.extend({ + internalNormalizeSingleResponse(store, primaryModelClass, payload) { + if (payload.app) { + payload = payload.app; + } + + var fixedPayload = { + id: payload.id, + type: primaryModelClass.modelName, + attributes: { + appId: payload.id, + state: payload.state, + user: payload.user, + containers: payload.containerids + } + }; + return fixedPayload; + }, + + normalizeSingleResponse(store, primaryModelClass, payload, id, + requestType) { + // payload is of the form {"app":{}} + var p = this.internalNormalizeSingleResponse(store, + primaryModelClass, payload); + return { data: p }; + }, + + normalizeArrayResponse(store, primaryModelClass, payload, id, + requestType) { + // expected return response is of the form { data: [ {}, {} ] } + var normalizedArrayResponse = {}; + // payload is of the form { "apps" : { "app": [ {},{},{} ] } } + if (payload.apps && payload.apps.app) { + normalizedArrayResponse.data = payload.apps.app.map(singleApp => { + return this.internalNormalizeSingleResponse(store, primaryModelClass, + singleApp); + }, this); + } else { + // No container reported inside containers. + // Response of the form { "apps": null } + normalizedArrayResponse.data = []; + } + return normalizedArrayResponse; + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-node-container.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-node-container.js new file mode 100644 index 0000000..bf19ad7 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-node-container.js @@ -0,0 +1,71 @@ +/** + * 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. + */ + +import DS from 'ember-data'; +import Ember from 'ember'; + +export default DS.JSONAPISerializer.extend({ + internalNormalizeSingleResponse(store, primaryModelClass, payload) { + if (payload.container) { + payload = payload.container; + } + var fixedPayload = { + id: payload.id, + type: primaryModelClass.modelName, + attributes: { + containerId: payload.id, + state: payload.state, + user: payload.user, + diagnostics: payload.diagnostics, + exitCode: payload.exitCode, + totalMemoryNeeded: payload.totalMemoryNeededMB, + totalVCoresNeeded: payload.totalVCoresNeeded, + containerLogFiles: payload.containerLogFiles + } + }; + + return fixedPayload; + }, + + normalizeSingleResponse(store, primaryModelClass, payload, id, + requestType) { + // payload is of the form {"container":{}} + var p = this.internalNormalizeSingleResponse(store, + primaryModelClass, payload); + return { data: p }; + }, + + normalizeArrayResponse(store, primaryModelClass, payload, id, + requestType) { + // expected return response is of the form { data: [ {}, {} ] } + var normalizedArrayResponse = {}; + if (payload.containers && payload.containers.container) { + // payload is of the form { "containers" : { "container": [ {},{},{} ] } } + normalizedArrayResponse.data = + payload.containers.container.map(singleContainer => { + return this.internalNormalizeSingleResponse(store, primaryModelClass, + singleContainer); + }, this); + } else { + // No container reported inside containers. + // Response of the form { "containers": null } + normalizedArrayResponse.data = []; + } + return normalizedArrayResponse; + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-node.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-node.js new file mode 100644 index 0000000..19308e2 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-node.js @@ -0,0 +1,56 @@ +/** + * 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. + */ + +import DS from 'ember-data'; +import Converter from 'yarn-ui/utils/converter'; + +export default DS.JSONAPISerializer.extend({ + internalNormalizeSingleResponse(store, primaryModelClass, payload, id, + requestType) { + if (payload.nodeInfo) { + payload = payload.nodeInfo; + } + + var fixedPayload = { + id: id, + type: primaryModelClass.modelName, + attributes: { + totalVmemAllocatedContainersMB: payload.totalVmemAllocatedContainersMB, + totalPmemAllocatedContainersMB: payload.totalPmemAllocatedContainersMB, + totalVCoresAllocatedContainers: payload.totalVCoresAllocatedContainers, + vmemCheckEnabled: payload.vmemCheckEnabled, + pmemCheckEnabled: payload.pmemCheckEnabled, + nodeHealthy: payload.nodeHealthy, + lastNodeUpdateTime: Converter.timeStampToDate(payload.lastNodeUpdateTime), + healthReport: payload.healthReport, + nmStartupTime: Converter.timeStampToDate(payload.nmStartupTime), + nodeManagerBuildVersion: payload.nodeManagerBuildVersion, + hadoopBuildVersion: payload.hadoopBuildVersion + } + }; + return fixedPayload; + }, + + normalizeSingleResponse(store, primaryModelClass, payload, id, + requestType) { + // payload is of the form {"nodeInfo":{}} + var p = this.internalNormalizeSingleResponse(store, + primaryModelClass, payload, id, requestType); + return { data: p }; + }, +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-queue.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-queue.js new file mode 100644 index 0000000..1c5b7b3 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-queue.js @@ -0,0 +1,145 @@ +/** + * 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. + */ + +import DS from 'ember-data'; + +export default DS.JSONAPISerializer.extend({ + + normalizeSingleResponse(store, primaryModelClass, payload, id, + requestType) { + var children = []; + if (payload.queues) { + payload.queues.queue.forEach(function(queue) { + children.push(queue.queueName); + }); + } + + var includedData = []; + var relationshipUserData = []; + + // update user models + if (payload.users && payload.users.user) { + payload.users.user.forEach(function(u) { + includedData.push({ + type: "YarnUser", + id: u.username + "_" + payload.queueName, + attributes: { + name: u.username, + queueName: payload.queueName, + usedMemoryMB: u.resourcesUsed.memory || 0, + usedVCore: u.resourcesUsed.vCores || 0, + } + }); + + relationshipUserData.push({ + type: "YarnUser", + id: u.username + "_" + payload.queueName, + }) + }); + } + + + var fixedPayload = { + id: id, + type: primaryModelClass.modelName, // yarn-queue + attributes: { + name: payload.queueName, + parent: payload.myParent, + children: children, + capacity: payload.capacity, + usedCapacity: payload.usedCapacity, + maxCapacity: payload.maxCapacity, + absCapacity: payload.absoluteCapacity, + absMaxCapacity: payload.absoluteMaxCapacity, + absUsedCapacity: payload.absoluteUsedCapacity, + state: payload.state, + userLimit: payload.userLimit, + userLimitFactor: payload.userLimitFactor, + preemptionDisabled: payload.preemptionDisabled, + numPendingApplications: payload.numPendingApplications, + numActiveApplications: payload.numActiveApplications, + }, + // Relationships + relationships: { + users: { + data: relationshipUserData + } + } + }; + + return { + queue: this._super(store, primaryModelClass, fixedPayload, id, requestType), + includedData: includedData + } + }, + + handleQueue(store, primaryModelClass, payload, id, requestType) { + var data = []; + var includedData = [] + var result = this.normalizeSingleResponse(store, primaryModelClass, + payload, id, requestType); + + data.push(result.queue); + includedData = includedData.concat(result.includedData); + + if (payload.queues) { + for (var i = 0; i < payload.queues.queue.length; i++) { + var queue = payload.queues.queue[i]; + queue.myParent = payload.queueName; + var childResult = this.handleQueue(store, primaryModelClass, queue, + queue.queueName, + requestType); + + data = data.concat(childResult.data); + includedData = includedData.concat(childResult.includedData); + } + } + + return { + data: data, + includedData, includedData + } + }, + + normalizeArrayResponse(store, primaryModelClass, payload, id, + requestType) { + var normalizedArrayResponse = {}; + var result = this.handleQueue(store, + primaryModelClass, + payload.scheduler.schedulerInfo, "root", requestType); + + normalizedArrayResponse.data = result.data; + normalizedArrayResponse.included = result.includedData; + + console.log(normalizedArrayResponse); + + return normalizedArrayResponse; + + /* + // return expected is { data: [ {}, {} ] } + var normalizedArrayResponse = {}; + + // payload has apps : { app: [ {},{},{} ] } + // need some error handling for ex apps or app may not be defined. + normalizedArrayResponse.data = payload.apps.app.map(singleApp => { + return this.normalizeSingleResponse(store, primaryModelClass, singleApp, singleApp.id, requestType); + }, this); + return normalizedArrayResponse; + */ + } +}); \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-rm-node.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-rm-node.js new file mode 100644 index 0000000..6feab36 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-rm-node.js @@ -0,0 +1,74 @@ +/** + * 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. + */ + +import Ember from 'ember'; +import DS from 'ember-data'; +import Converter from 'yarn-ui/utils/converter'; + +export default DS.JSONAPISerializer.extend({ + internalNormalizeSingleResponse(store, primaryModelClass, payload, id) { + if (payload.node) { + payload = payload.node; + } + + var fixedPayload = { + id: id, + type: primaryModelClass.modelName, + attributes: { + rack: payload.rack, + state: payload.state, + nodeHostName: payload.nodeHostName, + nodeHTTPAddress: payload.nodeHTTPAddress, + lastHealthUpdate: Converter.timeStampToDate(payload.lastHealthUpdate), + healthReport: payload.healthReport, + numContainers: payload.numContainers, + usedMemoryMB: payload.usedMemoryMB, + availMemoryMB: payload.availMemoryMB, + usedVirtualCores: payload.usedVirtualCores, + availableVirtualCores: payload.availableVirtualCores, + version: payload.version, + nodeLabels: payload.nodeLabels + } + }; + return fixedPayload; + }, + + normalizeSingleResponse(store, primaryModelClass, payload, id, + requestType) { + // payload is of the form {"nodeInfo":{}} + var p = this.internalNormalizeSingleResponse(store, + primaryModelClass, payload, id); + return { data: p }; + }, + + normalizeArrayResponse(store, primaryModelClass, payload, id, + requestType) { + // expected response is of the form { data: [ {}, {} ] } + var normalizedArrayResponse = {}; + if (payload.nodes) { + // payload is of the form { "nodes": { "node": [ {},{},{} ] } } + normalizedArrayResponse.data = payload.nodes.node.map(singleNode => { + return this.internalNormalizeSingleResponse(store, primaryModelClass, + singleNode, singleNode.id); + }, this); + } else { + normalizedArrayResponse.data = []; + } + return normalizedArrayResponse; + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/services/env.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/services/env.js new file mode 100644 index 0000000..208499c --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/services/env.js @@ -0,0 +1,59 @@ +/*global more*/ +/** + * 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. + */ + +import Ember from 'ember'; + +import environment from '../config/environment'; + +var MoreObject = more.Object; + +export default Ember.Service.extend({ + ENV: null, + + init: function () { + this.collateConfigs(); + }, + + collateConfigs: function () { + var collatedENV = { + APP: {} + }, + ENV = window.ENV; + + MoreObject.merge(collatedENV, environment); + + if(ENV) { + MoreObject.merge(collatedENV.APP, ENV); + } + + this.setComputedENVs(collatedENV); + + this.set("ENV", collatedENV); + }, + + setComputedENVs: function (env) { + var navigator = window.navigator; + env.isIE = navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') > 0; + console.log('In setComputedENVs', env.isIE); + }, + + app: Ember.computed("ENV.APP", function () { + return this.get("ENV.APP"); + }) +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/services/hosts.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/services/hosts.js new file mode 100644 index 0000000..19863e1 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/services/hosts.js @@ -0,0 +1,74 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +export default Ember.Service.extend({ + + env: Ember.inject.service("env"), + + attachProtocolScheme: function (url) { + var localProto = this.get("env.app.hosts.protocolScheme"); + + if(localProto === "") { + localProto = "http:"; + } + + if(url.match("://")) { + url = url.substr(url.indexOf("://") + 3); + } + + return localProto + "//" + url; + }, + + normalizeURL: function (url) { + var address; + + // If localBaseAddress is configured, then normalized URL has to + // start with this address. For eg: when used with CORS proxy. + // In any case, this fn will return with correct proto scheme. + address = this.localAddress() + url; + + // Remove trailing slash + if(address && address.charAt(address.length - 1) === '/') { + address = address.slice(0, -1); + } + return address; + }, + + localAddress: function () { + var localBaseAddressProto = ""; + + if (this.get("env.app.hosts.localBaseAddress").length > 0) { + localBaseAddressProto = this.get("env.app.hosts.localBaseAddress") + '/'; + } + return this.attachProtocolScheme(localBaseAddressProto); + }, + + localBaseAddress: Ember.computed(function () { + return this.localAddress(); + }), + + timelineWebAddress: Ember.computed(function () { + return this.normalizeURL(this.get("env.app.hosts.timelineWebAddress")); + }), + + rmWebAddress: Ember.computed(function () { + return this.normalizeURL(this.get("env.app.hosts.rmWebAddress")); + }), +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/styles/app.css b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/styles/app.css new file mode 100644 index 0000000..da5b4bf --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/styles/app.css @@ -0,0 +1,279 @@ +/** + * 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. + */ + +body, html, body > .ember-view { + height: 100%; + overflow: visible; + color: @text-color; +} +body, html { + min-width: 1024px; +} + +/* + Over all style + */ +text { + font: 16px sans-serif; +} + +text.small { + font: 8px sans-serif; +} + +html, body +{ + margin: 0px; + padding: 0px; + height: 100%; + width: 100%; +} + + +/* + queue's style (left banner of queues) + */ + +text.queue { + font-family : sans-serif; + font-size : 15px; + fill : gray; +} + +text.heatmap-cell { + font: 14px sans-serif; + font-weight: bold; + text-anchor: middle; + fill: Azure; + text-align: center; +} + +text.heatmap-cell-notselected { + font: 14px sans-serif; + font-weight: bold; + text-anchor: middle; + fill: Silver; + text-align: center; +} + +text.heatmap-rack { + font: 20px sans-serif; + fill: DimGray; +} + +path.queue { + stroke: "red"; + fill: none; +} + +/* + background style + */ +line.grid { + stroke: WhiteSmoke; +} + +line.chart { + stroke: Gray; +} + +/* + charts styles + */ +text.chart-title { + font-size: 30px; + font-family: sans-serif; + text-anchor: middle; + fill: Gray; +} + +text.donut-highlight-text, text.donut-highlight-sub { + font-size: 15px; + font-family: sans-serif; + text-anchor: middle; + fill: Gray; + vertical-align: middle; +} + +text.donut-highlight-sub { + font-size: 23px; + margin-top: 10px; +} + +rect.chart-frame { + fill: none; +} + +text.bar-chart-text { + font-size: 8px; + font-family: sans-serif; + vertical-align: middle; + fill: Gray;; +} + +div.tooltip { + position: absolute; + text-align: center; + padding: 2px; + font: 24px sans-serif; + background: lightsteelblue; + border: 0px; + border-radius: 8px; + pointer-events: none; +} + +/* + * Data table + */ + +table.dataTable thead .sorting { + background-image: url("/assets/images/datatables/sort_both.png"); +} +table.dataTable thead .sorting_asc { + background-image: url("/assets/images/datatables/sort_asc.png"); +} +table.dataTable thead .sorting_desc { + background-image: url("/assets/images/datatables/sort_desc.png"); +} +table.dataTable thead .sorting_asc_disabled { + background-image: url("/assets/images/datatables/sort_asc_disabled.png"); +} +table.dataTable thead .sorting_desc_disabled { + background-image: url("/assets/images/datatables/sort_desc_disabled.png"); +} + +.add-ellipsis { + overflow: hidden; + text-overflow: ellipsis; +} + +.breadcrumb { + padding-bottom: 3px; +} + +.navbar-default .navbar-nav > li > a { + color: #337ab7; +} + +/* + * Queue selector + */ +.node { + cursor: pointer; +} + +.node circle { + fill: #fff; + stroke: steelblue; + stroke-width: 3px; +} + +.node text { + font: 12px sans-serif; +} + +.link { + fill: none; + stroke: #ccc; + stroke-width: 2px; +} + +.lr-margin { + margin: 0px 30px; +} + +.footer { + background-color: @white; + color: @text-color; + + padding: 10px 0px; + margin: 0px; + + border-top: 1px lightgrey solid; + + font-size: .9em; +} + +.table { + margin-bottom: 0px; + border: none; + + overflow: hidden; +} + +.table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td { + border: none !important; +} + +.dataTables_wrapper .table { + border: 1px solid lightgrey; + border-bottom: 1px solid lightgrey !important; + border-radious: 5px; +} + +.dataTables_wrapper .table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td { + border: 1px solid lightgrey; +} + +td { + padding: 8px 15px 8px 15px !important; +} + +.footer-frame { + height: 60px; +} +.footer { + height: 40px; +} + +.footer-pusher { + min-height: 100%; + height: auto !important; + height: 100%; + margin: 0 auto -40px; // Must be same as footer & footer-frame +} + +.panel-default .container-fluid { + margin-top: -45px !important; + margin-bottom: -10px !important; +} + +.panel-heading { + font-weight: bold; +} + +.hadoop-brand-image { + margin-top: -10px; + width: auto; + height: 45px; +} + +li a.navigation-link.ember-view { + color: #2196f3; + font-weight: bold; +} + +.breadcrumb-bar .refresh { + position: absolute; + right: 20px; + top: 3px; +} + +.x-scroll { + overflow-x: scroll; +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/application.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/application.hbs new file mode 100644 index 0000000..7783db4 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/application.hbs @@ -0,0 +1,85 @@ +{{! + * 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. +}} + + + + diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/cluster-overview.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/cluster-overview.hbs new file mode 100644 index 0000000..3bf0f37 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/cluster-overview.hbs @@ -0,0 +1,150 @@ +{{! + * 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. +}} + +{{breadcrumb-bar breadcrumbs=breadcrumbs}} + +{{#if model}} + +| Application Attempt Id | +{{attempt.id}} | +
| Start Time | +{{attempt.attemptStartedTime}} | +
| AM Container Id | +{{attempt.appMasterContainerId}} | +
| AM Node Web UI | +{{attempt.nodeHttpAddress}} | +
| AM Node Id | +{{attempt.amNodeId}} | +
| Log | +link | +
| Attempt State | +{{attempt.attemptState}} | +
| Elapsed Time | +{{attempt.elapsedTime}} | +
| Application ID | +Application Type | +Name | +User | +Queue | +State | +Final Status | +Start Time | +Elapsed Time | +Finished Time | +Priority | +Progress | +%Cluster | +
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{app.id}} | +{{app.applicationType}} | +{{app.appName}} | +{{app.user}} | +{{app.queue}} | +{{app.state}} | +{{app.finalStatus}} | +{{app.startTime}} | +{{app.elapsedTime}} | +{{app.validatedFinishedTs}} | +{{app.priority}} | +
+
+
+
+ |
+ {{app.clusterUsagePercentage}} | +
| {{app.id}} | +{{app.applicationType}} | +{{app.appName}} | +{{app.user}} | +{{app.queue}} | +{{app.state}} | +{{app.finalStatus}} | +{{app.startTime}} | +{{app.elapsedTime}} | +{{app.validatedFinishedTs}} | +{{app.priority}} | +
+
+
+
+ |
+ {{app.clusterUsagePercentage}} | +
| Start Time | +{{container.startedTime}} | +
| Finished Time | +{{container.validatedFinishedTs}} | +
| Elapsed Time | +{{container.elapsedTime}} | +
| Priority | +{{container.priority}} | +
| Log | +link | +
| Exit Status | +{{container.containerExitStatus}} | +
| State | +{{container.containerState}} | +
| NodeManager UI | +{{container.nodeHttpAddress}} | +
| Configurations | +Value | +
| Configured Capacity | +{{queue.capacity}} | +
| Configured Max Capacity | +{{queue.maxCapacity}} | +
| State | +{{queue.state}} | +
| User Limit Percent | +{{queue.userLimit}} | +
| User Limit Factor | +{{queue.userLimitFactor}} | +
| Preemption Disabled | +{{queue.preemptionDisabled}} | +
| Application ID | +Name | +User | +Queue | +State | +Final Status | +Start Time | +Elapsed Time | +Finished Time | +Priority | +Progress | +Is Unmanaged AM | +
|---|---|---|---|---|---|---|---|---|---|---|---|
| {{model.app.id}} | +{{model.app.appName}} | +{{model.app.user}} | +{{model.app.queue}} | +{{model.app.state}} | ++ + {{model.app.finalStatus}} + + | +{{model.app.startTime}} | +{{model.app.elapsedTime}} | +{{model.app.validatedFinishedTs}} | +{{model.app.priority}} | +
+
+
+
+ |
+ {{model.app.unmanagedApplication}} | +
| Allocated Resource | +Running Containers | +Preempted Resource | +Num Non-AM container preempted | +Num AM container preempted | +Aggregated Resource Usage | +
|---|---|---|---|---|---|
| {{model.app.allocatedResource}} | +{{model.app.runningContainersNumber}} | +{{model.app.preemptedResource}} | +{{model.app.numAMContainerPreempted}} | +{{model.app.numAMContainerPreempted}} | +{{model.app.aggregatedResourceUsage}} | +
{{model.containerLog.logs}}
+ {{else}}
+ No logs were written in {{model.containerLog.logFileName}}.
+ {{/if}} +| Application ID | +{{model.nodeApp.appId}} | +
| Application State | +{{model.nodeApp.state}} | +
| User | +{{model.nodeApp.user}} | +
| Containers for {{model.nodeApp.appId}} | +
|---|
| {{container}} | +
| Application ID | +State | +User | +
|---|---|---|
| {{app.appId}} | +{{app.state}} | +{{app.user}} | +
| Container ID | +{{model.nodeContainer.containerId}} | +
| Container State | +{{model.nodeContainer.state}} | +
| Exit Code | +{{model.nodeContainer.exitCode}} | +
| Diagnostics | +{{model.nodeContainer.diagnostics}} | +
| User | +{{model.nodeContainer.user}} | +
| Total Memory Needed | +{{model.nodeContainer.totalMemoryNeeded}} MB | +
| Total VCores Needed | +{{model.nodeContainer.totalVCoresNeeded}} | +
| Link to Logs | ++ {{log-files-comma nodeId=model.nodeInfo.id + nodeAddr=model.nodeInfo.addr + containerId=model.nodeContainer.containerId + logFiles=model.nodeContainer.containerLogFiles}} + | +
| Container ID | +Container State | +User | +Logs | +
|---|---|---|---|
| {{container.containerId}} | +{{container.state}} | +{{container.user}} | ++ {{log-files-comma nodeId=model.nodeInfo.id + nodeAddr=model.nodeInfo.addr + containerId=container.containerId + logFiles=container.containerLogFiles}} + | +
| Total Vmem allocated for Containers | +{{divide num=model.node.totalVmemAllocatedContainersMB den=1024}} GB | +
| Vmem enforcement enabled | +{{model.node.vmemCheckEnabled}} | +
| Total Pmem allocated for Containers | +{{divide num=model.node.totalPmemAllocatedContainersMB den=1024}} GB | +
| Pmem enforcement enabled | +{{model.node.pmemCheckEnabled}} | +
| Total VCores allocated for Containers | +{{model.node.totalVCoresAllocatedContainers}} | +
| Node Healthy Status | +{{model.node.nodeHealthy}} | +
| Last Node Health Report Time | +{{model.node.lastNodeUpdateTime}} | +
| Node Health Report | +{{model.node.healthReport}} | +
| Node Manager Start Time | +{{model.node.nmStartupTime}} | +
| Node Manager Version | +{{model.node.nodeManagerBuildVersion}} | +
| Hadoop Version | +{{model.node.hadoopBuildVersion}} | +
| Node Labels | +Rack | +Node State | +Node Address | +Node HTTP Address | +Last Health Update | +Health-Report | +Containers | +Mem Used | +Mem Avail | +VCores Used | +VCores Avail | +Version | +
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{node.nodeLabelsAsString}} | +{{node.rack}} | +{{node.state}} | +{{node.id}} | + {{node-link nodeId=node.id nodeHTTPAddress=node.nodeHTTPAddress nodeState=node.state}} +{{node.lastHealthUpdate}} | +{{node.healthReport}} | +{{node.numContainers}} | +{{divide num=node.usedMemoryMB den=1024}} GB | +{{divide num=node.availMemoryMB den=1024}} GB | +{{node.usedVirtualCores}} | +{{node.availableVirtualCores}} | +{{node.version}} | +
xaze#&YwbBLB!?I9Wk?cv?CfTp)J=5v**V4brh|Va@cqU_e#vhsTOl#(v z%yaSt`6&59`7uR|qD(PE@tKmVEKokF{7`v4D>KWUwJz(IUMaoC^m?<`+3cijI(vEc zshs#6P0o^>##~YEsNBW5jlDbf*7R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y#qlIe3s0H#sl0!vLD|DR zqISayHM#Ko5I<~N*zDR2-`^cLUb^P Wc!->AWwHKYd0TAcPzP Y=)!HkCK$=U231X{2~oTgP@Nq&5v<}={o$mV#5d6m7{_io(VQCqambK- Y16@Zf7?Q8!JB-NJ(KYBs*Ff|C0Zg4MIsgCw literal 0 HcmV?d00001 diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/public/assets/images/datatables/favicon.ico b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/public/assets/images/datatables/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..6eeaa2a0d393190ce748107222d9a026f992e4a7 GIT binary patch literal 894 zcmZQzU<5(|0R|u`!H~hsz#zuJz@P!dKp_SNAO?xUfG{@$0|>*we Y}F;x;`B~@Mg`jC-vo5%k$%{OoKy1zkdA+(K2o3 zEDKGQQ~gcX+N!Tt Ej1|9e2tL(rheJva*5dKY#gZsIRxM zB;!h7 5Wi?9l5?>z>S-`t`=OAFp5C?(007k>qM(bnVuyja#;c*qL9N z(Q%=@`f7d2?T&^wySIHjy#MKh?rZrO7i!Bt-@f(!@WDrwB`uD&)%Eqcd3o(gVV7ri zp6ji@(BF7(+uE0x&)(R!?s#YIg_7JW1=-KHZv1@s(DS xD9<^am-%+f#!uU}z9=j>5*%b{WE2`20#tutPWS1# zz4s39d~xOMwaqJzOl{rMU%#oo=xj&xyY1WF&71o?Hs-LOkA D^4SRbV?yXz(e#efNwKXpT1J^s+yE;1`KXoe5&f?1A$ tYso}un=1c3AzCL>B&D=RpqN3i1hL&lnclP!D`u*G0#bsJv!oAH) z-rc|T`^Wdkrw?7(xb)_p%`Y#WdAn`Pvz+W#0Rbo6-Ha3zp1gPgjDkZ)k6Gz!@9D0( zG^hL4?)Be4zWep#`{$>RUhUoaq@wgyfd9*oU{6tz+SXQhl3284sj;T&{L=I*bGxt4 z@4vfX%A<*$FN^a&MMa! }GOXuX|8Oj3tosHiJ3*4TN zC7>_x-r1O=t(?KoTC+`+>7&2GzdqLHBg&F)2Q?&EGZ+}|Rpsc~9`m>jw35No)z4*} HQ$iB}HK{Sd literal 0 HcmV?d00001 diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/public/assets/images/datatables/sort_asc_disabled.png b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/public/assets/images/datatables/sort_asc_disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..fb11dfe24a6c564cb7ddf8bc96703ebb121df1e7 GIT binary patch literal 148 zcmeAS@N?(olHy`uVBq!ia0vp^!XV7S0wixl{&NRX(Vi}jAsXkC6BcOhI9!^3NY?Do zDX;f`c1`y6n0RgO@$!H7ch ZT&|Jn0dmaqO^XNm-CGtk!Ur<_=Jws3;%W$<+Mb6Mw<&;$T1GdZXL literal 0 HcmV?d00001 diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/public/assets/images/datatables/sort_both.png b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/public/assets/images/datatables/sort_both.png new file mode 100644 index 0000000000000000000000000000000000000000..af5bc7c5a10b9d6d57cb641aeec752428a07f0ca GIT binary patch literal 201 zcmeAS@N?(olHy`uVBq!ia0vp^!XV7S0wixl{&NRX6FglULp08By cxyy87-Q;~nRxO8@-UU*I^KVWyN+&SiMHu5xDOu|HNvwzODfTdXjhVyNu1 z#7^XbGKZ7 LW3XeONb $RKLeE*WhqbYpIXPIqK@r4)v+qN8um%99%MPpS9d#7Ed7SL@Bp00i_>zopr0H-Zb Aj{pDw literal 0 HcmV?d00001 diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/public/assets/images/datatables/sort_desc.png b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/public/assets/images/datatables/sort_desc.png new file mode 100644 index 0000000000000000000000000000000000000000..0e156deb5f61d18f9e2ec5da4f6a8c94a5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PrF`&FbD5^+f9TC}r*VY}CGTPV_va$SO#ErTU*N zRuuIrm2q&|b 27;KL~wn@zIMg?a4K<%p}L=50PYb;;}k|6u|(( z{!4_Yo-n1F9BI96_lL?iEd8)VxX*Rc1IX3+SK$Rv%mE_gFOWb1A#uY08b5dBzs67K z{~A9P`yb=y2K>j1Fn$i{e~h2N|L?i~&mHo&%YWVf@45faJ@9{r8ASS`?g#QdKj9ue ToJs!Af43z? SZw7 literal 0 HcmV?d00001 diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/public/crossdomain.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/public/crossdomain.xml new file mode 100644 index 0000000..43a2ea6 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/public/crossdomain.xml @@ -0,0 +1,34 @@ + + + + + + + + + + diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/testem.json b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/testem.json new file mode 100644 index 0000000..0f35392 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/testem.json @@ -0,0 +1,12 @@ +{ + "framework": "qunit", + "test_page": "tests/index.html?hidepassed", + "disable_watching": true, + "launch_in_ci": [ + "PhantomJS" + ], + "launch_in_dev": [ + "PhantomJS", + "Chrome" + ] +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/helpers/resolver.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/helpers/resolver.js new file mode 100644 index 0000000..f94998c --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/helpers/resolver.js @@ -0,0 +1,29 @@ +/** + * 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. + */ + +import Resolver from 'ember/resolver'; +import config from '../../config/environment'; + +var resolver = Resolver.create(); + +resolver.namespace = { + modulePrefix: config.modulePrefix, + podModulePrefix: config.podModulePrefix +}; + +export default resolver; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/helpers/start-app.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/helpers/start-app.js new file mode 100644 index 0000000..a7d05be --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/helpers/start-app.js @@ -0,0 +1,36 @@ +/** + * 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. + */ + +import Ember from 'ember'; +import Application from '../../app'; +import config from '../../config/environment'; + +export default function startApp(attrs) { + var application; + + var attributes = Ember.merge({}, config.APP); + attributes = Ember.merge(attributes, attrs); // use defaults, but you can override; + + Ember.run(function() { + application = Application.create(attributes); + application.setupForTesting(); + application.injectTestHelpers(); + }); + + return application; +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/index.html b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/index.html new file mode 100644 index 0000000..9681e8b --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/index.html @@ -0,0 +1,51 @@ + + + + + + + ++ + + + YarnUi Tests + + + + {{content-for 'head'}} + {{content-for 'test-head'}} + + + + + + {{content-for 'head-footer'}} + {{content-for 'test-head-footer'}} + + + + {{content-for 'body'}} + {{content-for 'test-body'}} + + + + + + + {{content-for 'body-footer'}} + {{content-for 'test-body-footer'}} + + diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/integration/components/breadcrumb-bar-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/integration/components/breadcrumb-bar-test.js new file mode 100644 index 0000000..ffc6515 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/integration/components/breadcrumb-bar-test.js @@ -0,0 +1,43 @@ +/** + * 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. + */ + +import { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +moduleForComponent('breadcrumb-bar', 'Integration | Component | breadcrumb bar', { + integration: true +}); + +test('it renders', function(assert) { + + // Set any properties with this.set('myProperty', 'value'); + // Handle any actions with this.on('myAction', function(val) { ... });" + EOL + EOL + + + this.render(hbs`{{breadcrumb-bar}}`); + + assert.equal(this.$().text().trim(), ''); + + // Template block usage:" + EOL + + this.render(hbs` + {{#breadcrumb-bar}} + template block text + {{/breadcrumb-bar}} + `); + + assert.equal(this.$().text().trim(), 'template block text'); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/test-helper.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/test-helper.js new file mode 100644 index 0000000..96975ee --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/test-helper.js @@ -0,0 +1,24 @@ +/** + * 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. + */ + +import resolver from './helpers/resolver'; +import { + setResolver +} from 'ember-qunit'; + +setResolver(resolver); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/adapters/yarn-app-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/adapters/yarn-app-test.js new file mode 100644 index 0000000..726345f --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/adapters/yarn-app-test.js @@ -0,0 +1,30 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('adapter:yarn-app', 'Unit | Adapter | yarn app', { + // Specify the other units that are required for this test. + // needs: ['serializer:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + var adapter = this.subject(); + assert.ok(adapter); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/adapters/yarn-container-log-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/adapters/yarn-container-log-test.js new file mode 100644 index 0000000..e6e7b43 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/adapters/yarn-container-log-test.js @@ -0,0 +1,73 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; +import Constants from 'yarn-ui/constants'; + +moduleFor('adapter:yarn-container-log', 'Unit | Adapter | ContainerLog', { +}); + +test('Basic creation', function(assert) { + let adapter = this.subject(); + + assert.ok(adapter); + assert.ok(adapter.urlForFindRecord); + assert.ok(adapter.ajax); + assert.ok(adapter.headers); + assert.ok(adapter.host); + assert.ok(adapter.namespace); + assert.equal(adapter.headers.Accept, "text/plain"); + assert.equal(adapter.namespace, "ws/v1/node"); +}); + +test('urlForFindRecord test', function(assert) { + let adapter = this.subject(); + let host = adapter.host; + assert.equal(adapter.urlForFindRecord("localhost:8042" + + Constants.PARAM_SEPARATOR + "container_e27_11111111111_0001_01_000001" + + Constants.PARAM_SEPARATOR + "syslog"), + host + "localhost:8042/ws/v1/node/containerlogs/" + + "container_e27_11111111111_0001_01_000001/syslog"); +}); + +test('ajaxOptions test', function(assert) { + let adapter = this.subject(); + var hash = adapter.ajaxOptions('/containerlogs', 'type', {}); + assert.equal(hash.dataType, 'text'); +}); + +test('findRecord test', function(assert) { + let adapter = this.subject(), + testModel = { modelName: "testModel" }, + testStore = {}, + testSnapshot = {}; + let host = adapter.host; + let testId = "localhost:8042" + Constants.PARAM_SEPARATOR + + "container_e27_11111111111_0001_01_000001" + Constants.PARAM_SEPARATOR + + "syslog"; + assert.expect(2); + + adapter.ajax = function (url, method) { + assert.equal(url, host + "localhost:8042/ws/v1/node/containerlogs/" + + "container_e27_11111111111_0001_01_000001/syslog"); + assert.equal(method, 'GET'); + }; + + adapter.findRecord(testStore, testModel, testId, testSnapshot); +}); + diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/adapters/yarn-node-app-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/adapters/yarn-node-app-test.js new file mode 100644 index 0000000..3a25996 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/adapters/yarn-node-app-test.js @@ -0,0 +1,93 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('adapter:yarn-node-app', 'Unit | Adapter | NodeApp', { +}); + +test('Basic creation', function(assert) { + let adapter = this.subject(); + assert.expect(11); + assert.ok(adapter); + assert.ok(adapter.urlForQueryRecord); + assert.ok(adapter.queryRecord); + assert.ok(adapter.urlForQuery); + assert.ok(adapter.query); + assert.ok(adapter.ajax); + assert.ok(adapter.headers); + assert.ok(adapter.host); + assert.ok(adapter.namespace); + assert.equal("application/json", adapter.headers.Accept); + assert.equal("ws/v1/node", adapter.namespace); +}); + +test('urlForQueryRecord test', function(assert) { + let adapter = this.subject(); + let host = adapter.host; + assert.equal( + host + "localhost:8042/ws/v1/node/apps/application_1111111111_1111", + adapter.urlForQueryRecord( + {nodeAddr: "localhost:8042", appId: "application_1111111111_1111"})); +}); + +test('urlForQuery test', function(assert) { + let adapter = this.subject(); + let host = adapter.host; + assert.equal(host + "localhost:8042/ws/v1/node/apps", + adapter.urlForQuery({nodeAddr: "localhost:8042"})); +}); + +test('query test', function(assert) { + let adapter = this.subject(), + testModel = { modelName: "testModel" }, + testStore = {}, + testQuery = {nodeAddr: "localhost:8042"}; + let host = adapter.host; + assert.expect(3); + + adapter.ajax = function (url, method, hash) { + assert.equal(host + "localhost:8042/ws/v1/node/apps", url); + assert.equal('GET', method); + assert.equal(null, hash.data); + }; + + adapter.query(testStore, testModel, testQuery); +}); + +test('queryRecord test', function(assert) { + let adapter = this.subject(), + testModel = { modelName: "testModel" }, + testStore = {}, + testQuery = { + nodeAddr: "localhost:8042", + appId: "application_1111111111_1111" + }; + let host = adapter.host; + assert.expect(3); + + adapter.ajax = function (url, method, hash) { + assert.equal( + host + "localhost:8042/ws/v1/node/apps/application_1111111111_1111", + url); + assert.equal('GET', method); + assert.equal(null, hash.data); + }; + + adapter.queryRecord(testStore, testModel, testQuery); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/adapters/yarn-node-container-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/adapters/yarn-node-container-test.js new file mode 100644 index 0000000..7d2bb2d --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/adapters/yarn-node-container-test.js @@ -0,0 +1,93 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('adapter:yarn-node-container', 'Unit | Adapter | NodeContainer', { +}); + +test('Basic creation', function(assert) { + let adapter = this.subject(); + assert.expect(11); + assert.ok(adapter); + assert.ok(adapter.urlForQueryRecord); + assert.ok(adapter.queryRecord); + assert.ok(adapter.urlForQuery); + assert.ok(adapter.query); + assert.ok(adapter.ajax); + assert.ok(adapter.headers); + assert.ok(adapter.host); + assert.ok(adapter.namespace); + assert.equal("application/json", adapter.headers.Accept); + assert.equal("ws/v1/node", adapter.namespace); +}); + +test('urlForQueryRecord test', function(assert) { + let adapter = this.subject(); + let host = adapter.host; + assert.equal(host + "localhost:8042/ws/v1/node/containers/" + + "container_e27_11111111111_0001_01_000001", + adapter.urlForQueryRecord( + {nodeHttpAddr: "localhost:8042", + containerId: "container_e27_11111111111_0001_01_000001"})); +}); + +test('urlForQuery test', function(assert) { + let adapter = this.subject(); + let host = adapter.host; + assert.equal(host + "localhost:8042/ws/v1/node/containers", + adapter.urlForQuery({nodeHttpAddr: "localhost:8042"})); +}); + +test('query test', function(assert) { + let adapter = this.subject(), + testModel = { modelName: "testModel" }, + testStore = {}, + testQuery = {nodeHttpAddr: "localhost:8042"}; + let host = adapter.host; + assert.expect(3); + + adapter.ajax = function (url, method, hash) { + assert.equal(host + "localhost:8042/ws/v1/node/containers", url); + assert.equal('GET', method); + assert.equal(null, hash.data); + }; + + adapter.query(testStore, testModel, testQuery); +}); + +test('queryRecord test', function(assert) { + let adapter = this.subject(), + testModel = { modelName: "testModel" }, + testStore = {}, + testQuery = { + nodeHttpAddr: "localhost:8042", + containerId: "container_e27_11111111111_0001_01_000001" + }; + let host = adapter.host; + assert.expect(3); + + adapter.ajax = function (url, method, hash) { + assert.equal(host + "localhost:8042/ws/v1/node/containers/" + + "container_e27_11111111111_0001_01_000001", url); + assert.equal('GET', method); + assert.equal(null, hash.data); + }; + + adapter.queryRecord(testStore, testModel, testQuery); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/adapters/yarn-node-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/adapters/yarn-node-test.js new file mode 100644 index 0000000..15aefef --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/adapters/yarn-node-test.js @@ -0,0 +1,42 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('adapter:yarn-node', 'Unit | Adapter | Node', { +}); + +test('Basic creation', function(assert) { + let adapter = this.subject(); + + assert.ok(adapter); + assert.ok(adapter.urlForFindRecord); + assert.ok(adapter.ajax); + assert.ok(adapter.headers); + assert.ok(adapter.host); + assert.ok(adapter.namespace); + assert.equal(adapter.headers.Accept, "application/json"); + assert.equal(adapter.namespace, "ws/v1/node"); +}); + +test('urlForFindRecord test', function(assert) { + let adapter = this.subject(); + let host = adapter.host; + assert.equal(adapter.urlForFindRecord("localhost:8042"), + host + "localhost:8042/ws/v1/node"); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/adapters/yarn-rm-node-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/adapters/yarn-rm-node-test.js new file mode 100644 index 0000000..bf009d4 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/adapters/yarn-rm-node-test.js @@ -0,0 +1,44 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('adapter:yarn-rm-node', 'Unit | Adapter | RMNode', { + // Specify the other units that are required for this test. + // needs: ['serializer:foo'] +}); + +test('Basic creation', function(assert) { + let adapter = this.subject(); + + assert.ok(adapter); + assert.ok(adapter.urlForFindRecord); + assert.ok(adapter.ajax); + assert.ok(adapter.headers); + assert.ok(adapter.host); + assert.ok(adapter.namespace); + assert.equal(adapter.headers.Accept, "application/json"); + assert.equal(adapter.namespace, "ws/v1/cluster"); +}); + +test('urlForFindRecord test', function(assert) { + let adapter = this.subject(); + let host = adapter.host; + assert.equal(adapter.urlForFindRecord("localhost:8042"), + host + "/ws/v1/cluster/nodes/localhost:8042"); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-app-attempt-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-app-attempt-test.js new file mode 100644 index 0000000..0d6c16c --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-app-attempt-test.js @@ -0,0 +1,30 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:yarn-app-attempt', 'Unit | Controller | yarn app attempt', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + let controller = this.subject(); + assert.ok(controller); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-app-attempts-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-app-attempts-test.js new file mode 100644 index 0000000..3894db2 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-app-attempts-test.js @@ -0,0 +1,30 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:yarn-app-attempts', 'Unit | Controller | yarn app attempts', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + let controller = this.subject(); + assert.ok(controller); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-app-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-app-test.js new file mode 100644 index 0000000..1cc95c5 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-app-test.js @@ -0,0 +1,30 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:yarn-app', 'Unit | Controller | yarn app', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + let controller = this.subject(); + assert.ok(controller); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-apps-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-apps-test.js new file mode 100644 index 0000000..baa67cc --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-apps-test.js @@ -0,0 +1,30 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:yarn-apps', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + var controller = this.subject(); + assert.ok(controller); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-container-log-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-container-log-test.js new file mode 100644 index 0000000..0f8dc03 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-container-log-test.js @@ -0,0 +1,30 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:yarn-container-log', 'Unit | Controller | yarn container log', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + let controller = this.subject(); + assert.ok(controller); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-node-app-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-node-app-test.js new file mode 100644 index 0000000..852efef --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-node-app-test.js @@ -0,0 +1,30 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:yarn-node-app', 'Unit | Controller | yarn node app', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + let controller = this.subject(); + assert.ok(controller); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-node-apps-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-node-apps-test.js new file mode 100644 index 0000000..40c5d44 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-node-apps-test.js @@ -0,0 +1,30 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:yarn-node-apps', 'Unit | Controller | yarn node apps', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + let controller = this.subject(); + assert.ok(controller); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-node-containers-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-node-containers-test.js new file mode 100644 index 0000000..929adcd --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-node-containers-test.js @@ -0,0 +1,30 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:yarn-node-containers', 'Unit | Controller | yarn node containers', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + let controller = this.subject(); + assert.ok(controller); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-node-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-node-test.js new file mode 100644 index 0000000..59f443f --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-node-test.js @@ -0,0 +1,30 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:yarn-node', 'Unit | Controller | yarn node', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + let controller = this.subject(); + assert.ok(controller); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-nodes-heatmap-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-nodes-heatmap-test.js new file mode 100644 index 0000000..4833302 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-nodes-heatmap-test.js @@ -0,0 +1,30 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:yarn-nodes-heatmap', 'Unit | Controller | yarn nodes heatmap', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + let controller = this.subject(); + assert.ok(controller); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-nodes-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-nodes-test.js new file mode 100644 index 0000000..ccd0bff --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-nodes-test.js @@ -0,0 +1,30 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:yarn-nodes', 'Unit | Controller | yarn nodes', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + let controller = this.subject(); + assert.ok(controller); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-queue-apps-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-queue-apps-test.js new file mode 100644 index 0000000..adf2e07 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-queue-apps-test.js @@ -0,0 +1,30 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:yarn-queue-apps', 'Unit | Controller | yarn queue apps', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + let controller = this.subject(); + assert.ok(controller); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-queues-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-queues-test.js new file mode 100644 index 0000000..0978208 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-queues-test.js @@ -0,0 +1,30 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:yarn-queues', 'Unit | Controller | yarn queues', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + let controller = this.subject(); + assert.ok(controller); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-services-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-services-test.js new file mode 100644 index 0000000..53834e2 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-services-test.js @@ -0,0 +1,30 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:yarn-services', 'Unit | Controller | yarn services', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + let controller = this.subject(); + assert.ok(controller); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/helpers/node-name-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/helpers/node-name-test.js new file mode 100644 index 0000000..8ff5eb6 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/helpers/node-name-test.js @@ -0,0 +1,28 @@ +/** + * 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. + */ + +import { nodeName } from '../../../helpers/node-name'; +import { module, test } from 'qunit'; + +module('Unit | Helper | node name'); + +// Replace this with your real tests. +test('it works', function(assert) { + let result = nodeName(42); + assert.ok(result); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/initializers/env-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/initializers/env-test.js new file mode 100644 index 0000000..d6dacfd --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/initializers/env-test.js @@ -0,0 +1,41 @@ +/** + * 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. + */ + +import Ember from 'ember'; +import { initialize } from '../../../initializers/env'; +import { module, test } from 'qunit'; + +var registry, application; + +module('Unit | Initializer | env', { + beforeEach: function() { + Ember.run(function() { + application = Ember.Application.create(); + registry = application.registry; + application.deferReadiness(); + }); + } +}); + +// Replace this with your real tests. +test('it works', function(assert) { + initialize(registry, application); + + // you would normally confirm the results of the initializer here + assert.ok(true); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/initializers/hosts-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/initializers/hosts-test.js new file mode 100644 index 0000000..b9a6b27 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/initializers/hosts-test.js @@ -0,0 +1,41 @@ +/** + * 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. + */ + +import Ember from 'ember'; +import { initialize } from '../../../initializers/hosts'; +import { module, test } from 'qunit'; + +var registry, application; + +module('Unit | Initializer | hosts', { + beforeEach: function() { + Ember.run(function() { + application = Ember.Application.create(); + registry = application.registry; + application.deferReadiness(); + }); + } +}); + +// Replace this with your real tests. +test('it works', function(assert) { + initialize(registry, application); + + // you would normally confirm the results of the initializer here + assert.ok(true); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/initializers/jquery-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/initializers/jquery-test.js new file mode 100644 index 0000000..c7a9803 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/initializers/jquery-test.js @@ -0,0 +1,41 @@ +/** + * 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. + */ + +import Ember from 'ember'; +import { initialize } from '../../../initializers/jquery'; +import { module, test } from 'qunit'; + +var registry, application; + +module('Unit | Initializer | jquery', { + beforeEach: function() { + Ember.run(function() { + application = Ember.Application.create(); + registry = application.registry; + application.deferReadiness(); + }); + } +}); + +// Replace this with your real tests. +test('it works', function(assert) { + initialize(registry, application); + + // you would normally confirm the results of the initializer here + assert.ok(true); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/initializers/loader-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/initializers/loader-test.js new file mode 100644 index 0000000..cc32e92 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/initializers/loader-test.js @@ -0,0 +1,40 @@ +/** + * 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. + */ + +import Ember from 'ember'; +import LoaderInitializer from '../../../initializers/loader'; +import { module, test } from 'qunit'; + +let application; + +module('Unit | Initializer | loader', { + beforeEach() { + Ember.run(function() { + application = Ember.Application.create(); + application.deferReadiness(); + }); + } +}); + +// Replace this with your real tests. +test('it works', function(assert) { + LoaderInitializer.initialize(application); + + // you would normally confirm the results of the initializer here + assert.ok(true); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/mixins/charts-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/mixins/charts-test.js new file mode 100644 index 0000000..1f5ab99 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/mixins/charts-test.js @@ -0,0 +1,30 @@ +/** + * 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. + */ + +import Ember from 'ember'; +import ChartsMixin from '../../../mixins/charts'; +import { module, test } from 'qunit'; + +module('Unit | Mixin | charts'); + +// Replace this with your real tests. +test('it works', function(assert) { + var ChartsObject = Ember.Object.extend(ChartsMixin); + var subject = ChartsObject.create(); + assert.ok(subject); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-app-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-app-test.js new file mode 100644 index 0000000..8b6df23 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-app-test.js @@ -0,0 +1,30 @@ +/** + * 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. + */ + +import { moduleForModel, test } from 'ember-qunit'; + +moduleForModel('yarn-app', 'Unit | Model | yarn app', { + // Specify the other units that are required for this test. + needs: [] +}); + +test('it exists', function(assert) { + var model = this.subject(); + // var store = this.store(); + assert.ok(!!model); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-container-log-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-container-log-test.js new file mode 100644 index 0000000..45808a5 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-container-log-test.js @@ -0,0 +1,48 @@ +/** + * 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. + */ + +import { moduleForModel, test } from 'ember-qunit'; + +moduleForModel('yarn-container-log', 'Unit | Model | ContainerLog', { + // Specify the other units that are required for this test. + needs: [] +}); + +test('Basic creation test', function(assert) { + let model = this.subject(); + assert.ok(model); + assert.ok(model._notifyProperties); + assert.ok(model.didLoad); + assert.ok(model.logs); + assert.ok(model.containerID); + assert.ok(model.logFileName); +}); + +test('test fields', function(assert) { + let model = this.subject(); + + Ember.run(function () { + model.set("logs", "This is syslog"); + model.set("containerID", "container_e32_1456000363780_0002_01_000001"); + model.set("logFileName", "syslog"); + assert.equal(model.get("logs"), "This is syslog"); + assert.equal(model.get("containerID"), "container_e32_1456000363780_0002_01_000001"); + assert.equal(model.get("logFileName"), "syslog"); + }); +}); + diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-node-app-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-node-app-test.js new file mode 100644 index 0000000..7e2e62f --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-node-app-test.js @@ -0,0 +1,65 @@ +/** + * 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. + */ + +import { moduleForModel, test } from 'ember-qunit'; + +moduleForModel('yarn-node-app', 'Unit | Model | NodeApp', { + // Specify the other units that are required for this test. + needs: [] +}); + +test('Basic creation test', function(assert) { + let model = this.subject(); + + assert.ok(model); + assert.ok(model._notifyProperties); + assert.ok(model.didLoad); + assert.ok(model.appId); + assert.ok(model.state); + assert.ok(model.user); + assert.ok(model.containers); +}); + +test('test fields', function(assert) { + let model = this.subject(); + + assert.expect(9); + Ember.run(function () { + model.set("appId", "application_1456251210105_0002"); + model.set("id", "application_1456251210105_0002"); + model.set("state", "RUNNING"); + model.set("user", "hadoop"); + model.set("containers", ["container_e38_1456251210105_0002_01_000001", + "container_e38_1456251210105_0002_01_000002"]); + assert.equal(model.get("appId"), "application_1456251210105_0002"); + assert.equal(model.get("state"), "RUNNING"); + assert.equal(model.get("user"), "hadoop"); + assert.deepEqual(model.get("containers"), + ["container_e38_1456251210105_0002_01_000001", + "container_e38_1456251210105_0002_01_000002"]); + assert.equal(model.get("appStateStyle"), "label label-primary"); + assert.equal(model.get("isDummyApp"), false); + model.set("id", "dummy"); + assert.equal(model.get("isDummyApp"), true); + model.set("state", "FINISHED"); + assert.equal(model.get("appStateStyle"), "label label-success"); + model.set("state", "NEW"); + assert.equal(model.get("appStateStyle"), "label label-default"); + }); +}); + diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-node-container-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-node-container-test.js new file mode 100644 index 0000000..88bf233 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-node-container-test.js @@ -0,0 +1,78 @@ +/** + * 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. + */ + +import { moduleForModel, test } from 'ember-qunit'; + +moduleForModel('yarn-node-container', 'Unit | Model | NodeContainer', { + // Specify the other units that are required for this test. + needs: [] +}); + +test('Basic creation test', function(assert) { + let model = this.subject(); + + assert.ok(model); + assert.ok(model._notifyProperties); + assert.ok(model.didLoad); + assert.ok(model.containerId); + assert.ok(model.state); + assert.ok(model.user); + assert.ok(model.exitCode); + assert.ok(model.totalMemoryNeeded); + assert.ok(model.totalVCoresNeeded); + assert.ok(model.containerLogFiles); + assert.ok(model.isDummyContainer); + assert.ok(model.containerStateStyle); +}); + +test('test fields', function(assert) { + let model = this.subject(); + + Ember.run(function () { + model.set("containerId", "container_e32_1456000363780_0002_01_000003"); + model.set("state", "RUNNING"); + model.set("exitCode", "-1000"); + model.set("user", "hadoop"); + model.set("id", "container_e32_1456000363780_0002_01_000003"); + model.set("totalMemoryNeeded", 1024); + model.set("totalVCoresNeeded", 1); + model.set("containerLogFiles", ["syslog", "stderr", "stdout"]); + assert.equal(model.get("containerId"), "container_e32_1456000363780_0002_01_000003"); + assert.equal(model.get("id"), "container_e32_1456000363780_0002_01_000003"); + assert.equal(model.get("totalMemoryNeeded"), 1024); + assert.equal(model.get("totalVCoresNeeded"), 1); + assert.equal(model.get("user"), "hadoop"); + assert.equal(model.get("exitCode"), "-1000"); + assert.equal(model.get("containerLogFiles").length, 3); + assert.deepEqual(model.get("containerLogFiles"), ["syslog", "stderr", "stdout"]); + assert.equal(model.get("isDummyContainer"), false); + assert.equal(model.get("containerStateStyle"), "label label-primary"); + model.set("id", "dummy"); + assert.equal(model.get("isDummyContainer"), true); + model.set("state", "EXITED_WITH_SUCCESS"); + assert.equal(model.get("containerStateStyle"), "label label-success"); + model.set("state", "EXITED_WITH_FAILURE"); + assert.equal(model.get("containerStateStyle"), "label label-danger"); + model.set("state", "DONE"); + model.set("exitCode", "0"); + assert.equal(model.get("containerStateStyle"), "label label-success"); + model.set("exitCode", "-105"); + assert.equal(model.get("containerStateStyle"), "label label-danger"); + }); +}); + diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-node-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-node-test.js new file mode 100644 index 0000000..5877589 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-node-test.js @@ -0,0 +1,58 @@ +/** + * 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. + */ + +import { moduleForModel, test } from 'ember-qunit'; + +moduleForModel('yarn-node', 'Unit | Model | Node', { + // Specify the other units that are required for this test. + needs: [] +}); + +test('Basic creation test', function(assert) { + let model = this.subject(); + + assert.ok(model); + assert.ok(model._notifyProperties); + assert.ok(model.didLoad); + assert.ok(model.totalVmemAllocatedContainersMB); + assert.ok(model.vmemCheckEnabled); + assert.ok(model.pmemCheckEnabled); + assert.ok(model.nodeHealthy); + assert.ok(model.lastNodeUpdateTime); + assert.ok(model.healthReport); + assert.ok(model.nmStartupTime); + assert.ok(model.nodeManagerBuildVersion); + assert.ok(model.hadoopBuildVersion); +}); + +test('test fields', function(assert) { + let model = this.subject(); + + assert.expect(4); + Ember.run(function () { + model.set("totalVmemAllocatedContainersMB", 4096); + model.set("totalPmemAllocatedContainersMB", 2048); + model.set("totalVCoresAllocatedContainers", 4); + model.set("hadoopBuildVersion", "3.0.0-SNAPSHOT"); + assert.equal(model.get("totalVmemAllocatedContainersMB"), 4096); + assert.equal(model.get("totalPmemAllocatedContainersMB"), 2048); + assert.equal(model.get("totalVCoresAllocatedContainers"), 4); + assert.equal(model.get("hadoopBuildVersion"), "3.0.0-SNAPSHOT"); + }); +}); + diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-rm-node-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-rm-node-test.js new file mode 100644 index 0000000..4fd2517 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-rm-node-test.js @@ -0,0 +1,95 @@ +/** + * 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. + */ + +import { moduleForModel, test } from 'ember-qunit'; + +moduleForModel('yarn-rm-node', 'Unit | Model | RMNode', { + // Specify the other units that are required for this test. + needs: [] +}); + +test('Basic creation test', function(assert) { + let model = this.subject(); + + assert.ok(model); + assert.ok(model._notifyProperties); + assert.ok(model.didLoad); + assert.ok(model.rack); + assert.ok(model.state); + assert.ok(model.nodeHostName); + assert.ok(model.nodeHTTPAddress); + assert.ok(model.lastHealthUpdate); + assert.ok(model.healthReport); + assert.ok(model.numContainers); + assert.ok(model.usedMemoryMB); + assert.ok(model.availMemoryMB); + assert.ok(model.usedVirtualCores); + assert.ok(model.availableVirtualCores); + assert.ok(model.version); + assert.ok(model.nodeLabels); + assert.ok(model.nodeLabelsAsString); + assert.ok(model.nodeStateStyle); + assert.ok(model.isDummyNode); + assert.ok(model.getMemoryDataForDonutChart); + assert.ok(model.getVCoreDataForDonutChart); +}); + +test('test fields', function(assert) { + let model = this.subject(); + + Ember.run(function () { + model.set("rack", "/default-rack"); + model.set("state", "RUNNING"); + model.set("nodeHostName", "localhost"); + model.set("id", "localhost:64318"); + model.set("nodeHTTPAddress", "localhost:8042"); + model.set("usedMemoryMB", 1024); + model.set("availMemoryMB", 7168); + model.set("usedVirtualCores", 1); + model.set("availableVirtualCores", 7); + model.set("nodeLabels", ["x"]); + assert.equal(model.get("rack"), "/default-rack"); + assert.equal(model.get("state"), "RUNNING"); + assert.equal(model.get("nodeHostName"), "localhost"); + assert.equal(model.get("id"), "localhost:64318"); + assert.equal(model.get("nodeHTTPAddress"), "localhost:8042"); + assert.equal(model.get("usedMemoryMB"), 1024); + assert.equal(model.get("availMemoryMB"), 7168); + assert.equal(model.get("usedVirtualCores"), 1); + assert.equal(model.get("availableVirtualCores"), 7); + assert.equal(model.get("isDummyNode"), false); + assert.deepEqual(model.get("nodeLabels"), ["x"]); + assert.equal(model.get("nodeLabelsAsString"), "x"); + assert.deepEqual(model.get("nodeStateStyle"), "label label-success"); + assert.deepEqual(model.get("getMemoryDataForDonutChart"), + [{label: "Used", value: 1024}, {label: "Available", value: 7168}]); + assert.deepEqual(model.get("getVCoreDataForDonutChart"), + [{label: "Used", value: 1}, {label: "Available", value: 7}]); + model.set("state", "SHUTDOWN"); + assert.deepEqual(model.get("nodeStateStyle"), "label label-danger"); + model.set("state", "REBOOTED"); + assert.deepEqual(model.get("nodeStateStyle"), "label label-warning"); + model.set("state", "NEW"); + assert.deepEqual(model.get("nodeStateStyle"), "label label-default"); + model.set("nodeLabels", ["x","y"]); + assert.equal(model.get("nodeLabelsAsString"), "x"); + model.set("nodeLabels", undefined); + assert.equal(model.get("nodeLabelsAsString"), ""); + }); +}); + diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-app-attempts-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-app-attempts-test.js new file mode 100644 index 0000000..917a159 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-app-attempts-test.js @@ -0,0 +1,29 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('route:yarn-app-attempts', 'Unit | Route | yarn app attempts', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('it exists', function(assert) { + let route = this.subject(); + assert.ok(route); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-apps-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-apps-test.js new file mode 100644 index 0000000..3a69c9f --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-apps-test.js @@ -0,0 +1,29 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('route:yarn-apps', 'Unit | Route | yarn apps', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('it exists', function(assert) { + var route = this.subject(); + assert.ok(route); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-container-log-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-container-log-test.js new file mode 100644 index 0000000..4e68da0 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-container-log-test.js @@ -0,0 +1,120 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; +import Constants from 'yarn-ui/constants'; + +moduleFor('route:yarn-container-log', 'Unit | Route | ContainerLog', { +}); + +test('Basic creation test', function(assert) { + let route = this.subject(); + assert.ok(route); + assert.ok(route.model); +}); + +test('Test getting container log', function(assert) { + var response = { + logs: "This is syslog", + containerID: "container_e32_1456000363780_0002_01_000001", + logFileName: "syslog"}; + var store = { + findRecord: function(type) { + return new Ember.RSVP.Promise(function(resolve) { + resolve(response); + } + )} + }; + assert.expect(6); + var route = this.subject(); + route.set('store', store); + var model = route.model({node_id: "localhost:64318", + node_addr: "localhost:8042", + container_id: "container_e32_1456000363780_0002_01_000001", + filename: "syslog"}); + model.then(function(value) { + assert.ok(value); + assert.ok(value.containerLog); + assert.deepEqual(value.containerLog, response); + assert.ok(value.nodeInfo); + assert.equal(value.nodeInfo.addr, 'localhost:8042'); + assert.equal(value.nodeInfo.id, 'localhost:64318'); + }); +}); + +/** + * This can happen when an empty response is sent from server + */ +test('Test non HTTP error while getting container log', function(assert) { + var error = {}; + var response = { + logs: "", + containerID: "container_e32_1456000363780_0002_01_000001", + logFileName: "syslog"}; + var store = { + findRecord: function(type) { + return new Ember.RSVP.Promise(function(resolve, reject) { + reject(error); + } + )} + }; + assert.expect(6); + var route = this.subject(); + route.set('store', store); + var model = route.model({node_id: "localhost:64318", + node_addr: "localhost:8042", + container_id: "container_e32_1456000363780_0002_01_000001", + filename: "syslog"}); + model.then(function(value) { + assert.ok(value); + assert.ok(value.containerLog); + assert.deepEqual(value.containerLog, response); + assert.ok(value.nodeInfo); + assert.equal(value.nodeInfo.addr, 'localhost:8042'); + assert.equal(value.nodeInfo.id, 'localhost:64318'); + }); +}); + +test('Test HTTP error while getting container log', function(assert) { + var error = {errors: [{status: 404, responseText: 'Not Found'}]}; + var response = { + logs: "", + containerID: "container_e32_1456000363780_0002_01_000001", + logFileName: "syslog"}; + var store = { + findRecord: function(type) { + return new Ember.RSVP.Promise(function(resolve, reject) { + reject(error); + } + )} + }; + assert.expect(5); + var route = this.subject(); + route.set('store', store); + var model = route.model({node_id: "localhost:64318", + node_addr: "localhost:8042", + container_id: "container_e32_1456000363780_0002_01_000001", + filename: "syslog"}); + model.then(function(value) { + assert.ok(value); + assert.ok(value.errors); + assert.equal(value.errors.length, 1); + assert.equal(value.errors[0].status, 404); + assert.equal(value.errors[0].responseText, 'Not Found'); + }); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-node-app-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-node-app-test.js new file mode 100644 index 0000000..8e5acf9 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-node-app-test.js @@ -0,0 +1,56 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('route:yarn-node-app', 'Unit | Route | NodeApp', { +}); + +test('Basic creation test', function(assert) { + let route = this.subject(); + assert.ok(route); + assert.ok(route.model); +}); + +test('Test getting specific app on a node', function(assert) { + var response = + {id:"application_1456251210105_0001", state:"FINISHED", user:"root"}; + var store = { + queryRecord: function(type, query) { + return new Ember.RSVP.Promise(function(resolve) { + resolve(response); + }); + } + }; + assert.expect(6); + var route = this.subject(); + route.set('store', store); + var model = + route.model({node_id:"localhost:64318", node_addr:"localhost:8042", + app_id:"application_1456251210105_0001"}). + then( + function(value){ + assert.ok(value); + assert.ok(value.nodeApp); + assert.deepEqual(value.nodeApp, response); + assert.ok(value.nodeInfo); + assert.equal(value.nodeInfo.addr, 'localhost:8042'); + assert.equal(value.nodeInfo.id, 'localhost:64318'); + } + ); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-node-apps-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-node-apps-test.js new file mode 100644 index 0000000..44d9995 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-node-apps-test.js @@ -0,0 +1,60 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('route:yarn-node-apps', 'Unit | Route | NodeApps', { +}); + +test('Basic creation test', function(assert) { + let route = this.subject(); + assert.ok(route); + assert.ok(route.model); +}); + +test('Test getting apps on a node', function(assert) { + var response = [ + {id:"application_1456251210105_0001", state:"FINISHED", user:"root"}, + {id:"application_1456251210105_0002", state:"RUNNING",user:"root", + containerids:["container_e38_1456251210105_0002_01_000001", + "container_e38_1456251210105_0002_01_000002"]}]; + var store = { + query: function(type, query) { + return new Ember.RSVP.Promise(function(resolve) { + resolve(response.slice()); + }); + } + }; + assert.expect(8); + var route = this.subject(); + route.set('store', store); + var model = + route.model({node_id:"localhost:64318", node_addr:"localhost:8042"}). + then( + function(value){ + assert.ok(value); + assert.ok(value.apps); + assert.equal(value.apps.length, 2); + assert.deepEqual(response[0], value.apps[0]); + assert.deepEqual(response[1], value.apps[1]); + assert.ok(value.nodeInfo); + assert.equal(value.nodeInfo.addr, 'localhost:8042'); + assert.equal(value.nodeInfo.id, 'localhost:64318'); + } + ); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-node-container-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-node-container-test.js new file mode 100644 index 0000000..f0b68fc --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-node-container-test.js @@ -0,0 +1,61 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('route:yarn-node-container', 'Unit | Route | NodeContainer', { +}); + +test('Basic creation test', function(assert) { + let route = this.subject(); + assert.ok(route); + assert.ok(route.model); +}); + +test('Test getting specific container on a node', function(assert) { + var response = + {id: "container_e32_1456000363780_0002_01_000001", state: "RUNNING", + exitCode:-1000,diagnostics:"",user:"root",totalMemoryNeededMB:2048, + totalVCoresNeeded:1,containerLogsLink: "http://localhost:8042/node/" + + "containerlogs/container_e32_1456000363780_0002_01_000001/root", + nodeId: "localhost:64318", containerLogFiles:["syslog","stderr", + "stdout"]}; + var store = { + queryRecord: function(type, query) { + return new Ember.RSVP.Promise(function(resolve) { + resolve(response); + }); + } + }; + assert.expect(6); + var route = this.subject(); + route.set('store', store); + var model = + route.model({node_id:"localhost:64318", node_addr:"localhost:8042", + container_id:"container_e32_1456000363780_0002_01_000001"}). + then( + function(value){ + assert.ok(value); + assert.ok(value.nodeContainer); + assert.deepEqual(value.nodeContainer, response); + assert.ok(value.nodeInfo); + assert.equal(value.nodeInfo.addr, 'localhost:8042'); + assert.equal(value.nodeInfo.id, 'localhost:64318'); + } + ); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-node-containers-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-node-containers-test.js new file mode 100644 index 0000000..8359713 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-node-containers-test.js @@ -0,0 +1,68 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('route:yarn-node-containers', 'Unit | Route | NodeContainers', { +}); + +test('Basic creation test', function(assert) { + let route = this.subject(); + assert.ok(route); + assert.ok(route.model); +}); + +test('Test getting apps on a node', function(assert) { + var response = + [{id: "container_e32_1456000363780_0002_01_000001", state: "RUNNING", + exitCode:-1000,diagnostics:"",user:"root",totalMemoryNeededMB:2048, + totalVCoresNeeded:1,containerLogsLink: "http://localhost:8042/node/" + + "containerlogs/container_e32_1456000363780_0002_01_000001/root", + nodeId: "localhost:64318", containerLogFiles:["syslog","stderr", + "stdout"]}, + {id:"container_e32_1456000363780_0002_01_000003", state:"RUNNING", + exitCode:-1000, diagnostics:"", user:"root", totalMemoryNeededMB:1024, + totalVCoresNeeded:1,containerLogsLink:"http://localhost:8042/node" + + "/containerlogs/container_e32_1456000363780_0002_01_000003/root", + nodeId:"localhost:64318",containerLogFiles:["syslog","stderr", + "syslog.shuffle","stdout"]}]; + var store = { + query: function(type, query) { + return new Ember.RSVP.Promise(function(resolve) { + resolve(response.slice()); + }); + } + }; + assert.expect(8); + var route = this.subject(); + route.set('store', store); + var model = + route.model({node_id:"localhost:64318", node_addr:"localhost:8042"}). + then( + function(value){ + assert.ok(value); + assert.ok(value.containers); + assert.equal(value.containers.length, 2); + assert.deepEqual(value.containers[0], response[0]); + assert.deepEqual(value.containers[1], response[1]); + assert.ok(value.nodeInfo); + assert.equal(value.nodeInfo.addr, 'localhost:8042'); + assert.equal(value.nodeInfo.id, 'localhost:64318'); + } + ); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-node-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-node-test.js new file mode 100644 index 0000000..4e82f1b --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-node-test.js @@ -0,0 +1,84 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; +import Ember from 'ember'; + +moduleFor('route:yarn-node', 'Unit | Route | Node', { +}); + +test('Basic creation test', function(assert) { + let route = this.subject(); + assert.ok(route); + assert.ok(route.model); +}); + +test('Test getting a node', function(assert) { + var nodeResponse = + {healthReport: "Healthy", totalVmemAllocatedContainersMB: 344064, + totalPmemAllocatedContainersMB: 163840, + totalVCoresAllocatedContainers: 160, + vmemCheckEnabled: true, pmemCheckEnabled: true, + lastNodeUpdateTime: 1456250210310, nodeHealthy: true, + nodeManagerVersion: "3.0.0-SNAPSHOT", + nodeManagerBuildVersion: "3.0.0-SNAPSHOT", + nodeManagerVersionBuiltOn: "2000-01-01T00:00Z", + hadoopVersion: "3.0.0-SNAPSHOT", + hadoopBuildVersion: "3.0.0-SNAPSHOT", + hadoopVersionBuiltOn: "2000-01-01T00:00Z", + id: "localhost:64318", nodeHostName: "192.168.0.102", + nmStartupTime: 1456250208231}; + var rmNodeResponse = + {rack: "/default-rack", state: "RUNNING", id: "localhost:64318", + nodeHostName: "localhost", nodeHTTPAddress: "localhost:8042", + lastHealthUpdate: 1456251290905, version: "3.0.0-SNAPSHOT", + healthReport: "", numContainers: 0, usedMemoryMB: 0, + availMemoryMB: 163840, usedVirtualCores: 0, + availableVirtualCores: 160, + resourceUtilization: { + nodePhysicalMemoryMB: 4549, nodeVirtualMemoryMB: 4549, + nodeCPUUsage: 0.14995001256465912, + aggregatedContainersPhysicalMemoryMB: 0, + aggregatedContainersVirtualMemoryMB: 0, + containersCPUUsage: 0 + }}; + + // Create store which returns appropriate responses. + var store = { + findRecord: function(type) { + if (type == 'yarnNode') { + return new Ember.RSVP.Promise(function(resolve) { + resolve(nodeResponse); + }); + } else if (type == 'yarnRmNode') { + return new Ember.RSVP.Promise(function(resolve) { + resolve(rmNodeResponse); + }); + } + } + }; + var route = this.subject(); + assert.expect(4); + route.set('store', store); + var model = route.model( + {node_addr:"localhost:8042", node_id:"localhost:64318"})._result; + assert.ok(model.node); + assert.deepEqual(model.node, nodeResponse); + assert.ok(model.rmNode); + assert.deepEqual(model.rmNode, rmNodeResponse); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-nodes-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-nodes-test.js new file mode 100644 index 0000000..baa5bd6 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-nodes-test.js @@ -0,0 +1,74 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; +import Ember from 'ember'; + +moduleFor('route:yarn-nodes', 'Unit | Route | Nodes', { +}); + +test('Basic creation test', function(assert) { + let route = this.subject(); + assert.ok(route); + assert.ok(route.model); +}); + +test('Test getting nodes', function(assert) { + var response = [{ + rack: "/default-rack", state: "RUNNING", id: "192.168.1.1:64318", + nodeHostName: "192.168.1.1", nodeHTTPAddress: "192.168.1.1:8042", + lastHealthUpdate: 1456251290905, version: "3.0.0-SNAPSHOT", + healthReport: "", numContainers: 0, usedMemoryMB: 0, + availMemoryMB: 163840, usedVirtualCores: 0, + availableVirtualCores: 160, + resourceUtilization: { + nodePhysicalMemoryMB: 4549, nodeVirtualMemoryMB: 4549, + nodeCPUUsage: 0.14995001256465912, + aggregatedContainersPhysicalMemoryMB: 0, + aggregatedContainersVirtualMemoryMB: 0, + containersCPUUsage: 0 + }}, + {rack: "/default-rack", state: "RUNNING", id: "192.168.1.2:64318", + nodeHostName: "192.168.1.2", nodeHTTPAddress: "192.168.1.2:8042", + lastHealthUpdate: 1456251290905, version: "3.0.0-SNAPSHOT", + healthReport: "", numContainers: 0, usedMemoryMB: 0, + availMemoryMB: 163840, usedVirtualCores: 0, + availableVirtualCores: 160, + resourceUtilization: { + nodePhysicalMemoryMB: 4549, nodeVirtualMemoryMB: 4549, + nodeCPUUsage: 0.14995001256465912, + aggregatedContainersPhysicalMemoryMB: 0, + aggregatedContainersVirtualMemoryMB: 0, + containersCPUUsage: 0 + }}]; + var store = { + findAll: function(type) { + return new Ember.RSVP.Promise(function(resolve) { + resolve(response); + }); + } + }; + var route = this.subject(); + route.set('store', store); + var model = route.model()._result; + assert.expect(4); + assert.ok(model); + assert.equal(model.length, 2); + assert.deepEqual(response[0], model[0]); + assert.deepEqual(response[1], model[1]); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-queue-apps-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-queue-apps-test.js new file mode 100644 index 0000000..6738ea0 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-queue-apps-test.js @@ -0,0 +1,29 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('route:yarn-queue-apps', 'Unit | Route | yarn queue apps', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('it exists', function(assert) { + let route = this.subject(); + assert.ok(route); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-queues-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-queues-test.js new file mode 100644 index 0000000..5153435 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-queues-test.js @@ -0,0 +1,29 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('route:yarn-queues', 'Unit | Route | yarn queues', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('it exists', function(assert) { + let route = this.subject(); + assert.ok(route); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/serializers/yarn-app-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/serializers/yarn-app-test.js new file mode 100644 index 0000000..4158612 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/serializers/yarn-app-test.js @@ -0,0 +1,33 @@ +/** + * 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. + */ + +import { moduleForModel, test } from 'ember-qunit'; + +moduleForModel('yarn-app', 'Unit | Serializer | yarn app', { + // Specify the other units that are required for this test. + needs: ['serializer:yarn-app'] +}); + +// Replace this with your real tests. +test('it serializes records', function(assert) { + var record = this.subject(); + + var serializedRecord = record.serialize(); + + assert.ok(serializedRecord); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/serializers/yarn-container-log-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/serializers/yarn-container-log-test.js new file mode 100644 index 0000000..2349dc2 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/serializers/yarn-container-log-test.js @@ -0,0 +1,49 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('serializer:yarn-container-log', 'Unit | Serializer | ContainerLog', { +}); + +test('Basic creation test', function(assert) { + let serializer = this.subject(); + + assert.ok(serializer); + assert.ok(serializer.normalizeSingleResponse); +}); + +test('normalizeSingleResponse test', function(assert) { + let serializer = this.subject(), + modelClass = { + modelName: "yarn-container-log" + }, + payload = "This is syslog"; + var id = "localhost:64318!container_e32_1456000363780_0002_01_000001!syslog"; + assert.expect(6); + var response = + serializer.normalizeSingleResponse({}, modelClass, payload, id, null); + assert.ok(response.data); + assert.equal(response.data.id, id); + assert.equal(response.data.type, modelClass.modelName); + assert.equal(response.data.attributes.logs, payload); + assert.equal(response.data.attributes.containerID, + "container_e32_1456000363780_0002_01_000001"); + assert.equal(response.data.attributes.logFileName, "syslog"); +}); + diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/serializers/yarn-node-app-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/serializers/yarn-node-app-test.js new file mode 100644 index 0000000..21a715c --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/serializers/yarn-node-app-test.js @@ -0,0 +1,102 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('serializer:yarn-node-app', 'Unit | Serializer | NodeApp', { +}); + +test('Basic creation test', function(assert) { + let serializer = this.subject(); + + assert.ok(serializer); + assert.ok(serializer.normalizeSingleResponse); + assert.ok(serializer.normalizeArrayResponse); + assert.ok(serializer.internalNormalizeSingleResponse); +}); + +test('normalizeArrayResponse test', function(assert) { + let serializer = this.subject(), + modelClass = { + modelName: "yarn-node-app" + }, + payload = { + apps: { + app: [{ + id:"application_1456251210105_0001", state:"FINISHED", user:"root" + },{ + id:"application_1456251210105_0002", state:"RUNNING",user:"root", + containerids:["container_e38_1456251210105_0002_01_000001", + "container_e38_1456251210105_0002_01_000002"] + }] + } + }; + assert.expect(15); + var response = + serializer.normalizeArrayResponse({}, modelClass, payload, null, null); + assert.ok(response.data); + assert.equal(response.data.length, 2); + assert.equal(response.data[0].attributes.containers, undefined); + assert.equal(response.data[1].attributes.containers.length, 2); + assert.deepEqual(response.data[1].attributes.containers, + payload.apps.app[1].containerids); + for (var i = 0; i < 2; i++) { + assert.equal(response.data[i].type, modelClass.modelName); + assert.equal(response.data[i].id, payload.apps.app[i].id); + assert.equal(response.data[i].attributes.appId, payload.apps.app[i].id); + assert.equal(response.data[i].attributes.state, payload.apps.app[i].state); + assert.equal(response.data[i].attributes.user, payload.apps.app[i].user); + } +}); + +test('normalizeArrayResponse no apps test', function(assert) { + let serializer = this.subject(), + modelClass = { + modelName: "yarn-node-app" + }, + payload = { apps: null }; + assert.expect(5); + var response = + serializer.normalizeArrayResponse({}, modelClass, payload, null, null); + assert.ok(response.data); + assert.equal(response.data.length, 1); + assert.equal(response.data[0].type, modelClass.modelName); + assert.equal(response.data[0].id, "dummy"); + assert.equal(response.data[0].attributes.appId, undefined); +}); + +test('normalizeSingleResponse test', function(assert) { + let serializer = this.subject(), + modelClass = { + modelName: "yarn-node-app" + }, + payload = { + app: {id:"application_1456251210105_0001", state:"FINISHED", user:"root"} + }; + assert.expect(7); + var response = + serializer.normalizeSingleResponse({}, modelClass, payload, null, null); + assert.ok(response.data); + assert.equal(payload.app.id, response.data.id); + assert.equal(modelClass.modelName, response.data.type); + assert.equal(payload.app.id, response.data.attributes.appId); + assert.equal(payload.app.state, response.data.attributes.state); + assert.equal(payload.app.user, response.data.attributes.user); + assert.equal(response.data.attributes.containers, undefined); +}); + diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/serializers/yarn-node-container-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/serializers/yarn-node-container-test.js new file mode 100644 index 0000000..1f08467 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/serializers/yarn-node-container-test.js @@ -0,0 +1,128 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('serializer:yarn-node-container', 'Unit | Serializer | NodeContainer', { +}); + +test('Basic creation test', function(assert) { + let serializer = this.subject(); + + assert.ok(serializer); + assert.ok(serializer.normalizeSingleResponse); + assert.ok(serializer.normalizeArrayResponse); + assert.ok(serializer.internalNormalizeSingleResponse); +}); + +test('normalizeArrayResponse test', function(assert) { + let serializer = this.subject(), + modelClass = { + modelName: "yarn-node-container" + }, + payload = { + containers: { + container: [{ + id: "container_e32_1456000363780_0002_01_000001", state: "RUNNING", + exitCode:-1000,diagnostics:"",user:"root",totalMemoryNeededMB:2048, + totalVCoresNeeded:1,containerLogsLink: "http://localhost:8042/node/" + + "containerlogs/container_e32_1456000363780_0002_01_000001/root", + nodeId: "localhost:64318", containerLogFiles:["syslog","stderr", + "stdout"] + },{ + id:"container_e32_1456000363780_0002_01_000003", state:"RUNNING", + exitCode:-1000, diagnostics:"", user:"root", totalMemoryNeededMB:1024, + totalVCoresNeeded:1,containerLogsLink:"http://localhost:8042/node" + + "/containerlogs/container_e32_1456000363780_0002_01_000003/root", + nodeId:"localhost:64318",containerLogFiles:["syslog","stderr", + "syslog.shuffle","stdout"] + }] + } + }; + assert.expect(14); + var response = + serializer.normalizeArrayResponse({}, modelClass, payload, null, null); + assert.ok(response.data); + assert.equal(response.data.length, 2); + assert.equal(response.data[0].id, + "container_e32_1456000363780_0002_01_000001"); + assert.equal(response.data[1].id, + "container_e32_1456000363780_0002_01_000003"); + assert.equal(response.data[0].attributes.containerLogFiles.length, 3); + assert.equal(response.data[1].attributes.containerLogFiles.length, 4); + for (var i = 0; i < 2; i++) { + assert.equal(response.data[i].type, modelClass.modelName); + assert.deepEqual(response.data[i].attributes.containerLogFiles, + payload.containers.container[i].containerLogFiles); + assert.equal(response.data[i].attributes.state, + payload.containers.container[i].state); + assert.equal(response.data[i].attributes.user, + payload.containers.container[i].user); + } +}); + +test('normalizeArrayResponse no containers test', function(assert) { + let serializer = this.subject(), + modelClass = { + modelName: "yarn-node-container" + }, + payload = { containers: null }; + assert.expect(5); + var response = + serializer.normalizeArrayResponse({}, modelClass, payload, null, null); + assert.ok(response.data); + assert.equal(response.data.length, 1); + assert.equal(response.data[0].type, modelClass.modelName); + assert.equal(response.data[0].id, "dummy"); + assert.equal(response.data[0].attributes.containerId, undefined); +}); + +test('normalizeSingleResponse test', function(assert) { + let serializer = this.subject(), + modelClass = { + modelName: "yarn-node-container" + }, + payload = { + container: { + id: "container_e32_1456000363780_0002_01_000001", state: "RUNNING", + exitCode:-1000,diagnostics:"",user:"root",totalMemoryNeededMB:2048, + totalVCoresNeeded:1,containerLogsLink: "http://localhost:8042/node/" + + "containerlogs/container_e32_1456000363780_0002_01_000001/root", + nodeId: "localhost:64318", containerLogFiles:["syslog","stderr", + "stdout"] + } + }; + assert.expect(11); + var response = + serializer.normalizeSingleResponse({}, modelClass, payload, null, null); + assert.ok(response.data); + assert.equal(response.data.id, payload.container.id); + assert.equal(response.data.type, modelClass.modelName); + assert.equal(response.data.attributes.containerId, payload.container.id); + assert.equal(response.data.attributes.state, payload.container.state); + assert.equal(response.data.attributes.user, payload.container.user); + assert.equal(response.data.attributes.exitCode, payload.container.exitCode); + assert.equal(response.data.attributes.totalMemoryNeededMB, + payload.container.totalMemoryNeeded); + assert.equal(response.data.attributes.totalVCoresNeeded, + payload.container.totalVCoresNeeded); + assert.equal(response.data.attributes.containerLogFiles.length, 3); + assert.deepEqual(response.data.attributes.containerLogFiles, + payload.container.containerLogFiles); +}); + diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/serializers/yarn-node-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/serializers/yarn-node-test.js new file mode 100644 index 0000000..0e76ccb --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/serializers/yarn-node-test.js @@ -0,0 +1,69 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; +import Converter from 'yarn-ui/utils/converter'; + +moduleFor('serializer:yarn-node', 'Unit | Serializer | Node', { +}); + +test('Basic creation test', function(assert) { + let serializer = this.subject(); + + assert.ok(serializer); + assert.ok(serializer.normalizeSingleResponse); + assert.ok(serializer.internalNormalizeSingleResponse); +}); + +test('normalizeSingleResponse test', function(assert) { + let serializer = this.subject(), + modelClass = { + modelName: "yarn-node" + }, + payload = { + nodeInfo: { + healthReport: "Healthy", totalVmemAllocatedContainersMB: 344064, + totalPmemAllocatedContainersMB: 163840, + totalVCoresAllocatedContainers: 160, + vmemCheckEnabled: true, pmemCheckEnabled: true, + lastNodeUpdateTime: 1456250210310, nodeHealthy: true, + nodeManagerVersion: "3.0.0-SNAPSHOT", + nodeManagerBuildVersion: "3.0.0-SNAPSHOT", + nodeManagerVersionBuiltOn: "2000-01-01T00:00Z", + hadoopVersion: "3.0.0-SNAPSHOT", + hadoopBuildVersion: "3.0.0-SNAPSHOT", + hadoopVersionBuiltOn: "2000-01-01T00:00Z", + id: "localhost:64318", nodeHostName: "192.168.0.102", + nmStartupTime: 1456250208231 + } + }; + assert.expect(6); + var id = "localhost:64318"; + var response = serializer.normalizeSingleResponse({}, modelClass, payload, id, null); + assert.equal(response.data.id, id); + assert.equal(response.data.type, modelClass.modelName); + assert.equal(response.data.attributes.totalVmemAllocatedContainersMB, + payload.nodeInfo.totalVmemAllocatedContainersMB); + assert.equal(response.data.attributes.totalPmemAllocatedContainersMB, + payload.nodeInfo.totalPmemAllocatedContainersMB); + assert.equal(response.data.attributes.totalVCoresAllocatedContainers, + payload.nodeInfo.totalVCoresAllocatedContainers); + assert.equal(response.data.attributes.nmStartupTime, + Converter.timeStampToDate(payload.nodeInfo.nmStartupTime)); +}); + diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/serializers/yarn-rm-node-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/serializers/yarn-rm-node-test.js new file mode 100644 index 0000000..bc6397d --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/serializers/yarn-rm-node-test.js @@ -0,0 +1,153 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('serializer:yarn-rm-node', 'Unit | Serializer | RMNode', { +}); + +test('Basic creation test', function(assert) { + let serializer = this.subject(); + + assert.ok(serializer); + assert.ok(serializer.normalizeSingleResponse); + assert.ok(serializer.normalizeArrayResponse); + assert.ok(serializer.internalNormalizeSingleResponse); +}); + +test('normalizeArrayResponse test', function(assert) { + let serializer = this.subject(), + modelClass = { + modelName: "yarn-rm-node" + }, + payload = { + nodes: { + node: [{ + rack: "/default-rack", state: "RUNNING", id: "192.168.1.1:64318", + nodeHostName: "192.168.1.1", nodeHTTPAddress: "192.168.1.1:8042", + lastHealthUpdate: 1456251290905, version: "3.0.0-SNAPSHOT", + healthReport: "", numContainers: 0, usedMemoryMB: 2048, + availMemoryMB: 161792, usedVirtualCores: 2, + availableVirtualCores: 158, nodeLabels: ["x"], + resourceUtilization: { + nodePhysicalMemoryMB: 4549, nodeVirtualMemoryMB: 4549, + nodeCPUUsage: 0.14995001256465912, + aggregatedContainersPhysicalMemoryMB: 0, + aggregatedContainersVirtualMemoryMB: 0, + containersCPUUsage: 0 + } + },{ + rack: "/default-rack", state: "RUNNING", id: "192.168.1.2:64318", + nodeHostName: "192.168.1.2", nodeHTTPAddress: "192.168.1.2:8042", + lastHealthUpdate: 1456251290905, version: "3.0.0-SNAPSHOT", + healthReport: "", numContainers: 0, usedMemoryMB: 0, + availMemoryMB: 163840, usedVirtualCores: 0, + availableVirtualCores: 160, nodeLabels: ["y"], + resourceUtilization: { + nodePhysicalMemoryMB: 4549, nodeVirtualMemoryMB: 4549, + nodeCPUUsage: 0.14995001256465912, + aggregatedContainersPhysicalMemoryMB: 0, + aggregatedContainersVirtualMemoryMB: 0, + containersCPUUsage: 0 + } + }] + } + }; + assert.expect(12); + var response = + serializer.normalizeArrayResponse({}, modelClass, payload, null, null); + assert.ok(response.data); + assert.equal(response.data.length, 2); + assert.equal(response.data[0].id, "192.168.1.1:64318"); + assert.equal(response.data[1].id, "192.168.1.2:64318"); + for (var i = 0; i < 2; i++) { + assert.equal(response.data[i].type, modelClass.modelName); + assert.equal(response.data[i].attributes.nodeHostName, + payload.nodes.node[i].nodeHostName); + assert.equal(response.data[i].attributes.nodeHTTPAddress, + payload.nodes.node[i].nodeHTTPAddress); + assert.deepEqual(response.data[i].attributes.nodeLabels, + payload.nodes.node[i].nodeLabels); + } +}); + +test('normalizeArrayResponse no nodes test', function(assert) { + let serializer = this.subject(), + modelClass = { + modelName: "yarn-rm-node" + }, + payload = { nodes: null }; + assert.expect(5); + var response = + serializer.normalizeArrayResponse({}, modelClass, payload, null, null); + console.log(response); + assert.ok(response.data); + assert.equal(response.data.length, 1); + assert.equal(response.data[0].type, modelClass.modelName); + assert.equal(response.data[0].id, "dummy"); + assert.equal(response.data[0].attributes.nodeHostName, undefined); +}); + +test('normalizeSingleResponse test', function(assert) { + let serializer = this.subject(), + modelClass = { + modelName: "yarn-rm-node" + }, + payload = { + node: { + rack: "/default-rack", state: "RUNNING", id: "192.168.1.1:64318", + nodeHostName: "192.168.1.1", nodeHTTPAddress: "192.168.1.1:8042", + lastHealthUpdate: 1456251290905, version: "3.0.0-SNAPSHOT", + healthReport: "", numContainers: 0, usedMemoryMB: 2048, + availMemoryMB: 161792, usedVirtualCores: 2, + availableVirtualCores: 158, nodeLabels: ["x"], + resourceUtilization: { + nodePhysicalMemoryMB: 4549, nodeVirtualMemoryMB: 4549, + nodeCPUUsage: 0.14995001256465912, + aggregatedContainersPhysicalMemoryMB: 0, + aggregatedContainersVirtualMemoryMB: 0, + containersCPUUsage: 0 + } + } + }; + assert.expect(13); + var id = "localhost:64318"; + var response = + serializer.normalizeSingleResponse({}, modelClass, payload, id, null); + assert.ok(response.data); + assert.equal(response.data.id, id); + assert.equal(response.data.type, modelClass.modelName); + assert.equal(response.data.attributes.rack, payload.node.rack); + assert.equal(response.data.attributes.state, payload.node.state); + assert.equal(response.data.attributes.nodeHostName, + payload.node.nodeHostName); + assert.equal(response.data.attributes.nodeHTTPAddress, + payload.node.nodeHTTPAddress); + assert.equal(response.data.attributes.version, payload.node.version); + assert.equal(response.data.attributes.availMemoryMB, + payload.node.availMemoryMB); + assert.equal(response.data.attributes.usedMemoryMB, + payload.node.usedMemoryMB); + assert.equal(response.data.attributes.availableVirtualCores, + payload.node.availableVirtualCores); + assert.equal(response.data.attributes.usedVirtualCores, + payload.node.usedVirtualCores); + assert.deepEqual(response.data.attributes.nodeLabels, + payload.node.nodeLabels); +}); + diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/services/env-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/services/env-test.js new file mode 100644 index 0000000..9eb9367 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/services/env-test.js @@ -0,0 +1,30 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('service:env', 'Unit | Service | env', { + // Specify the other units that are required for this test. + // needs: ['service:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + var service = this.subject(); + assert.ok(service); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/services/hosts-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/services/hosts-test.js new file mode 100644 index 0000000..015748a --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/services/hosts-test.js @@ -0,0 +1,30 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('service:hosts', 'Unit | Service | hosts', { + // Specify the other units that are required for this test. + // needs: ['service:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + var service = this.subject(); + assert.ok(service); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/utils/converter-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/utils/converter-test.js new file mode 100644 index 0000000..481537d --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/utils/converter-test.js @@ -0,0 +1,52 @@ +/** + * 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. + */ + +import converter from '../../../utils/converter'; +import { module, test } from 'qunit'; + +module('Unit | Utility | Converter'); + +// Replace this with your real tests. +test('it works', function(assert) { + assert.ok(converter); + assert.ok(converter.splitForContainerLogs); +}); + +test('split for container logs', function(assert) { + var id = "localhost:64318!container_e32_1456000363780_0002_01_000001!" + + "syslog"; + var arr = converter.splitForContainerLogs(id); + assert.ok(arr); + assert.deepEqual(arr, ["localhost:64318", + "container_e32_1456000363780_0002_01_000001", "syslog"]); + id = "localhost:64318!container_e32_1456000363780_0002_01_000001!" + + "syslog!logs"; + arr = converter.splitForContainerLogs(id); + assert.ok(arr); + assert.deepEqual(arr, ["localhost:64318", + "container_e32_1456000363780_0002_01_000001", "syslog!logs"]); + id = "localhost:64318!container_e32_1456000363780_0002_01_000001"; + arr = converter.splitForContainerLogs(id); + assert.notOk(arr); + id = null; + arr = converter.splitForContainerLogs(id); + assert.notOk(arr); + id = undefined; + arr = converter.splitForContainerLogs(id); + assert.notOk(arr); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/utils/sorter-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/utils/sorter-test.js new file mode 100644 index 0000000..8f17380 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/utils/sorter-test.js @@ -0,0 +1,26 @@ +/** + * 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. + */ + +import Sorter from 'yarn-ui/utils/sorter'; +import { module, test } from 'qunit'; + +module('Unit | Utility | Sorter'); + +test('Basic creation test', function(assert) { + assert.ok(Sorter); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/pom.xml b/hadoop-yarn-project/hadoop-yarn/pom.xml index a41b928..70b68d7 100644 --- a/hadoop-yarn-project/hadoop-yarn/pom.xml +++ b/hadoop-yarn-project/hadoop-yarn/pom.xml @@ -237,5 +237,6 @@hadoop-yarn-site hadoop-yarn-client hadoop-yarn-registry +hadoop-yarn-ui