You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2017/04/12 13:48:55 UTC
[10/35] ambari git commit: AMBARI-20723 Remove singleNodeInstall flag
from ambari-web code. (ababiichuk)
AMBARI-20723 Remove singleNodeInstall flag from ambari-web code. (ababiichuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/bab55aac
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/bab55aac
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/bab55aac
Branch: refs/heads/branch-feature-AMBARI-12556
Commit: bab55aac66e06be0bc99a6ac2e75b86b0c2c5b48
Parents: 753b38c
Author: ababiichuk <ab...@hortonworks.com>
Authored: Mon Apr 10 16:55:12 2017 +0300
Committer: ababiichuk <ab...@hortonworks.com>
Committed: Mon Apr 10 17:29:15 2017 +0300
----------------------------------------------------------------------
ambari-web/app/assets/test/tests.js | 1 -
ambari-web/app/config.js | 2 -
.../templates/main/service/services/oozie.hbs | 40 --------------
ambari-web/app/views.js | 1 -
.../app/views/common/quick_view_link_view.js | 8 ---
.../app/views/main/service/info/summary.js | 7 ---
.../app/views/main/service/services/hbase.js | 6 ---
.../app/views/main/service/services/hdfs.js | 4 --
.../app/views/main/service/services/oozie.js | 29 -----------
.../test/views/common/quick_link_view_test.js | 10 ----
.../views/main/service/info/summary_test.js | 26 ---------
.../views/main/service/services/hbase_test.js | 23 --------
.../views/main/service/services/hdfs_test.js | 20 -------
.../views/main/service/services/oozie_test.js | 55 --------------------
14 files changed, 232 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/bab55aac/ambari-web/app/assets/test/tests.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/test/tests.js b/ambari-web/app/assets/test/tests.js
index ef8d0bc..432479d 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -349,7 +349,6 @@ var files = [
'test/views/main/service/services/storm_test',
'test/views/main/service/services/yarn_test',
'test/views/main/service/services/hive_test',
- 'test/views/main/service/services/oozie_test',
'test/views/main/service/services/mapreduce2_test',
'test/views/main/service/services/zookeeper_test',
'test/views/main/service/services/flume_test',
http://git-wip-us.apache.org/repos/asf/ambari/blob/bab55aac/ambari-web/app/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/config.js b/ambari-web/app/config.js
index 47eb788..de4b52a 100644
--- a/ambari-web/app/config.js
+++ b/ambari-web/app/config.js
@@ -45,8 +45,6 @@ App.alertGroupsUpdateInterval = 10000;
App.clusterEnvUpdateInterval = 10000;
App.pageReloadTime = 3600000;
App.nnCheckpointAgeAlertThreshold = 12; // in hours
-App.singleNodeInstall = false;
-App.singleNodeAlias = document.location.hostname;
App.minDiskSpace = 2.0; // minimum disk space required for '/' for each host before install, unit GB
App.minDiskSpaceUsrLib = 1.0; // minimum disk space for '/usr/lib' for each host before install, unit GB
App.healthIconClassGreen = 'glyphicon glyphicon-ok-sign'; // bootstrap icon class for healthy/started service/host/host-component
http://git-wip-us.apache.org/repos/asf/ambari/blob/bab55aac/ambari-web/app/templates/main/service/services/oozie.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/services/oozie.hbs b/ambari-web/app/templates/main/service/services/oozie.hbs
deleted file mode 100644
index 3706eb4..0000000
--- a/ambari-web/app/templates/main/service/services/oozie.hbs
+++ /dev/null
@@ -1,40 +0,0 @@
-{{!
-* 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.
-}}
-
-<div class="clearfix">
- <div class="name col-md-2">
- <i class="pull-left glyphicon glyphicon-empty"></i>
- {{view App.MainDashboardServiceHealthView serviceBinding="view.service"}}
- <a {{action selectService view.service href=true}}>{{view.service.displayName}}</a>
- {{#if view.alertsCount}}
- <a href="#" class="label label-important" {{action "showAlertsPopup" view.service target="view.parentView"}}>
- {{view.alertsCount}}
- </a>
- {{/if}}
- </div>
- <div class="summary span">
- {{#each component in view.masters}}
- <a href="#" {{action showDetails component.host}}>{{component.displayName}}</a>,
- {{/each}}
-
- <a href="#" {{action filterHosts view.clients.component}}>{{view.clients.title}}</a>,
-
- <a href="{{unbound view.webUi}}" target="_blank">{{t services.oozie.webUi}}</a>
-
- </div>
-</div>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/bab55aac/ambari-web/app/views.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views.js b/ambari-web/app/views.js
index 3ed1a37..8031434 100644
--- a/ambari-web/app/views.js
+++ b/ambari-web/app/views.js
@@ -295,7 +295,6 @@ require('views/main/service/services/mapreduce2');
require('views/main/service/services/hbase');
require('views/main/service/services/hive');
require('views/main/service/services/zookeeper');
-require('views/main/service/services/oozie');
require('views/main/service/services/flume');
require('views/main/service/services/storm');
require('views/main/service/services/ranger');
http://git-wip-us.apache.org/repos/asf/ambari/blob/bab55aac/ambari-web/app/views/common/quick_view_link_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/quick_view_link_view.js b/ambari-web/app/views/common/quick_view_link_view.js
index 3f3a3a3..dfaf953 100644
--- a/ambari-web/app/views/common/quick_view_link_view.js
+++ b/ambari-web/app/views/common/quick_view_link_view.js
@@ -98,7 +98,6 @@ App.QuickLinksView = Em.View.extend({
*
* The flags responsible for correct, up-to-date state of quick links:
* - App.currentStackVersionNumber
- * - App.singleNodeInstall
* - App.router.clusterController.isHostComponentMetricsLoaded
*/
setQuickLinks: function () {
@@ -107,7 +106,6 @@ App.QuickLinksView = Em.View.extend({
}
}.observes(
'App.currentStackVersionNumber',
- 'App.singleNodeInstall',
'App.router.clusterController.isServiceMetricsLoaded',
'App.router.clusterController.isHostComponentMetricsLoaded',
'App.router.clusterController.quickLinksUpdateCounter'
@@ -612,12 +610,6 @@ App.QuickLinksView = Em.View.extend({
getHosts: function (response, serviceName) {
//The default error message when we cannot obtain the host information for the given service
this.set('quickLinksErrorMessage', Em.I18n.t('quick.links.error.nohosts.label').format(serviceName));
- if (App.get('singleNodeInstall')) {
- return [{
- hostName: App.get('singleNodeAlias'),
- publicHostName: App.get('singleNodeAlias')
- }];
- }
var hosts = [];
var quickLinkConfigs = App.QuickLinksConfig.find().findProperty("id", serviceName);
if (quickLinkConfigs) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/bab55aac/ambari-web/app/views/main/service/info/summary.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/info/summary.js b/ambari-web/app/views/main/service/info/summary.js
index 551a3fd..75d4ed5 100644
--- a/ambari-web/app/views/main/service/info/summary.js
+++ b/ambari-web/app/views/main/service/info/summary.js
@@ -135,13 +135,6 @@ App.MainServiceInfoSummaryView = Em.View.extend(App.Persist, App.TimeRangeMixin,
return result;
}.property('controller.content'),
- historyServerUI: function () {
- var master = this.get('controller.content.hostComponents').findProperty('isMaster');
- return App.singleNodeInstall
- ? "http://" + App.singleNodeAlias + ":19888"
- : "http://" + master.get("host.publicHostName") + ":19888";
- }.property('controller.content'),
-
/**
* Property related to ZOOKEEPER service, is unused for other services
* @return {Object}
http://git-wip-us.apache.org/repos/asf/ambari/blob/bab55aac/ambari-web/app/views/main/service/services/hbase.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/services/hbase.js b/ambari-web/app/views/main/service/services/hbase.js
index d2716aa..ddcb18d 100644
--- a/ambari-web/app/views/main/service/services/hbase.js
+++ b/ambari-web/app/views/main/service/services/hbase.js
@@ -67,12 +67,6 @@ App.MainDashboardServiceHbaseView = App.MainDashboardServiceView.extend({
return this.t("dashboard.services.hbase.summary").format(this.get('service.regionServersTotal'), avgLoad);
}.property('service.regionServersTotal', 'service.averageLoad'),
- hbaseMasterWebUrl: function () {
- if (this.get('activeMaster.host.publicHostName')) {
- return "http://" + (App.singleNodeInstall ? App.singleNodeAlias : this.get('activeMaster.host.publicHostName')) + ":60010";
- }
- }.property('activeMaster'),
-
averageLoad: function () {
var avgLoad = this.get('service.averageLoad');
if (isNaN(avgLoad)) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/bab55aac/ambari-web/app/views/main/service/services/hdfs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/services/hdfs.js b/ambari-web/app/views/main/service/services/hdfs.js
index 79208b9..becb75c 100644
--- a/ambari-web/app/views/main/service/services/hdfs.js
+++ b/ambari-web/app/views/main/service/services/hdfs.js
@@ -113,10 +113,6 @@ App.MainDashboardServiceHdfsView = App.MainDashboardServiceView.extend({
return this.t('services.service.summary.notRunning');
}.property("service.nameNodeStartTime"),
- nodeWebUrl: function () {
- return "http://" + (App.singleNodeInstall ? App.singleNodeAlias : this.get('service.nameNode.publicHostName')) + ":50070";
- }.property('service.nameNode'),
-
nodeHeap: App.MainDashboardServiceView.formattedHeap('dashboard.services.hdfs.nodes.heapUsed', 'service.jvmMemoryHeapUsed', 'service.jvmMemoryHeapMax'),
dfsUsedDisk: diskPart('dashboard.services.hdfs.capacityUsed', 'service.capacityTotal', 'service.capacityUsed'),
http://git-wip-us.apache.org/repos/asf/ambari/blob/bab55aac/ambari-web/app/views/main/service/services/oozie.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/services/oozie.js b/ambari-web/app/views/main/service/services/oozie.js
deleted file mode 100644
index f7a645d..0000000
--- a/ambari-web/app/views/main/service/services/oozie.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * 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.
- */
-
-var App = require('app');
-
-App.MainDashboardServiceOozieView = App.MainDashboardServiceView.extend({
- serviceName: 'oozie',
- templateName: require('templates/main/service/services/oozie'),
-
- webUi: function () {
- var hostName = App.singleNodeInstall ? App.singleNodeAlias : this.get('service.hostComponents').findProperty('componentName', 'OOZIE_SERVER').get('host.publicHostName');
- return "http://{0}:11000/oozie".format(hostName);
- }.property('service')
-});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/bab55aac/ambari-web/test/views/common/quick_link_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/common/quick_link_view_test.js b/ambari-web/test/views/common/quick_link_view_test.js
index c0d58c8..fbdb711 100644
--- a/ambari-web/test/views/common/quick_link_view_test.js
+++ b/ambari-web/test/views/common/quick_link_view_test.js
@@ -886,7 +886,6 @@ describe('App.QuickViewLinks', function () {
sinon.stub(quickViewLinks, 'processHbaseHosts').returns(['hbaseHost']);
sinon.stub(quickViewLinks, 'processYarnHosts').returns(['yarnHost']);
sinon.stub(quickViewLinks, 'findHosts').returns(['host1']);
- App.set('singleNodeInstall', false);
sinon.stub(App.QuickLinksConfig, 'find').returns([
Em.Object.create({
id: 'OOZIE',
@@ -990,15 +989,6 @@ describe('App.QuickViewLinks', function () {
App.QuickLinksConfig.find.restore();
});
- it("singleNodeInstall is true", function() {
- App.set('singleNodeInstall', true);
- App.set('singleNodeAlias', 'host1');
- expect(quickViewLinks.getHosts({}, 'S1')).to.eql([{
- hostName: 'host1',
- publicHostName: 'host1'
- }])
- });
-
var tests = [
{
serviceName: 'OOZIE',
http://git-wip-us.apache.org/repos/asf/ambari/blob/bab55aac/ambari-web/test/views/main/service/info/summary_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/service/info/summary_test.js b/ambari-web/test/views/main/service/info/summary_test.js
index 51fd2f2..41f2992 100644
--- a/ambari-web/test/views/main/service/info/summary_test.js
+++ b/ambari-web/test/views/main/service/info/summary_test.js
@@ -350,32 +350,6 @@ describe('App.MainServiceInfoSummaryView', function() {
});
});
- describe("#historyServerUI", function() {
-
- it("singleNodeInstall is true", function() {
- App.set('singleNodeInstall', true);
- App.set('singleNodeAlias', 'alias');
- view.propertyDidChange('historyServerUI');
- expect(view.get('historyServerUI')).to.equal("http://alias:19888");
- });
-
- it("singleNodeInstall is false", function () {
- App.set('singleNodeInstall', false);
- view.set('controller.content', Em.Object.create({
- hostComponents: [
- Em.Object.create({
- isMaster: true,
- host: Em.Object.create({
- publicHostName: 'host1'
- })
- })
- ]
- }));
- view.propertyDidChange('historyServerUI');
- expect(view.get('historyServerUI')).to.equal("http://host1:19888");
- });
- });
-
describe("#serversHost", function() {
it("should return empty object", function() {
http://git-wip-us.apache.org/repos/asf/ambari/blob/bab55aac/ambari-web/test/views/main/service/services/hbase_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/service/services/hbase_test.js b/ambari-web/test/views/main/service/services/hbase_test.js
index 6c0f1f1..f8f1941 100644
--- a/ambari-web/test/views/main/service/services/hbase_test.js
+++ b/ambari-web/test/views/main/service/services/hbase_test.js
@@ -86,27 +86,4 @@ describe('App.MainDashboardServiceHbaseView', function () {
});
});
- describe("#hbaseMasterWebUrl", function() {
-
- it("activeMaster is present", function() {
- view.reopen({
- activeMaster: Em.Object.create({
- host: Em.Object.create({
- publicHostName: 'host1'
- })
- })
- });
- App.set('singleNodeInstall', false);
- view.propertyDidChange('hbaseMasterWebUrl');
- expect(view.get('hbaseMasterWebUrl')).to.be.equal('http://host1:60010');
- });
- it("activeMaster is null", function() {
- view.reopen({
- activeMaster: null
- });
- view.propertyDidChange('hbaseMasterWebUrl');
- expect(view.get('hbaseMasterWebUrl')).to.be.undefined;
- });
- });
-
});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/bab55aac/ambari-web/test/views/main/service/services/hdfs_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/service/services/hdfs_test.js b/ambari-web/test/views/main/service/services/hdfs_test.js
index 4de5f0b..f39b376 100644
--- a/ambari-web/test/views/main/service/services/hdfs_test.js
+++ b/ambari-web/test/views/main/service/services/hdfs_test.js
@@ -183,26 +183,6 @@ describe('App.MainDashboardServiceHdfsView', function () {
});
});
- describe("#nodeWebUrl", function () {
-
- it("singleNodeInstall is true", function () {
- App.set('singleNodeInstall', true);
- App.set('singleNodeAlias', 'host1');
-
- view.propertyDidChange('nodeWebUrl');
- expect(view.get('nodeWebUrl')).to.be.equal("http://host1:50070");
- });
-
- it("singleNodeInstall is false", function () {
- App.set('singleNodeInstall', false);
- view.set('service.nameNode', Em.Object.create({
- publicHostName: 'host2'
- }));
- view.propertyDidChange('nodeWebUrl');
- expect(view.get('nodeWebUrl')).to.be.equal("http://host2:50070");
- });
- });
-
describe("#nonDfsUsed", function() {
var testCases = [
{
http://git-wip-us.apache.org/repos/asf/ambari/blob/bab55aac/ambari-web/test/views/main/service/services/oozie_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/service/services/oozie_test.js b/ambari-web/test/views/main/service/services/oozie_test.js
deleted file mode 100644
index c95e65f..0000000
--- a/ambari-web/test/views/main/service/services/oozie_test.js
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * 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.
- */
-
-var App = require('app');
-require('/views/main/service/services/oozie');
-
-describe('App.MainDashboardServiceOozieView', function () {
- var view;
-
- beforeEach(function() {
- view = App.MainDashboardServiceOozieView.create();
- });
-
- describe("#webUi", function () {
-
- it("singleNodeInstall is true", function () {
- App.set('singleNodeInstall', true);
- App.set('singleNodeAlias', 'host1');
-
- view.propertyDidChange('webUi');
- expect(view.get('webUi')).to.be.equal("http://host1:11000/oozie");
- });
-
- it("singleNodeInstall is false", function () {
- App.set('singleNodeInstall', false);
- view.set('service', Em.Object.create({
- hostComponents: [
- Em.Object.create({
- componentName: 'OOZIE_SERVER',
- host: Em.Object.create({
- publicHostName: 'host2'
- })
- })
- ]
- }));
- view.propertyDidChange('webUi');
- expect(view.get('webUi')).to.be.equal("http://host2:11000/oozie");
- });
- });
-});
\ No newline at end of file