You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2014/01/30 20:16:54 UTC

git commit: Revert "AMBARI-4471. Refactor of component lists. (Denys Buzhor via onechiporenko)"

Updated Branches:
  refs/heads/trunk 72535217c -> 2f0d12e4b


Revert "AMBARI-4471. Refactor of component lists. (Denys Buzhor via onechiporenko)"

This reverts commit 16773c272afa83df396a387fd4ef0c08af0be04d.


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2f0d12e4
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2f0d12e4
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2f0d12e4

Branch: refs/heads/trunk
Commit: 2f0d12e4b67f420aa56a268b152b673b96f8ee51
Parents: 7253521
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Thu Jan 30 11:14:55 2014 -0800
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Thu Jan 30 11:14:55 2014 -0800

----------------------------------------------------------------------
 ambari-web/app/app.js                           | 16 +----------
 ambari-web/app/assets/test/tests.js             |  3 +--
 ambari-web/app/config.js                        |  3 +++
 .../app/controllers/wizard/step9_controller.js  |  8 +++---
 ambari-web/app/data/service_components.js       |  2 +-
 ambari-web/app/views/main/host/summary.js       |  6 ++---
 ambari-web/app/views/main/service/item.js       |  2 +-
 ambari-web/test/app_test.js                     | 28 --------------------
 ambari-web/test/installer/step9_test.js         | 11 +++-----
 9 files changed, 18 insertions(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2f0d12e4/ambari-web/app/app.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/app.js b/ambari-web/app/app.js
index a8eb611..8078961 100644
--- a/ambari-web/app/app.js
+++ b/ambari-web/app/app.js
@@ -71,22 +71,8 @@ module.exports = Em.Application.create({
   isHaEnabled: function() {
     if (!this.get('isHadoop2Stack')) return false;
     return !this.HostComponent.find().someProperty('componentName', 'SECONDARY_NAMENODE');
-  }.property('router.clusterController.isLoaded'),
+  }.property('router.clusterController.isLoaded')
 
-  components: Ember.Object.create({
-    reassignable: ['NAMENODE', 'SECONDARY_NAMENODE', 'JOBTRACKER', 'RESOURCEMANAGER'],
-    restartable: ['APP_TIMELINE_SERVER'],
-    deletable: ['SUPERVISOR', 'HBASE_MASTER'],
-    slaves: function() {
-      return require('data/service_components').filter(function(component){
-        return !component.isClient && !component.isMaster
-      }).mapProperty('component_name').uniq().without("DASHBOARD");
-    }.property().cacheable(),
-
-    masters: function() {
-      return require('data/service_components').filterProperty('isMaster', true).mapProperty('component_name').uniq();
-    }.property().cacheable()
-  })
 });
 
 /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/2f0d12e4/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 85181fc..20ff4b3 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -16,7 +16,6 @@
  * limitations under the License.
  */
 
-require('test/app_test');
 require('test/controllers/global/background_operations_test');
 require('test/controllers/global/cluster_controller_test');
 require('test/controllers/main/app_contoller_test');
@@ -100,4 +99,4 @@ require('test/views/main/dashboard/widgets/namenode_cpu_test');
 require('test/views/common/configs/services_config_test');
 require('test/views/wizard/step9_view_test');
 require('test/models/host_test');
-require('test/models/rack_test');
+require('test/models/rack_test');
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/2f0d12e4/ambari-web/app/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/config.js b/ambari-web/app/config.js
index 711be61..2b11095 100644
--- a/ambari-web/app/config.js
+++ b/ambari-web/app/config.js
@@ -38,6 +38,9 @@ App.maxRunsForAppBrowser = 500;
 App.pageReloadTime=3600000;
 App.singleNodeInstall = false;
 App.singleNodeAlias = document.location.hostname;
+App.reassignableComponents = ['NAMENODE', 'SECONDARY_NAMENODE', 'JOBTRACKER', 'RESOURCEMANAGER'];
+App.restartableComponents = ['APP_TIMELINE_SERVER'];
+App.deletableComponents = ['SUPERVISOR', 'HBASE_MASTER'];
 
 // experimental features are automatically enabled if running on brunch server
 App.enableExperimental = false;

http://git-wip-us.apache.org/repos/asf/ambari/blob/2f0d12e4/ambari-web/app/controllers/wizard/step9_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step9_controller.js b/ambari-web/app/controllers/wizard/step9_controller.js
index 47509a5..6c3fe08 100644
--- a/ambari-web/app/controllers/wizard/step9_controller.js
+++ b/ambari-web/app/controllers/wizard/step9_controller.js
@@ -352,7 +352,7 @@ App.WizardStep9Controller = Em.Controller.extend({
       data = {
         "RequestInfo": {
           "context": Em.I18n.t("requestInfo.startHostComponents"),
-          "query": "HostRoles/component_name.in(" + App.get('components.slaves').join(',') + ")&HostRoles/state=INSTALLED&HostRoles/host_name.in(" + hostnames.join(',') + ")"
+          "query": "HostRoles/component_name.in(GANGLIA_MONITOR,HBASE_REGIONSERVER,DATANODE,TASKTRACKER,NODEMANAGER)&HostRoles/state=INSTALLED&HostRoles/host_name.in(" + hostnames.join(',') + ")"
         },
         "Body": {
           "HostRoles": { "state": "STARTED" }
@@ -467,8 +467,8 @@ App.WizardStep9Controller = Em.Controller.extend({
   isMasterFailed: function(polledData) {
     var result = false;
     polledData.filterProperty('Tasks.command', 'INSTALL').filterProperty('Tasks.status', 'FAILED').mapProperty('Tasks.role').forEach (
-      function (role) {
-        if (!App.get('components.slaves').contains(role)) {
+      function (task) {
+        if (!['DATANODE', 'TASKTRACKER', 'HBASE_REGIONSERVER', 'GANGLIA_MONITOR'].contains(task)) {
           result = true;
         }
       }
@@ -546,7 +546,7 @@ App.WizardStep9Controller = Em.Controller.extend({
         return;
       }
       var actionsPerRole = polledData.filterProperty('Tasks.role', role);
-      if (App.get('components.slaves').contains(role)) {
+      if (['DATANODE', 'TASKTRACKER', 'HBASE_REGIONSERVER', 'GANGLIA_MONITOR'].contains(role)) {
         // check slave components for success factor.
         // partial failure for slave components are allowed.
         var actionsFailed = actionsPerRole.filterProperty('Tasks.status', 'FAILED');

http://git-wip-us.apache.org/repos/asf/ambari/blob/2f0d12e4/ambari-web/app/data/service_components.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/service_components.js b/ambari-web/app/data/service_components.js
index 5fc4580..1efe894 100644
--- a/ambari-web/app/data/service_components.js
+++ b/ambari-web/app/data/service_components.js
@@ -241,7 +241,7 @@ module.exports = new Ember.Set([
     service_name: 'HIVE',
     component_name: 'MYSQL_SERVER',
     display_name: 'MySQL Server for Hive',
-    isMaster: true,
+    isMaster: false,
     isClient: false,
     description: ''
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/2f0d12e4/ambari-web/app/views/main/host/summary.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host/summary.js b/ambari-web/app/views/main/host/summary.js
index e3befcc..c8779c9 100644
--- a/ambari-web/app/views/main/host/summary.js
+++ b/ambari-web/app/views/main/host/summary.js
@@ -773,7 +773,7 @@ App.MainHostSummaryView = Em.View.extend({
      * Shows whether we need to show Delete button
      */
     isDeletableComponent: function () {
-      return App.get('components.deletable').contains(this.get('content.componentName'));
+      return App.deletableComponents.contains(this.get('content.componentName'));
     }.property('content'),
 
     isDeleteComponentDisabled: function () {
@@ -782,11 +782,11 @@ App.MainHostSummaryView = Em.View.extend({
     }.property('workStatus'),
 
     isReassignable: function () {
-      return App.supports.reassignMaster && App.get('components.reassignable').contains(this.get('content.componentName')) && App.Host.find().content.length > 1;
+      return App.supports.reassignMaster && App.reassignableComponents.contains(this.get('content.componentName')) && App.Host.find().content.length > 1;
     }.property('content.componentName'),
 
     isRestartableComponent: function() {
-      return App.get('components.restartable').contains(this.get('content.componentName'));
+      return App.restartableComponents.contains(this.get('content.componentName'));
     }.property('content'),
 
     isRestartComponentDisabled: function() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/2f0d12e4/ambari-web/app/views/main/service/item.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/item.js b/ambari-web/app/views/main/service/item.js
index e617e98..c6b919e 100644
--- a/ambari-web/app/views/main/service/item.js
+++ b/ambari-web/app/views/main/service/item.js
@@ -46,7 +46,7 @@ App.MainServiceItemView = Em.View.extend({
       case 'MAPREDUCE':
         if (App.supports.reassignMaster && hosts > 1) {
           allMasters.forEach(function (hostComponent) {
-            if (App.get('components.reassignable').contains(hostComponent)) {
+            if (App.reassignableComponents.contains(hostComponent)) {
               options.push({action: 'reassignMaster', context: hostComponent, cssClass: 'icon-share-alt', 
                 'label': Em.I18n.t('services.service.actions.reassign.master').format(App.format.role(hostComponent)), disabled: false});
             }

http://git-wip-us.apache.org/repos/asf/ambari/blob/2f0d12e4/ambari-web/test/app_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/app_test.js b/ambari-web/test/app_test.js
deleted file mode 100644
index 59ec825..0000000
--- a/ambari-web/test/app_test.js
+++ /dev/null
@@ -1,28 +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');
-
-describe('#App.components', function() {
-  it('slaves and masters should not intersect', function() {
-    var intersected = App.get('components.slaves').filter(function(item){
-      return App.get('components.masters').contains(item);
-    });
-    expect(intersected).to.eql([]);
-  });
-});

http://git-wip-us.apache.org/repos/asf/ambari/blob/2f0d12e4/ambari-web/test/installer/step9_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/installer/step9_test.js b/ambari-web/test/installer/step9_test.js
index eb0de3f..a3b4370 100644
--- a/ambari-web/test/installer/step9_test.js
+++ b/ambari-web/test/installer/step9_test.js
@@ -379,8 +379,7 @@ describe('App.InstallerStep9Controller', function () {
           {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'DATANODE'}},
           {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'TASKTRACKER'}},
           {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'HBASE_REGIONSERVER'}},
-          {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'GANGLIA_MONITOR'}},
-          {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'SUPERVISOR'}}
+          {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'GANGLIA_MONITOR'}}
         ],
         e: false,
         m: 'No one Master is failed'
@@ -390,8 +389,7 @@ describe('App.InstallerStep9Controller', function () {
           {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'NAMENODE'}},
           {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'TASKTRACKER'}},
           {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'HBASE_REGIONSERVER'}},
-          {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'GANGLIA_MONITOR'}},
-          {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'SUPERVISOR'}}
+          {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'GANGLIA_MONITOR'}}
         ],
         e: true,
         m: 'One Master is failed'
@@ -401,8 +399,7 @@ describe('App.InstallerStep9Controller', function () {
           {Tasks: {command: 'PENDING',status: 'FAILED',role: 'NAMENODE'}},
           {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'TASKTRACKER'}},
           {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'HBASE_REGIONSERVER'}},
-          {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'GANGLIA_MONITOR'}},
-          {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'SUPERVISOR'}}
+          {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'GANGLIA_MONITOR'}}
         ],
         e: false,
         m: 'one Master is failed but command is not install'
@@ -970,4 +967,4 @@ describe('App.InstallerStep9Controller', function () {
     });
   });
 
-});
+});
\ No newline at end of file