You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jo...@apache.org on 2014/08/28 19:49:36 UTC

[01/45] git commit: AMBARI-7035. Views: Jobs view support for existing ATS. (akovalenko)

Repository: ambari
Updated Branches:
  refs/heads/branch-alerts-dev 76fc94ec1 -> 52d1af763


AMBARI-7035. Views: Jobs view support for existing ATS. (akovalenko)


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

Branch: refs/heads/branch-alerts-dev
Commit: 61695fa43735b12a08b15af9504210ac6c9a0bf2
Parents: a826334
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Wed Aug 27 15:55:38 2014 +0300
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Wed Aug 27 15:55:38 2014 +0300

----------------------------------------------------------------------
 .../src/main/resources/ui/app/scripts/app.js    |  2 +-
 .../app/scripts/controllers/job_controller.js   |  2 +-
 .../app/scripts/controllers/jobs_controller.js  | 14 ++--
 .../resources/ui/app/scripts/helpers/ajax.js    | 17 +++--
 .../resources/ui/app/scripts/helpers/jobs.js    | 78 +++++++++-----------
 .../mappers/application_status_mapper.js        | 47 ++++++++++++
 contrib/views/jobs/src/main/resources/view.xml  | 10 +++
 7 files changed, 111 insertions(+), 59 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/61695fa4/contrib/views/jobs/src/main/resources/ui/app/scripts/app.js
----------------------------------------------------------------------
diff --git a/contrib/views/jobs/src/main/resources/ui/app/scripts/app.js b/contrib/views/jobs/src/main/resources/ui/app/scripts/app.js
index 3ab2c30..2ae6d20 100644
--- a/contrib/views/jobs/src/main/resources/ui/app/scripts/app.js
+++ b/contrib/views/jobs/src/main/resources/ui/app/scripts/app.js
@@ -55,7 +55,7 @@ App.initializer({
 
     });
 
-    application.ApplicationStatusMapper.getClusterName();
+    application.ApplicationStatusMapper.getInstanceParameters();
 
   }
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/61695fa4/contrib/views/jobs/src/main/resources/ui/app/scripts/controllers/job_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/jobs/src/main/resources/ui/app/scripts/controllers/job_controller.js b/contrib/views/jobs/src/main/resources/ui/app/scripts/controllers/job_controller.js
index f1125d9..dbf3a4f 100644
--- a/contrib/views/jobs/src/main/resources/ui/app/scripts/controllers/job_controller.js
+++ b/contrib/views/jobs/src/main/resources/ui/app/scripts/controllers/job_controller.js
@@ -71,7 +71,7 @@ App.JobController = Ember.ObjectController.extend(App.RunPeriodically, {
       timeout = this.get('loadTimeout'),
       yarnService = App.HiveJob.store.getById('service', 'YARN'),
       content = this.get('content');
-    if (!Em.isNone(yarnService)) {
+    if (!Em.isNone(yarnService) || App.get('atsURL')) {
       if (!Em.isNone(content)) {
         App.Helpers.jobs.refreshJobDetails(
           content,

http://git-wip-us.apache.org/repos/asf/ambari/blob/61695fa4/contrib/views/jobs/src/main/resources/ui/app/scripts/controllers/jobs_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/jobs/src/main/resources/ui/app/scripts/controllers/jobs_controller.js b/contrib/views/jobs/src/main/resources/ui/app/scripts/controllers/jobs_controller.js
index d96f598..16acb56 100644
--- a/contrib/views/jobs/src/main/resources/ui/app/scripts/controllers/jobs_controller.js
+++ b/contrib/views/jobs/src/main/resources/ui/app/scripts/controllers/jobs_controller.js
@@ -557,11 +557,11 @@ App.JobsController = Ember.ArrayController.extend(App.RunPeriodically, {
    */
   checkDataLoadingError: function (jqXHR) {
     var atsComponent = App.HiveJob.store.getById('component', 'APP_TIMELINE_SERVER');
-    if (atsComponent && atsComponent.get('workStatus') != "STARTED") {
+    if (!App.get('atsURL') && atsComponent && atsComponent.get('workStatus') != "STARTED") {
       this.set('jobsMessage', Em.I18n.t('jobs.error.ats.down'));
     }
     else {
-      if (jqXHR && jqXHR.status == 400) {
+      if (jqXHR && (jqXHR.status == 400 || jqXHR.status == 404)) {
         this.set('jobsMessage', Em.I18n.t('jobs.error.400'));
       }
       else {
@@ -584,15 +584,14 @@ App.JobsController = Ember.ArrayController.extend(App.RunPeriodically, {
       atsComponent = App.HiveJob.store.getById('component', 'APP_TIMELINE_SERVER'),
       atsInValidState = !!atsComponent && atsComponent.get('workStatus') === "STARTED";
     this.checkDataLoadingError();
-    if (!Em.isNone(yarnService) && atsInValidState) {
+    if (App.get('atsURL') || (!Em.isNone(yarnService) && atsInValidState)) {
       this.set('loading', true);
-      var historyServerHostName = atsComponent.get('hostName');
+      var atsURL = App.get('atsURL') || 'http://' + atsComponent.get('hostName') + ':' + yarnService.get('ahsWebPort');
       App.ajax.send({
         name: 'jobs_lastID',
         sender: this,
         data: {
-          historyServerHostName: historyServerHostName,
-          ahsWebPort: yarnService.get('ahsWebPort')
+          atsURL: atsURL
         },
         success: 'lastIDSuccessCallback',
         error : 'lastIDErrorCallback'
@@ -601,8 +600,7 @@ App.JobsController = Ember.ArrayController.extend(App.RunPeriodically, {
         name: 'load_jobs',
         sender: this,
         data: {
-          historyServerHostName: historyServerHostName,
-          ahsWebPort: yarnService.get('ahsWebPort'),
+          atsURL: atsURL,
           filtersLink: this.get('filterObject').createJobsFiltersLink()
         },
         success: 'loadJobsSuccessCallback',

http://git-wip-us.apache.org/repos/asf/ambari/blob/61695fa4/contrib/views/jobs/src/main/resources/ui/app/scripts/helpers/ajax.js
----------------------------------------------------------------------
diff --git a/contrib/views/jobs/src/main/resources/ui/app/scripts/helpers/ajax.js b/contrib/views/jobs/src/main/resources/ui/app/scripts/helpers/ajax.js
index e0eacf5..e648e61 100644
--- a/contrib/views/jobs/src/main/resources/ui/app/scripts/helpers/ajax.js
+++ b/contrib/views/jobs/src/main/resources/ui/app/scripts/helpers/ajax.js
@@ -31,37 +31,37 @@
 var urls = {
 
   'load_jobs': {
-    real: '/proxy?url=http://{historyServerHostName}:{ahsWebPort}/ws/v1/timeline/HIVE_QUERY_ID{filtersLink}',
+    real: '/proxy?url={atsURL}/ws/v1/timeline/HIVE_QUERY_ID{filtersLink}',
     mock: '/scripts/assets/hive-queries.json',
     apiPrefix: ''
   },
 
   'jobs_lastID': {
-    real: '/proxy?url=http://{historyServerHostName}:{ahsWebPort}/ws/v1/timeline/HIVE_QUERY_ID?limit=1&secondaryFilter=tez:true',
+    real: '/proxy?url={atsURL}/ws/v1/timeline/HIVE_QUERY_ID?limit=1&secondaryFilter=tez:true',
     mock: '/scripts/assets/hive-queries.json',
     apiPrefix: ''
   },
 
   'job_details': {
-    real: '/proxy?url=http://{historyServerHostName}:{ahsWebPort}/ws/v1/timeline/HIVE_QUERY_ID/{job_id}?fields=events,otherinfo',
+    real: '/proxy?url={atsURL}/ws/v1/timeline/HIVE_QUERY_ID/{job_id}?fields=events,otherinfo',
     mock: '/scripts/assets/hive-query-2.json',
     apiPrefix: ''
   },
 
   'jobs.tezDag.NametoID': {
-    'real': '/proxy?url=http://{historyServerHostName}:{ahsWebPort}/ws/v1/timeline/TEZ_DAG_ID?primaryFilter=dagName:{tezDagName}',
+    'real': '/proxy?url={atsURL}/ws/v1/timeline/TEZ_DAG_ID?primaryFilter=dagName:{tezDagName}',
     'mock': '/scripts/assets/tezDag-name-to-id.json',
     'apiPrefix': ''
   },
 
   'jobs.tezDag.tezDagId': {
-    'real': '/proxy?url=http://{historyServerHostName}:{ahsWebPort}/ws/v1/timeline/TEZ_DAG_ID/{tezDagId}?fields=relatedentities,otherinfo',
+    'real': '/proxy?url={atsURL}/ws/v1/timeline/TEZ_DAG_ID/{tezDagId}?fields=relatedentities,otherinfo',
     'mock': '/scripts/assets/tezDag.json',
     'apiPrefix': ''
   },
 
   'jobs.tezDag.tezDagVertexId': {
-    'real': '/proxy?url=http://{historyServerHostName}:{ahsWebPort}/ws/v1/timeline/TEZ_VERTEX_ID/{tezDagVertexId}?fields=otherinfo',
+    'real': '/proxy?url={atsURL}/ws/v1/timeline/TEZ_VERTEX_ID/{tezDagVertexId}?fields=otherinfo',
     'mock': '/scripts/assets/tezDagVertex.json',
     'apiPrefix': ''
   },
@@ -94,6 +94,11 @@ var urls = {
   'configurations': {
     real: 'clusters/{clusterName}/configurations?{params}',
     mock: '/scripts/assets/configurations.json'
+  },
+
+  'instance_parameters': {
+    real: 'views/{view}/versions/{version}/instances/{instanceName}',
+    mock: ''
   }
 
 };

http://git-wip-us.apache.org/repos/asf/ambari/blob/61695fa4/contrib/views/jobs/src/main/resources/ui/app/scripts/helpers/jobs.js
----------------------------------------------------------------------
diff --git a/contrib/views/jobs/src/main/resources/ui/app/scripts/helpers/jobs.js b/contrib/views/jobs/src/main/resources/ui/app/scripts/helpers/jobs.js
index 9255603..f0759da 100644
--- a/contrib/views/jobs/src/main/resources/ui/app/scripts/helpers/jobs.js
+++ b/contrib/views/jobs/src/main/resources/ui/app/scripts/helpers/jobs.js
@@ -45,16 +45,14 @@ App.Helpers.jobs = {
    * @method refreshHiveJobDetails
    */
   refreshHiveJobDetails: function (hiveJob, successCallback, errorCallback) {
-    var yarnService = App.HiveJob.store.getById('service', 'YARN'),
-      historyServerHostName = App.HiveJob.store.getById('component', 'APP_TIMELINE_SERVER').get('hostName'),
-      ahsWebPort = yarnService.get('ahsWebPort');
+    var  atsURL = App.get('atsURL') || 'http://' + App.HiveJob.store.getById('component', 'APP_TIMELINE_SERVER').get('hostName') +
+        ':' + App.HiveJob.store.getById('service', 'YARN').get('ahsWebPort');
 
     return App.ajax.send({
       name: 'job_details',
       sender: this,
       data: {
-        historyServerHostName: historyServerHostName,
-        ahsWebPort: ahsWebPort,
+        atsURL: atsURL,
         job_id: hiveJob.get('id'),
         successCallback: successCallback,
         errorCallback: errorCallback
@@ -89,9 +87,8 @@ App.Helpers.jobs = {
         name: 'jobs.tezDag.NametoID',
         sender: sender,
         data: {
-          historyServerHostName: params.historyServerHostName,
-          tezDagName: tezDagName,
-          ahsWebPort: params.ahsWebPort
+          atsURL: params.atsURL,
+          tezDagName: tezDagName
         },
         success: 'dagNameToIdSuccess',
         error: 'dagNameToIdError'
@@ -113,45 +110,43 @@ App.Helpers.jobs = {
    */
   refreshTezDagDetails: function (tezDagId, successCallback, errorCallback) {
     var self = this,
-      yarnService = App.HiveJob.store.getById('service', 'YARN'),
-      historyServerHostName = App.HiveJob.store.getById('component', 'APP_TIMELINE_SERVER').get('hostName'),
-      resourceManagerHostName = App.HiveJob.store.getById('component', 'RESOURCEMANAGER').get('hostName'),
-      ahsWebPort = yarnService.get('ahsWebPort'),
-      tezDag = App.HiveJob.store.getById('tezDag', tezDagId);
+        atsURL = App.get('atsURL') || 'http://' + App.HiveJob.store.getById('component', 'RESOURCEMANAGER').get('hostName') + ':' + App.HiveJob.store.getById('service', 'YARN').get('ahsWebPort'),
+        resourceManager = App.HiveJob.store.getById('component', 'RESOURCEMANAGER'),
+        resourceManagerHostName = App.get('resourceManagerURL') || (resourceManager && 'http://' + resourceManager.get('hostName') + ':8088') || '',
+        tezDag = App.HiveJob.store.getById('tezDag', tezDagId);
     if (tezDag) {
       var tezDagInstanceId = tezDag.get('instanceId'),
-        sender = {
-          loadTezDagSuccess: function (data) {
-            if (data) {
-              var app_id = Em.get(data, 'otherinfo.applicationId');
-              if (!Em.isNone(app_id)) {
-                tezDag.set('yarnApplicationId', app_id);
-                tezDag.set('yarnApplicationLink', 'http://'+resourceManagerHostName+':8088/cluster/app/'+app_id);
-              }
-              if (data.relatedentities && data.relatedentities.TEZ_VERTEX_ID != null) {
-                var count = data.relatedentities.TEZ_VERTEX_ID.length;
-                data.relatedentities.TEZ_VERTEX_ID.forEach(function (v) {
-                  self.refreshTezDagVertex(tezDagId, v, function () {
-                    if (--count <= 0) {
-                      // all vertices succeeded
-                      successCallback();
-                    }
+          sender = {
+            loadTezDagSuccess: function (data) {
+              if (data) {
+                var app_id = Em.get(data, 'otherinfo.applicationId');
+                if (app_id && resourceManagerHostName) {
+                  tezDag.set('yarnApplicationId', app_id);
+                  tezDag.set('yarnApplicationLink', resourceManagerHostName + '/cluster/app/' + app_id);
+                }
+                if (data.relatedentities && data.relatedentities.TEZ_VERTEX_ID != null) {
+                  var count = data.relatedentities.TEZ_VERTEX_ID.length;
+                  data.relatedentities.TEZ_VERTEX_ID.forEach(function (v) {
+                    self.refreshTezDagVertex(tezDagId, v, function () {
+                      if (--count <= 0) {
+                        // all vertices succeeded
+                        successCallback();
+                      }
+                    });
                   });
-                });
+                }
               }
+            },
+            loadTezDagError: function () {
+              errorCallback('job.dag.id.loaderror');
             }
-          },
-          loadTezDagError: function () {
-            errorCallback('job.dag.id.loaderror');
-          }
-        };
+          };
       App.ajax.send({
         name: 'jobs.tezDag.tezDagId',
         sender: sender,
         data: {
-          historyServerHostName: historyServerHostName,
           tezDagId: tezDagInstanceId,
-          ahsWebPort: ahsWebPort
+          atsURL: atsURL
         },
         success: 'loadTezDagSuccess',
         error: 'loadTezDagError'
@@ -171,9 +166,7 @@ App.Helpers.jobs = {
    * @method refreshTezDagVertex
    */
   refreshTezDagVertex: function (tezDagId, tezVertexInstanceId, successCallback) {
-    var yarnService = App.HiveJob.store.getById('service', 'YARN'),
-      historyServerHostName = App.HiveJob.store.getById('component', 'APP_TIMELINE_SERVER').get('hostName'),
-      ahsWebPort = yarnService.get('ahsWebPort'),
+    var atsURL = App.get('atsURL') || 'http://' + App.HiveJob.store.getById('component', 'APP_TIMELINE_SERVER').get('hostName') + ':' + App.HiveJob.store.getById('service', 'YARN').get('ahsWebPort'),
       tezDag = App.HiveJob.store.getById('tezDag', tezDagId),
       hiveJob = App.HiveJob.store.all('hiveJob').findBy('tezDag', tezDag),
       hiveJobFailed = hiveJob.get('failed'),
@@ -247,9 +240,8 @@ App.Helpers.jobs = {
       name: 'jobs.tezDag.tezDagVertexId',
       sender: sender,
       data: {
-        historyServerHostName: historyServerHostName,
-        tezDagVertexId: tezVertexInstanceId,
-        ahsWebPort: ahsWebPort
+        atsURL: atsURL,
+        tezDagVertexId: tezVertexInstanceId
       },
       success: 'loadTezDagVertexSuccess',
       error: 'loadTezDagVertexError'

http://git-wip-us.apache.org/repos/asf/ambari/blob/61695fa4/contrib/views/jobs/src/main/resources/ui/app/scripts/mappers/application_status_mapper.js
----------------------------------------------------------------------
diff --git a/contrib/views/jobs/src/main/resources/ui/app/scripts/mappers/application_status_mapper.js b/contrib/views/jobs/src/main/resources/ui/app/scripts/mappers/application_status_mapper.js
index aa17bd5..935f2a1 100644
--- a/contrib/views/jobs/src/main/resources/ui/app/scripts/mappers/application_status_mapper.js
+++ b/contrib/views/jobs/src/main/resources/ui/app/scripts/mappers/application_status_mapper.js
@@ -110,6 +110,53 @@ App.ApplicationStatusMapper = Em.Object.createWithMixins(App.RunPeriodically, {
   },
 
   /**
+   * Get View instance properties provided by user
+   * @returns {$.ajax}
+   * @method getInstanceParameters
+   */
+  getInstanceParameters: function () {
+    var hashArray = location.pathname.split('/');
+    var view = hashArray[2];
+    var version = hashArray[3];
+    var instanceName = hashArray[4];
+    return App.ajax.send({
+      name: 'instance_parameters',
+      sender: this,
+      data: {
+        view: view,
+        version: version,
+        instanceName: instanceName
+      },
+      success: 'getInstanceParametersSuccessCallback',
+      error: 'getInstanceParametersErrorCallback'
+    });
+  },
+
+  /**
+   * Success callback for getInstanceParameters-request
+   * @param {object} data
+   * @method getInstanceParametersSuccessCallback
+   */
+  getInstanceParametersSuccessCallback: function (data) {
+    var atsURLParameter = data.ViewInstanceInfo.properties['yarn.ats.url'];
+    var resourceManagerURLParameter = data.ViewInstanceInfo.properties['yarn.resourcemanager.url'];
+    if (atsURLParameter) {
+      App.set('atsURL', atsURLParameter);
+      App.set('resourceManagerURL', resourceManagerURLParameter);
+    } else {
+      this.getClusterName();
+    }
+  },
+
+  /**
+   * Success callback for getInstanceParameters-request
+   * @method getInstanceParametersErrorCallback
+   */
+  getInstanceParametersErrorCallback: function () {
+    this.getClusterName();
+  },
+
+  /**
    * Get cluster name from server
    * @returns {$.ajax}
    * @method getClusterName

http://git-wip-us.apache.org/repos/asf/ambari/blob/61695fa4/contrib/views/jobs/src/main/resources/view.xml
----------------------------------------------------------------------
diff --git a/contrib/views/jobs/src/main/resources/view.xml b/contrib/views/jobs/src/main/resources/view.xml
index c48f6b5..30adca2 100644
--- a/contrib/views/jobs/src/main/resources/view.xml
+++ b/contrib/views/jobs/src/main/resources/view.xml
@@ -18,4 +18,14 @@ limitations under the License. Kerberos, LDAP, Custom. Binary/Htt
   <name>JOBS</name>
   <label>Jobs View</label>
   <version>1.0.0</version>
+  <parameter>
+      <name>yarn.ats.url</name>
+      <description>The URL to the YARN Application Timeline Server, used to provide Jobs information, typically, this is the yarn.timeline-service.webapp.address property in the yarn-site.xml configuration. For example: http://yarn.ats.address:8188</description>
+      <required>false</required>
+  </parameter>
+  <parameter>
+      <name>yarn.resourcemanager.url</name>
+      <description>The URL to the YARN ResourceManager, used to provide YARN Application data. For example: http://yarn.resourcemanager.address:8088</description>
+      <required>false</required>
+  </parameter>
 </view>


[24/45] git commit: AMBARI-7043. BE: Move stack_advisor.py abstract class one folder up - RPM and DEB package changes.

Posted by jo...@apache.org.
AMBARI-7043. BE: Move stack_advisor.py abstract class one folder up -
RPM and DEB package changes.


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

Branch: refs/heads/branch-alerts-dev
Commit: d87cf7f8d0fee68210296085954a7a1e6ce484c4
Parents: 39c7ae7
Author: Srimanth Gunturi <sg...@hortonworks.com>
Authored: Wed Aug 27 10:56:25 2014 -0700
Committer: Srimanth Gunturi <sg...@hortonworks.com>
Committed: Wed Aug 27 18:04:00 2014 -0700

----------------------------------------------------------------------
 ambari-server/pom.xml                           | 22 +++++
 .../src/main/resources/scripts/stack_advisor.py |  2 +-
 .../main/resources/stacks/HDP/stack_advisor.py  | 37 --------
 .../src/main/resources/stacks/stack_advisor.py  | 37 ++++++++
 .../server/api/services/AmbariMetaInfoTest.java |  4 +-
 .../AmbariManagementControllerTest.java         |  2 +-
 .../src/test/python/TestStackAdvisor.py         | 93 ++++++++++++++++++++
 .../stacks/2.0.6/common/test_stack_advisor.py   |  2 +-
 .../stacks/XYZ/1.0.0/services/stack_advisor.py  | 67 ++++++++++++++
 .../stacks/XYZ/1.0.1/services/stack_advisor.py  | 30 +++++++
 10 files changed, 255 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d87cf7f8/ambari-server/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index 2302c62..6279834 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -463,6 +463,17 @@
               </sources>
             </mapping>
             <mapping>
+              <directory>/var/lib/ambari-server/resources/stacks</directory>
+              <filemode>755</filemode>
+              <username>root</username>
+              <groupname>root</groupname>
+              <sources>
+                <source>
+                  <location>target/classes/stacks/stack_advisor.py</location>
+                </source>
+              </sources>
+            </mapping>
+            <mapping>
               <directory>/usr/lib/python2.6/site-packages/ambari_server</directory>
               <filemode>755</filemode>
               <username>root</username>
@@ -804,6 +815,17 @@
             </mapper>
           </data>
           <data>
+            <src>target/classes/stacks/stack_advisor.py</src>
+            <type>file</type>
+            <mapper>
+              <type>perm</type>
+              <prefix>/var/lib/ambari-server/resources/stacks</prefix>
+              <user>root</user>
+              <group>root</group>
+              <filemode>755</filemode>
+            </mapper>
+          </data>
+          <data>
             <src>src/main/python/ambari_server</src>
             <type>directory</type>
             <mapper>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d87cf7f8/ambari-server/src/main/resources/scripts/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/scripts/stack_advisor.py b/ambari-server/src/main/resources/scripts/stack_advisor.py
index 61d1e09..ed50866 100755
--- a/ambari-server/src/main/resources/scripts/stack_advisor.py
+++ b/ambari-server/src/main/resources/scripts/stack_advisor.py
@@ -33,7 +33,7 @@ ALL_ACTIONS = [ RECOMMEND_COMPONENT_LAYOUT_ACTION, VALIDATE_COMPONENT_LAYOUT_ACT
 USAGE = "Usage: <action> <hosts_file> <services_file>\nPossible actions are: {0}\n".format( str(ALL_ACTIONS) )
 
 SCRIPT_DIRECTORY = os.path.dirname(os.path.abspath(__file__))
-STACK_ADVISOR_PATH_TEMPLATE = os.path.join(SCRIPT_DIRECTORY, '../stacks/{0}/stack_advisor.py')
+STACK_ADVISOR_PATH_TEMPLATE = os.path.join(SCRIPT_DIRECTORY, '../stacks/stack_advisor.py')
 STACK_ADVISOR_IMPL_PATH_TEMPLATE = os.path.join(SCRIPT_DIRECTORY, './../stacks/{0}/{1}/services/stack_advisor.py')
 STACK_ADVISOR_IMPL_CLASS_TEMPLATE = '{0}{1}StackAdvisor'
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/d87cf7f8/ambari-server/src/main/resources/stacks/HDP/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/stack_advisor.py
deleted file mode 100644
index 5f66fff..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/stack_advisor.py
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/usr/bin/env ambari-python-wrap
-"""
-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.
-"""
-
-class StackAdvisor(object):
-
-  def recommendComponentLayout(self, services, hosts):
-    """Returns Services object with hostnames array populated for components"""
-    pass
-
-  def validateComponentLayout(self, services, hosts):
-    """Returns array of Validation objects about issues with hostnames components assigned to"""
-    pass
-
-  def recommendConfigurations(self, services, hosts):
-    """Returns Services object with configurations object populated"""
-    pass
-
-  def validateConfigurations(self, services, hosts):
-    """Returns array of Validation objects about issues with configuration values provided in services"""
-    pass
-

http://git-wip-us.apache.org/repos/asf/ambari/blob/d87cf7f8/ambari-server/src/main/resources/stacks/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/stack_advisor.py b/ambari-server/src/main/resources/stacks/stack_advisor.py
new file mode 100644
index 0000000..5f66fff
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/stack_advisor.py
@@ -0,0 +1,37 @@
+#!/usr/bin/env ambari-python-wrap
+"""
+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.
+"""
+
+class StackAdvisor(object):
+
+  def recommendComponentLayout(self, services, hosts):
+    """Returns Services object with hostnames array populated for components"""
+    pass
+
+  def validateComponentLayout(self, services, hosts):
+    """Returns array of Validation objects about issues with hostnames components assigned to"""
+    pass
+
+  def recommendConfigurations(self, services, hosts):
+    """Returns Services object with configurations object populated"""
+    pass
+
+  def validateConfigurations(self, services, hosts):
+    """Returns array of Validation objects about issues with configuration values provided in services"""
+    pass
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/d87cf7f8/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java
index 37d1af4..c08534c 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java
@@ -73,6 +73,7 @@ import com.google.inject.Injector;
 public class AmbariMetaInfoTest {
 
   private static final String STACK_NAME_HDP = "HDP";
+  private static final String STACK_NAME_XYZ = "XYZ";
   private static final String STACK_VERSION_HDP = "0.1";
   private static final String EXT_STACK_NAME = "2.0.6";
   private static final String STACK_VERSION_HDP_02 = "0.2";
@@ -88,7 +89,7 @@ public class AmbariMetaInfoTest {
   private static final String NON_EXT_VALUE = "XXX";
 
   private static final int REPOS_CNT = 3;
-  private static final int STACKS_NAMES_CNT = 1;
+  private static final int STACKS_NAMES_CNT = 2;
   private static final int PROPERTIES_CNT = 62;
   private static final int OS_CNT = 4;
 
@@ -408,6 +409,7 @@ public class AmbariMetaInfoTest {
     Set<Stack> stackNames = metaInfo.getStackNames();
     assertEquals(stackNames.size(), STACKS_NAMES_CNT);
     assertTrue(stackNames.contains(new Stack(STACK_NAME_HDP)));
+    assertTrue(stackNames.contains(new Stack(STACK_NAME_XYZ)));
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/ambari/blob/d87cf7f8/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
index 1bfc25a..5fdd619 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
@@ -156,7 +156,7 @@ public class AmbariManagementControllerTest {
   private static final String NAGIOS_SERVICE_NAME = "NAGIOS";
   private static final int STACK_VERSIONS_CNT = 12;
   private static final int REPOS_CNT = 3;
-  private static final int STACKS_CNT = 1;
+  private static final int STACKS_CNT = 2;
   private static final int STACK_PROPERTIES_CNT = 99;
   private static final int STACK_COMPONENTS_CNT = 4;
   private static final int OS_CNT = 2;

http://git-wip-us.apache.org/repos/asf/ambari/blob/d87cf7f8/ambari-server/src/test/python/TestStackAdvisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/TestStackAdvisor.py b/ambari-server/src/test/python/TestStackAdvisor.py
new file mode 100644
index 0000000..5a1a242
--- /dev/null
+++ b/ambari-server/src/test/python/TestStackAdvisor.py
@@ -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.
+'''
+
+from unittest import TestCase
+import os
+
+class TestStackAdvisorInitialization(TestCase):
+
+  def setUp(self):
+    import imp
+
+    self.test_directory = os.path.dirname(os.path.abspath(__file__))
+    stack_advisor_path = os.path.join(self.test_directory, '../../main/resources/scripts/stack_advisor.py')
+    with open(stack_advisor_path, 'rb') as fp:
+        self.stack_advisor = imp.load_module( 'stack_advisor', fp, stack_advisor_path, ('.py', 'rb', imp.PY_SOURCE) )
+
+  def test_stackAdvisorLoadedForNotHDPStack(self):
+    path_template = os.path.join(self.test_directory, '../resources/stacks/{0}/{1}/services/stack_advisor.py')
+    path_template_name = "STACK_ADVISOR_IMPL_PATH_TEMPLATE"
+    setattr(self.stack_advisor, path_template_name, path_template)
+    self.assertEquals(path_template, getattr(self.stack_advisor, path_template_name))
+    instantiate_stack_advisor_method_name = 'instantiateStackAdvisor'
+    instantiate_stack_advisor_method = getattr(self.stack_advisor, instantiate_stack_advisor_method_name)
+    stack_advisor = instantiate_stack_advisor_method("XYZ", "1.0.1", ["1.0.0"])
+    self.assertEquals("XYZ101StackAdvisor", stack_advisor.__class__.__name__)
+    services = {"Versions":
+                  {
+                    "stack_name":"XYZ",
+                    "stack_version":"1.0.1"
+                  },
+                "services":[
+                  {
+                    "StackServices":{
+                      "service_name":"YARN"
+                    },
+                    "components":[
+                      {
+                        "StackServiceComponents": {
+                          "component_name": "RESOURCEMANAGER"
+                        }
+                      },
+                      {
+                        "StackServiceComponents": {
+                          "component_name": "APP_TIMELINE_SERVER"
+                        }
+                      },
+                      {
+                        "StackServiceComponents": {
+                          "component_name":"YARN_CLIENT"
+                        }
+                      },
+                      {
+                        "StackServiceComponents": {
+                          "component_name": "NODEMANAGER"
+                        }
+                      }
+                    ]
+                  }
+                ]
+    }
+    hosts= {
+      "items": [
+        {"Hosts": {"host_name": "host1"}},
+        {"Hosts": {"host_name": "host2"}}
+      ]
+    }
+    config_recommendations = stack_advisor.recommendConfigurations(services, hosts)
+    yarn_configs = config_recommendations["recommendations"]["blueprint"]["configurations"]["yarn-site"]["properties"]
+    '''Check that value is populated from child class, not parent'''
+    self.assertEquals("-Xmx101m", yarn_configs["yarn.nodemanager.resource.memory-mb"])
+
+  def test_stackAdvisorSuperClassIsFoundAndReturnedAsDefaultImpl(self):
+    instantiate_stack_advisor_method_name = 'instantiateStackAdvisor'
+    instantiate_stack_advisor_method = getattr(self.stack_advisor, instantiate_stack_advisor_method_name)
+    '''Not existent stack - to return default implementation'''
+    default_stack_advisor = instantiate_stack_advisor_method("HDP1", "2.0.6", [])
+    self.assertEquals("StackAdvisor", default_stack_advisor.__class__.__name__)
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/d87cf7f8/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
index b5bdba6..d32fa56 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
@@ -26,7 +26,7 @@ class TestHDP206StackAdvisor(TestCase):
     import os
 
     testDirectory = os.path.dirname(os.path.abspath(__file__))
-    stackAdvisorPath = os.path.join(testDirectory, '../../../../../main/resources/stacks/HDP/stack_advisor.py')
+    stackAdvisorPath = os.path.join(testDirectory, '../../../../../main/resources/stacks/stack_advisor.py')
     hdp206StackAdvisorPath = os.path.join(testDirectory, '../../../../../main/resources/stacks/HDP/2.0.6/services/stack_advisor.py')
     hdp206StackAdvisorClassName = 'HDP206StackAdvisor'
     with open(stackAdvisorPath, 'rb') as fp:

http://git-wip-us.apache.org/repos/asf/ambari/blob/d87cf7f8/ambari-server/src/test/resources/stacks/XYZ/1.0.0/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/stacks/XYZ/1.0.0/services/stack_advisor.py b/ambari-server/src/test/resources/stacks/XYZ/1.0.0/services/stack_advisor.py
new file mode 100644
index 0000000..ba140bb
--- /dev/null
+++ b/ambari-server/src/test/resources/stacks/XYZ/1.0.0/services/stack_advisor.py
@@ -0,0 +1,67 @@
+#!/usr/bin/env ambari-python-wrap
+"""
+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.
+"""
+
+from stack_advisor import StackAdvisor
+
+class XYZ100StackAdvisor(StackAdvisor):
+
+  def recommendConfigurations(self, services, hosts):
+    stackName = services["Versions"]["stack_name"]
+    stackVersion = services["Versions"]["stack_version"]
+    hostsList = [host["Hosts"]["host_name"] for host in hosts["items"]]
+    servicesList = [service["StackServices"]["service_name"] for service in services["services"]]
+
+    recommendations = {
+      "Versions": {"stack_name": stackName, "stack_version": stackVersion},
+      "hosts": hostsList,
+      "services": servicesList,
+      "recommendations": {
+        "blueprint": {
+          "configurations": {},
+          "host_groups": []
+        },
+        "blueprint_cluster_binding": {
+          "host_groups": []
+        }
+      }
+    }
+
+    configurations = recommendations["recommendations"]["blueprint"]["configurations"]
+    for service in servicesList:
+      calculation = self.recommendServiceConfigurations(service)
+      if calculation is not None:
+        calculation(configurations)
+
+    return recommendations
+
+  def recommendServiceConfigurations(self, service):
+    return {
+      "YARN": self.recommendYARNConfigurations,
+    }.get(service, None)
+
+  def putProperty(self, config, configType):
+    config[configType] = {"properties": {}}
+    def appendProperty(key, value):
+      config[configType]["properties"][key] = str(value)
+    return appendProperty
+
+  def recommendYARNConfigurations(self, configurations):
+    putYarnProperty = self.putProperty(configurations, "yarn-site")
+    putYarnProperty('yarn.nodemanager.resource.memory-mb', "-Xmx100m")
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/d87cf7f8/ambari-server/src/test/resources/stacks/XYZ/1.0.1/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/stacks/XYZ/1.0.1/services/stack_advisor.py b/ambari-server/src/test/resources/stacks/XYZ/1.0.1/services/stack_advisor.py
new file mode 100644
index 0000000..74a4b31
--- /dev/null
+++ b/ambari-server/src/test/resources/stacks/XYZ/1.0.1/services/stack_advisor.py
@@ -0,0 +1,30 @@
+#!/usr/bin/env ambari-python-wrap
+"""
+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 re
+import socket
+import sys
+
+from stack_advisor import StackAdvisor
+
+class XYZ101StackAdvisor(XYZ100StackAdvisor):
+
+  def recommendYARNConfigurations(self, configurations):
+    putYarnProperty = self.putProperty(configurations, "yarn-site")
+    putYarnProperty('yarn.nodemanager.resource.memory-mb', "-Xmx101m")


[38/45] git commit: AMBARI-7056. Need for a separate config file that comprises of cluster specific properties (aonishuk)

Posted by jo...@apache.org.
AMBARI-7056. Need for a separate config file that comprises of cluster specific properties (aonishuk)


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

Branch: refs/heads/branch-alerts-dev
Commit: 6bd0394a5f2254da2421f066473f680dc32772a1
Parents: 1b017b7
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Thu Aug 28 18:05:43 2014 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Thu Aug 28 18:05:43 2014 +0300

----------------------------------------------------------------------
 .../ambari/server/api/query/QueryImpl.java      |   1 -
 .../resources/ResourceInstanceFactoryImpl.java  |   4 +
 ...ackLevelConfigurationResourceDefinition.java |  53 ++++++
 .../StackVersionResourceDefinition.java         |   1 +
 .../server/api/services/AmbariMetaInfo.java     |  34 +++-
 .../server/api/services/StacksService.java      |  35 +++-
 .../server/api/util/StackExtensionHelper.java   | 105 ++++++++---
 .../controller/AmbariManagementController.java  |   8 +
 .../AmbariManagementControllerImpl.java         |  44 +++++
 .../StackLevelConfigurationRequest.java         |  42 +++++
 .../StackLevelConfigurationResponse.java        |  37 ++++
 .../server/controller/StackVersionResponse.java |  14 +-
 .../AbstractControllerResourceProvider.java     |   2 +
 ...StackLevelConfigurationResourceProvider.java | 159 ++++++++++++++++
 .../internal/StackVersionResourceProvider.java  |   6 +
 .../ambari/server/controller/spi/Resource.java  |   4 +-
 .../apache/ambari/server/state/ServiceInfo.java |   1 +
 .../apache/ambari/server/state/StackInfo.java   |  26 ++-
 .../src/main/resources/key_properties.json      |   5 +
 .../src/main/resources/properties.json          |  11 ++
 .../HDP/1.3.2/configuration/cluster-env.xml     |  49 +++++
 .../HDP/2.0.6/configuration/cluster-env.xml     |  49 +++++
 .../ambari/server/api/query/QueryImplTest.java  |   2 +-
 .../api/util/StackExtensionHelperTest.java      |  23 +--
 .../internal/AbstractResourceProviderTest.java  |  45 +++++
 ...kLevelConfigurationResourceProviderTest.java | 181 +++++++++++++++++++
 26 files changed, 892 insertions(+), 49 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6bd0394a/ambari-server/src/main/java/org/apache/ambari/server/api/query/QueryImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/query/QueryImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/api/query/QueryImpl.java
index 261559a..6dfdb49 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/query/QueryImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/query/QueryImpl.java
@@ -895,7 +895,6 @@ public class QueryImpl implements Query, ResourceInstance {
         mapTemporalInfo.put(propertyId, globalTemporalInfo);
       }
     }
-
     return PropertyHelper.getReadRequest(setProperties, requestInfoProperties, mapTemporalInfo);
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bd0394a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
index 13fff1d..f85c0ea 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
@@ -141,6 +141,10 @@ public class ResourceInstanceFactoryImpl implements ResourceInstanceFactory {
       case StackVersion:
         resourceDefinition = new StackVersionResourceDefinition();
         break;
+        
+      case StackLevelConfiguration:
+        resourceDefinition = new StackLevelConfigurationResourceDefinition();
+        break;
 
       case StackService:
         resourceDefinition = new StackServiceResourceDefinition();

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bd0394a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackLevelConfigurationResourceDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackLevelConfigurationResourceDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackLevelConfigurationResourceDefinition.java
new file mode 100644
index 0000000..9265234
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackLevelConfigurationResourceDefinition.java
@@ -0,0 +1,53 @@
+/**
+ * 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.
+ */
+
+package org.apache.ambari.server.api.resources;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.ambari.server.controller.spi.Resource;
+import org.apache.ambari.server.controller.spi.Resource.Type;
+
+public class StackLevelConfigurationResourceDefinition extends BaseStacksResourceDefinition {
+
+  public StackLevelConfigurationResourceDefinition(Type resourceType) {
+    super(Resource.Type.StackLevelConfiguration);
+  }
+
+  public StackLevelConfigurationResourceDefinition() {
+    super(Resource.Type.StackLevelConfiguration);
+  }
+
+  @Override
+  public String getPluralName() {
+    return "configurations";
+  }
+
+  @Override
+  public String getSingularName() {
+    return "configuration";
+  }
+  /*
+  @Override
+  public Set<SubResourceDefinition> getSubResourceDefinitions() {
+    Set<SubResourceDefinition> setChildren = new HashSet<SubResourceDefinition>();
+    return setChildren;
+  }
+  */
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bd0394a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackVersionResourceDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackVersionResourceDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackVersionResourceDefinition.java
index d641e4c..5bf3bac 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackVersionResourceDefinition.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackVersionResourceDefinition.java
@@ -51,6 +51,7 @@ public class StackVersionResourceDefinition extends BaseStacksResourceDefinition
     
     setChildren.add(new SubResourceDefinition(Resource.Type.OperatingSystem));
     setChildren.add(new SubResourceDefinition(Resource.Type.StackService));
+    setChildren.add(new SubResourceDefinition(Resource.Type.StackLevelConfiguration));
 
     return setChildren;
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bd0394a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
index 56b866d..cb27100 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
@@ -665,13 +665,21 @@ public class AmbariMetaInfo {
 
   public Set<PropertyInfo> getProperties(String stackName, String version, String serviceName)
       throws AmbariException {
-
     ServiceInfo serviceInfo = getServiceInfo(stackName, version, serviceName);
     List<PropertyInfo> properties = serviceInfo.getProperties();
     Set<PropertyInfo> propertiesResult = new HashSet<PropertyInfo>(properties);
 
     return propertiesResult;
   }
+  
+  public Set<PropertyInfo> getStackProperties(String stackName, String version)
+      throws AmbariException {
+    StackInfo stackInfo = getStackInfo(stackName, version);
+    List<PropertyInfo> properties = stackInfo.getProperties();
+    Set<PropertyInfo> propertiesResult = new HashSet<PropertyInfo>(properties);
+
+    return propertiesResult;
+  }
 
   public Set<PropertyInfo> getPropertiesByName(String stackName, String version, String serviceName, String propertyName)
       throws AmbariException {
@@ -698,6 +706,30 @@ public class AmbariMetaInfo {
 
     return propertyResult;
   }
+  
+  public Set<PropertyInfo> getStackPropertiesByName(String stackName, String version, String propertyName)
+      throws AmbariException {
+    Set<PropertyInfo> properties = getStackProperties(stackName, version);
+
+    if (properties.size() == 0)
+      throw new StackAccessException("stackName=" + stackName
+          + ", stackVersion=" + version
+          + ", propertyName=" + propertyName);
+
+    Set<PropertyInfo> propertyResult = new HashSet<PropertyInfo>();
+
+    for (PropertyInfo property : properties) {
+      if (property.getName().equals(propertyName))
+        propertyResult.add(property);
+    }
+
+    if (propertyResult.isEmpty())
+      throw new StackAccessException("stackName=" + stackName
+          + ", stackVersion=" + version
+          + ", propertyName=" + propertyName);
+
+    return propertyResult;
+  }
 
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bd0394a/ambari-server/src/main/java/org/apache/ambari/server/api/services/StacksService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/StacksService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/StacksService.java
index 822199c..3df1eaf 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/StacksService.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/StacksService.java
@@ -92,7 +92,6 @@ public class StacksService extends BaseService {
         createStackVersionResource(stackName, stackVersion));
   }
 
-
   @GET
   @Path("{stackName}/versions/{stackVersion}/operating_systems/{osType}/repositories")
   @Produces("text/plain")
@@ -132,6 +131,30 @@ public class StacksService extends BaseService {
     return handleRequest(headers, body, new StackUriInfo(ui), Request.Type.PUT,
         createRepositoryResource(stackName, stackVersion, osType, repoId));
   }
+  
+  @GET
+  @Path("{stackName}/versions/{stackVersion}/configurations")
+  @Produces("text/plain")
+  public Response getStackLevelConfigurations(String body, @Context HttpHeaders headers,
+                                   @Context UriInfo ui, @PathParam("stackName") String stackName,
+                                   @PathParam("stackVersion") String stackVersion) {
+
+    return handleRequest(headers, body, new StackUriInfo(ui), Request.Type.GET,
+        createStackLevelConfigurationsResource(stackName, stackVersion, null));
+  }
+  
+  @GET
+  @Path("{stackName}/versions/{stackVersion}/configurations/{propertyName}")
+  @Produces("text/plain")
+  public Response getStackLevelConfiguration(String body, @Context HttpHeaders headers,
+                                        @Context UriInfo ui, @PathParam("stackName") String stackName,
+                                        @PathParam("stackVersion") String stackVersion,
+                                        @PathParam("serviceName") String serviceName,
+                                        @PathParam("propertyName") String propertyName) {
+
+    return handleRequest(headers, body, new StackUriInfo(ui), Request.Type.GET,
+        createStackLevelConfigurationsResource(stackName, stackVersion, propertyName));
+  }
 
 
   @GET
@@ -343,6 +366,16 @@ public class StacksService extends BaseService {
 
     return createResource(Resource.Type.StackVersion, mapIds);
   }
+  
+  ResourceInstance createStackLevelConfigurationsResource(String stackName,
+      String stackVersion, String propertyName) {
+    Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>();
+    mapIds.put(Resource.Type.Stack, stackName);
+    mapIds.put(Resource.Type.StackVersion, stackVersion);
+    mapIds.put(Resource.Type.StackLevelConfiguration, propertyName);
+
+    return createResource(Resource.Type.StackLevelConfiguration, mapIds);
+  }
 
   ResourceInstance createStackResource(String stackName) {
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bd0394a/ambari-server/src/main/java/org/apache/ambari/server/api/util/StackExtensionHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/util/StackExtensionHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/api/util/StackExtensionHelper.java
index fb3ddc9..c4dd022 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/util/StackExtensionHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/util/StackExtensionHelper.java
@@ -130,6 +130,15 @@ public class StackExtensionHelper {
     stackParentsMap = getParentStacksInOrder(stackVersionMap.values());
   }
 
+  void mergeStacks(StackInfo parentStack,
+      StackInfo resultStack) {
+    if(parentStack.getConfigTypes() != null) {
+      resultStack.getConfigTypes().putAll(parentStack.getConfigTypes());
+    }
+    List<PropertyInfo> mergedProperties = new ArrayList<PropertyInfo>();
+    mergeProperties(resultStack.getProperties(), parentStack.getProperties(), mergedProperties);
+    resultStack.setProperties(mergedProperties);
+  }
 
   ServiceInfo mergeServices(ServiceInfo parentService,
                                     ServiceInfo childService) {
@@ -218,12 +227,28 @@ public class StackExtensionHelper {
 
     populateComponents(mergedServiceInfo, parentService, childService);
 
+    mergeProperties(childService.getProperties(), parentService.getProperties(), mergedServiceInfo.getProperties());
+
+    // Add all parent config dependencies
+    if (parentService.getConfigDependencies() != null && !parentService
+        .getConfigDependencies().isEmpty()) {
+      for (String configDep : parentService.getConfigDependencies()) {
+        if (!mergedServiceInfo.getConfigDependencies().contains(configDep)) {
+          mergedServiceInfo.getConfigDependencies().add(configDep);
+        }
+      }
+    }
+    return mergedServiceInfo;
+  }
+  
+  public void mergeProperties(List<PropertyInfo> childProperties, 
+      List<PropertyInfo> parentProperties, List<PropertyInfo> mergedProperties) {
     // Add child properties not deleted
     Map<String, Set<String>> deleteMap = new HashMap<String, Set<String>>();
     Map<String, Set<String>> appendMap = new HashMap<String, Set<String>>();
-    for (PropertyInfo propertyInfo : childService.getProperties()) {
+    for (PropertyInfo propertyInfo : childProperties) {
       if (!propertyInfo.isDeleted()) {
-        mergedServiceInfo.getProperties().add(propertyInfo);
+        mergedProperties.add(propertyInfo);
         if (appendMap.containsKey(propertyInfo.getName())) {
           appendMap.get(propertyInfo.getName()).add(propertyInfo.getFilename());
         } else {
@@ -242,24 +267,14 @@ public class StackExtensionHelper {
       }
     }
     // Add all parent properties
-    for (PropertyInfo parentPropertyInfo : parentService.getProperties()) {
+    for (PropertyInfo parentPropertyInfo : parentProperties) {
       if (!deleteMap.containsKey(parentPropertyInfo.getName()) && !(appendMap
           .containsKey(parentPropertyInfo.getName())
         && appendMap.get(parentPropertyInfo.getName())
           .contains(parentPropertyInfo.getFilename()))) {
-        mergedServiceInfo.getProperties().add(parentPropertyInfo);
+        mergedProperties.add(parentPropertyInfo);
       }
     }
-    // Add all parent config dependencies
-    if (parentService.getConfigDependencies() != null && !parentService
-        .getConfigDependencies().isEmpty()) {
-      for (String configDep : parentService.getConfigDependencies()) {
-        if (!mergedServiceInfo.getConfigDependencies().contains(configDep)) {
-          mergedServiceInfo.getConfigDependencies().add(configDep);
-        }
-      }
-    }
-    return mergedServiceInfo;
   }
 
 
@@ -418,6 +433,9 @@ public class StackExtensionHelper {
     while(lt.hasPrevious()) {
       StackInfo parentStack = lt.previous();
       List<ServiceInfo> serviceInfoList = parentStack.getServices();
+      
+      mergeStacks(parentStack, stackInfo);
+      
       for (ServiceInfo service : serviceInfoList) {
         ServiceInfo existingService = serviceInfoMap.get(service.getName());
         if (service.isDeleted()) {
@@ -699,6 +717,8 @@ public class StackExtensionHelper {
               File.separator + AmbariMetaInfo.RCO_FILE_NAME;
       if (new File(rcoFileLocation).exists())
         stackInfo.setRcoFileLocation(rcoFileLocation);
+      
+      setStackPropertiesFromConfigs(stackInfo);
     }
 
     try {
@@ -711,6 +731,42 @@ public class StackExtensionHelper {
     }
     return stackInfo;
   }
+  
+  private void populateStackProperties(StackInfo stackInfo, File configFile) throws JAXBException {
+    ConfigurationXml configuration = unmarshal(ConfigurationXml.class, configFile);
+    String fileName = configFile.getName();
+    stackInfo.getProperties().addAll(getProperties(configuration, fileName));
+    int extIndex = fileName.indexOf(AmbariMetaInfo.SERVICE_CONFIG_FILE_NAME_POSTFIX);
+    String configType = fileName.substring(0, extIndex);
+
+    addConfigType(stackInfo.getConfigTypes(), configType);
+    setConfigTypeAttributes(stackInfo.getConfigTypes(), configuration, configType);
+  }
+  
+  /**
+   * Get all properties from all "configs/*.xml" files. See {@see AmbariMetaInfo#SERVICE_CONFIG_FILE_NAME_POSTFIX}
+   */
+  void setStackPropertiesFromConfigs(StackInfo stackInfo) {
+    File configsFolder = new File(stackRoot.getAbsolutePath() + File
+        .separator + stackInfo.getName() + File.separator + stackInfo.getVersion()
+        + File.separator + AmbariMetaInfo.SERVICE_CONFIG_FOLDER_NAME);
+    
+    if (!configsFolder.exists() || !configsFolder.isDirectory())
+      return;
+    
+    File[] configFiles = configsFolder.listFiles(AmbariMetaInfo.FILENAME_FILTER);
+    if (configFiles != null) {
+      for (File configFile : configFiles) {
+        if (configFile.getName().endsWith(AmbariMetaInfo.SERVICE_CONFIG_FILE_NAME_POSTFIX)) {
+          try {
+            populateStackProperties(stackInfo, configFile);
+          } catch (Exception e) {
+            LOG.error("Could not load configuration for " + configFile, e);
+          }
+        }
+      }
+    }
+  }
 
   private List<PropertyInfo> getProperties(ConfigurationXml configuration, String fileName) {
     List<PropertyInfo> list = new ArrayList<PropertyInfo>();
@@ -730,33 +786,27 @@ public class StackExtensionHelper {
     serviceInfo.getProperties().addAll(getProperties(configuration, fileName));
     int extIndex = fileName.indexOf(AmbariMetaInfo.SERVICE_CONFIG_FILE_NAME_POSTFIX);
     String configType = fileName.substring(0, extIndex);
-   
-    addConfigType(serviceInfo, configType);
-    setConfigTypeAttributes(serviceInfo, configuration, configType);
+
+    addConfigType(serviceInfo.getConfigTypes(), configType);
+    setConfigTypeAttributes(serviceInfo.getConfigTypes(), configuration, configType);
   }
   
-  void setConfigTypeAttributes(ServiceInfo serviceInfo, ConfigurationXml configuration, String configType) {
+  void setConfigTypeAttributes(Map<String, Map<String, Map<String, String>>> configTypes, ConfigurationXml configuration, String configType) {
     for (Map.Entry<QName, String> attribute : configuration.getAttributes().entrySet()) {
       for (Supports supportsProperty : Supports.values()) {
         String attributeName = attribute.getKey().getLocalPart();
         String attributeValue = attribute.getValue();
         if (attributeName.equals(supportsProperty.getXmlAttributeName())) {
-          addConfigTypeProperty(serviceInfo, configType, Supports.KEYWORD,
+          addConfigTypeProperty(configTypes, configType, Supports.KEYWORD,
               supportsProperty.getPropertyName(), Boolean.valueOf(attributeValue).toString());
         }
       }
     }
   }
   
-  void addConfigType(ServiceInfo serviceInfo, String configType) {
-    if(serviceInfo.getConfigTypes() == null) {
-      serviceInfo.setConfigTypes(new HashMap<String, Map<String, Map<String, String>>>());
-    }
-    
-    Map<String, Map<String, Map<String, String>>> configTypes = serviceInfo.getConfigTypes();
+  void addConfigType(Map<String, Map<String, Map<String, String>>> configTypes, String configType) {
     configTypes.put(configType, new HashMap<String, Map<String, String>>());
     
-    
     Map<String, Map<String, String>> properties = configTypes.get(configType);
     Map<String, String> supportsProperties = new HashMap<String, String>();
     for (Supports supportsProperty : Supports.values()) {
@@ -793,9 +843,8 @@ public class StackExtensionHelper {
   /**
    * Put new property entry to ServiceInfo#configTypes collection for specified configType
    */
-  void addConfigTypeProperty(ServiceInfo serviceInfo, String configType,
+  void addConfigTypeProperty(Map<String, Map<String, Map<String, String>>> configTypes, String configType,
       String propertiesGroupName, String key, String value) {
-   Map<String, Map<String, Map<String, String>>> configTypes = serviceInfo.getConfigTypes();
    if (configTypes != null && configTypes.containsKey(configType)) {
       Map<String, Map<String, String>> configDependencyProperties = configTypes.get(configType);
       if (!configDependencyProperties.containsKey(propertiesGroupName)) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bd0394a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
index bee118e..1a5d933 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
@@ -712,5 +712,13 @@ public interface AmbariManagementController {
    * @throws AmbariException if synchronization data was invalid
    */
   public void synchronizeLdapUsersAndGroups(Set<String> users, Set<String> groups) throws AmbariException;
+
+  /**
+   * Get configurations which are specific for a cluster (!not a service).
+   * @param requests
+   * @return
+   * @throws AmbariException
+   */
+  public Set<StackConfigurationResponse> getStackLevelConfigurations(Set<StackLevelConfigurationRequest> requests) throws AmbariException;
 }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bd0394a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index c6b2f9f..cc122f6 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -3286,6 +3286,50 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
     }
     return response;
   }
+  
+  @Override
+  public Set<StackConfigurationResponse> getStackLevelConfigurations(
+      Set<StackLevelConfigurationRequest> requests) throws AmbariException {
+    Set<StackConfigurationResponse> response = new HashSet<StackConfigurationResponse>();
+    for (StackLevelConfigurationRequest request : requests) {
+
+      String stackName    = request.getStackName();
+      String stackVersion = request.getStackVersion();
+      
+      Set<StackConfigurationResponse> stackConfigurations = getStackLevelConfigurations(request);
+
+      for (StackConfigurationResponse stackConfigurationResponse : stackConfigurations) {
+        stackConfigurationResponse.setStackName(stackName);
+        stackConfigurationResponse.setStackVersion(stackVersion);
+      }
+
+      response.addAll(stackConfigurations);
+    }
+
+    return response;
+  }
+
+  private Set<StackConfigurationResponse> getStackLevelConfigurations(
+      StackLevelConfigurationRequest request) throws AmbariException {
+
+    Set<StackConfigurationResponse> response = new HashSet<StackConfigurationResponse>();
+
+    String stackName = request.getStackName();
+    String stackVersion = request.getStackVersion();
+    String propertyName = request.getPropertyName();
+
+    Set<PropertyInfo> properties;
+    if (propertyName != null) {
+      properties = ambariMetaInfo.getStackPropertiesByName(stackName, stackVersion, propertyName);
+    } else {
+      properties = ambariMetaInfo.getStackProperties(stackName, stackVersion);
+    }
+    for (PropertyInfo property: properties) {
+      response.add(property.convertToResponse());
+    }
+
+    return response;
+  }
 
   @Override
   public Set<StackConfigurationResponse> getStackConfigurations(

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bd0394a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackLevelConfigurationRequest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackLevelConfigurationRequest.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackLevelConfigurationRequest.java
new file mode 100644
index 0000000..dcace09
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackLevelConfigurationRequest.java
@@ -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.
+ */
+
+
+package org.apache.ambari.server.controller;
+
+public class StackLevelConfigurationRequest extends StackVersionRequest {
+
+  private String propertyName;
+
+  public StackLevelConfigurationRequest(String stackName, String stackVersion,
+      String propertyName) {
+    super(stackName, stackVersion);
+    
+    setPropertyName(propertyName);
+
+  }
+
+  public String getPropertyName() {
+    return propertyName;
+  }
+
+  public void setPropertyName(String propertyName) {
+    this.propertyName = propertyName;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bd0394a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackLevelConfigurationResponse.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackLevelConfigurationResponse.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackLevelConfigurationResponse.java
new file mode 100644
index 0000000..7229197
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackLevelConfigurationResponse.java
@@ -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.
+ */
+
+package org.apache.ambari.server.controller;
+
+
+import java.util.Map;
+
+public class StackLevelConfigurationResponse extends StackConfigurationResponse {
+  public StackLevelConfigurationResponse(String propertyName,
+      String propertyValue, String propertyDescription, String type,
+      Boolean isRequired, String propertyType,
+      Map<String, String> propertyAttributes) {
+    super(propertyName, propertyValue, propertyDescription, type, isRequired,
+        propertyType, propertyAttributes);
+  }
+  
+  public StackLevelConfigurationResponse(String propertyName, String propertyValue, String propertyDescription,
+      String type, Map<String, String> propertyAttributes) {
+    super(propertyName, propertyValue, propertyDescription, type, propertyAttributes);
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bd0394a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackVersionResponse.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackVersionResponse.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackVersionResponse.java
index 84105fc..a338a12 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackVersionResponse.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackVersionResponse.java
@@ -18,6 +18,8 @@
 
 package org.apache.ambari.server.controller;
 
+import java.util.Map;
+
 
 public class StackVersionResponse {
 
@@ -26,13 +28,16 @@ public class StackVersionResponse {
   private String minUpgradeVersion;
   private boolean active;
   private String parentVersion;
+  private Map<String, Map<String, Map<String, String>>> configTypes;
 
   public StackVersionResponse(String stackVersion, String minUpgradeVersion,
-                              boolean active, String parentVersion) {
+                              boolean active, String parentVersion, 
+                              Map<String, Map<String, Map<String, String>>> configTypes) {
     setStackVersion(stackVersion);
     setMinUpgradeVersion(minUpgradeVersion);
     setActive(active);
     setParentVersion(parentVersion);
+    setConfigTypes(configTypes);
   }
 
   public String getStackName() {
@@ -74,4 +79,11 @@ public class StackVersionResponse {
   public void setParentVersion(String parentVersion) {
     this.parentVersion = parentVersion;
   }
+  public Map<String, Map<String, Map<String, String>>> getConfigTypes() {
+    return configTypes;
+  }
+  public void setConfigTypes(
+      Map<String, Map<String, Map<String, String>>> configTypes) {
+    this.configTypes = configTypes;
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bd0394a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java
index 71ddc8d..2fa38c5 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java
@@ -127,6 +127,8 @@ public abstract class AbstractControllerResourceProvider extends AbstractResourc
         return new StackConfigurationResourceProvider(propertyIds, keyPropertyIds, managementController);
       case OperatingSystem:
         return new OperatingSystemResourceProvider(propertyIds, keyPropertyIds, managementController);
+      case StackLevelConfiguration:
+        return new StackLevelConfigurationResourceProvider(propertyIds, keyPropertyIds, managementController);
       case Repository:
         return new RepositoryResourceProvider(propertyIds, keyPropertyIds, managementController);
       case RootService:

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bd0394a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackLevelConfigurationResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackLevelConfigurationResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackLevelConfigurationResourceProvider.java
new file mode 100644
index 0000000..116f589
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackLevelConfigurationResourceProvider.java
@@ -0,0 +1,159 @@
+/**
+ * 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.
+ */
+
+
+package org.apache.ambari.server.controller.internal;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.controller.AmbariManagementController;
+import org.apache.ambari.server.controller.StackConfigurationResponse;
+import org.apache.ambari.server.controller.StackLevelConfigurationRequest;
+import org.apache.ambari.server.controller.spi.NoSuchParentResourceException;
+import org.apache.ambari.server.controller.spi.NoSuchResourceException;
+import org.apache.ambari.server.controller.spi.Predicate;
+import org.apache.ambari.server.controller.spi.Request;
+import org.apache.ambari.server.controller.spi.Resource;
+import org.apache.ambari.server.controller.spi.Resource.Type;
+import org.apache.ambari.server.controller.spi.SystemException;
+import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
+import org.apache.ambari.server.controller.utilities.PropertyHelper;
+
+public class StackLevelConfigurationResourceProvider extends
+    ReadOnlyResourceProvider {
+
+  public static final String STACK_NAME_PROPERTY_ID = PropertyHelper
+      .getPropertyId("StackLevelConfigurations", "stack_name");
+
+  public static final String STACK_VERSION_PROPERTY_ID = PropertyHelper
+      .getPropertyId("StackLevelConfigurations", "stack_version");
+
+  public static final String PROPERTY_NAME_PROPERTY_ID = PropertyHelper
+      .getPropertyId("StackLevelConfigurations", "property_name");
+
+  public static final String PROPERTY_VALUE_PROPERTY_ID = PropertyHelper
+      .getPropertyId("StackLevelConfigurations", "property_value");
+
+  public static final String PROPERTY_DESCRIPTION_PROPERTY_ID = PropertyHelper
+      .getPropertyId("StackLevelConfigurations", "property_description");
+
+  public static final String PROPERTY_TYPE_PROPERTY_ID = PropertyHelper
+      .getPropertyId("StackLevelConfigurations", "type");
+
+  public static final String PROPERTY_FINAL_PROPERTY_ID = PropertyHelper
+      .getPropertyId("StackLevelConfigurations", "final");
+
+
+  private static Set<String> pkPropertyIds = new HashSet<String>(
+      Arrays.asList(new String[] { STACK_NAME_PROPERTY_ID,
+          STACK_VERSION_PROPERTY_ID, PROPERTY_NAME_PROPERTY_ID }));
+
+  protected StackLevelConfigurationResourceProvider(Set<String> propertyIds,
+      Map<Type, String> keyPropertyIds,
+      AmbariManagementController managementController) {
+    super(propertyIds, keyPropertyIds, managementController);
+  }
+
+
+  @Override
+  public Set<Resource> getResources(Request request, Predicate predicate)
+      throws SystemException, UnsupportedPropertyException,
+      NoSuchResourceException, NoSuchParentResourceException {
+
+    final Set<StackLevelConfigurationRequest> requests = new HashSet<StackLevelConfigurationRequest>();
+
+    if (predicate == null) {
+      requests.add(getRequest(Collections.<String, Object>emptyMap()));
+    } else {
+      for (Map<String, Object> propertyMap : getPropertyMaps(predicate)) {
+        requests.add(getRequest(propertyMap));
+      }
+    }
+
+    Set<String> requestedIds = getRequestPropertyIds(request, predicate);
+
+    Set<StackConfigurationResponse> responses = getResources(new Command<Set<StackConfigurationResponse>>() {
+      @Override
+      public Set<StackConfigurationResponse> invoke() throws AmbariException {
+        return getManagementController().getStackLevelConfigurations(requests);
+      }
+    });
+
+    Set<Resource> resources = new HashSet<Resource>();
+    
+    for (StackConfigurationResponse response : responses) {
+      Resource resource = new ResourceImpl(Resource.Type.StackLevelConfiguration);
+
+      setResourceProperty(resource, STACK_NAME_PROPERTY_ID,
+          response.getStackName(), requestedIds);
+
+      setResourceProperty(resource, STACK_VERSION_PROPERTY_ID,
+          response.getStackVersion(), requestedIds);
+
+      setResourceProperty(resource, PROPERTY_NAME_PROPERTY_ID,
+          response.getPropertyName(), requestedIds);
+
+      setResourceProperty(resource, PROPERTY_VALUE_PROPERTY_ID,
+          response.getPropertyValue(), requestedIds);
+
+      setResourceProperty(resource, PROPERTY_DESCRIPTION_PROPERTY_ID,
+          response.getPropertyDescription(), requestedIds);
+      
+      setResourceProperty(resource, PROPERTY_TYPE_PROPERTY_ID,
+          response.getType(), requestedIds);
+
+      setDefaultPropertiesAttributes(resource, requestedIds);
+
+      for (Map.Entry<String, String> attribute : response.getPropertyAttributes().entrySet()) {
+        setResourceProperty(resource, PropertyHelper.getPropertyId("StackLevelConfigurations", attribute.getKey()),
+            attribute.getValue(), requestedIds);
+      }
+
+      resources.add(resource);
+    }
+
+    return resources;
+  }
+
+  /**
+   * Set default values for properties attributes before applying original ones
+   * to prevent absence in case of empty attributes map
+   */
+  private void setDefaultPropertiesAttributes(Resource resource, Set<String> requestedIds) {
+    setResourceProperty(resource, PROPERTY_FINAL_PROPERTY_ID,
+        "false", requestedIds);
+  }
+
+  private StackLevelConfigurationRequest getRequest(Map<String, Object> properties) {
+    return new StackLevelConfigurationRequest(
+        (String) properties.get(STACK_NAME_PROPERTY_ID),
+        (String) properties.get(STACK_VERSION_PROPERTY_ID),
+        (String) properties.get(PROPERTY_NAME_PROPERTY_ID));
+  }
+
+  @Override
+  protected Set<String> getPKPropertyIds() {
+    return pkPropertyIds;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bd0394a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackVersionResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackVersionResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackVersionResourceProvider.java
index 9cef695..1442a0c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackVersionResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackVersionResourceProvider.java
@@ -58,6 +58,9 @@ public class StackVersionResourceProvider extends ReadOnlyResourceProvider {
 
   private static final String STACK_ACTIVE_PROPERTY_ID = PropertyHelper
       .getPropertyId("Versions", "active");
+  
+  private static final String STACK_CONFIG_TYPES = PropertyHelper
+      .getPropertyId("Versions", "config_types");
 
   private static Set<String> pkPropertyIds = new HashSet<String>(
       Arrays.asList(new String[] { STACK_NAME_PROPERTY_ID,
@@ -109,6 +112,9 @@ public class StackVersionResourceProvider extends ReadOnlyResourceProvider {
 
       setResourceProperty(resource, STACK_PARENT_PROPERTY_ID,
         response.getParentVersion(), requestedIds);
+      
+      setResourceProperty(resource, STACK_CONFIG_TYPES,
+          response.getConfigTypes(), requestedIds);
 
       resources.add(resource);
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bd0394a/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java
index b10b4bc..a14f1f0 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java
@@ -120,7 +120,8 @@ public interface Resource {
     ViewPrivilege,
     ViewPermission,
     Controller,
-    ClientConfig;
+    ClientConfig,
+    StackLevelConfiguration;
 
     /**
      * Get the {@link Type} that corresponds to this InternalType.
@@ -202,6 +203,7 @@ public interface Resource {
     public static final Type ViewPermission = InternalType.ViewPermission.getType();
     public static final Type Controller = InternalType.Controller.getType();
     public static final Type ClientConfig = InternalType.ClientConfig.getType();
+    public static final Type StackLevelConfiguration = InternalType.StackLevelConfiguration.getType();
 
     /**
      * The type name.

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bd0394a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
index de70620..ae746d6 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
@@ -259,6 +259,7 @@ public class ServiceInfo {
   }
   
   public Map<String, Map<String, Map<String, String>>> getConfigTypes() {
+    if (configTypes == null) configTypes = new HashMap<String, Map<String, Map<String, String>>>();
     return configTypes;
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bd0394a/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java
index cc1a45e..242cfcc 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java
@@ -19,7 +19,9 @@
 package org.apache.ambari.server.state;
 
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import org.apache.ambari.server.controller.StackVersionResponse;
 
@@ -32,6 +34,9 @@ public class StackInfo implements Comparable<StackInfo>{
   private List<RepositoryInfo> repositories;
   private List<ServiceInfo> services;
   private String parentStackVersion;
+  // stack-level properties
+  private List<PropertyInfo> properties;
+  private Map<String, Map<String, Map<String, String>>> configTypes;
 
   /**
    * Meaning: stores subpath from stack root to exact hooks folder for stack. These hooks are
@@ -72,6 +77,25 @@ public class StackInfo implements Comparable<StackInfo>{
   public synchronized void setServices(List<ServiceInfo> services) {
     this.services = services;
   }
+  
+  public List<PropertyInfo> getProperties() {
+    if (properties == null) properties = new ArrayList<PropertyInfo>();
+    return properties;
+  }
+
+  public void setProperties(List<PropertyInfo> properties) {
+    this.properties = properties;
+  }
+  
+  public Map<String, Map<String, Map<String, String>>> getConfigTypes() {
+    if (configTypes == null) configTypes = new HashMap<String, Map<String, Map<String, String>>>();
+    return configTypes;
+  }
+
+  public void setConfigTypes(
+      Map<String, Map<String, Map<String, String>>> configTypes) {
+    this.configTypes = configTypes;
+  }
 
   @Override
   public String toString() {
@@ -117,7 +141,7 @@ public class StackInfo implements Comparable<StackInfo>{
   public StackVersionResponse convertToResponse() {
 
     return new StackVersionResponse(getVersion(), getMinUpgradeVersion(),
-      isActive(), getParentStackVersion());
+      isActive(), getParentStackVersion(), getConfigTypes());
   }
 
   public String getMinUpgradeVersion() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bd0394a/ambari-server/src/main/resources/key_properties.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/key_properties.json b/ambari-server/src/main/resources/key_properties.json
index 06ebb61..ef698c5 100644
--- a/ambari-server/src/main/resources/key_properties.json
+++ b/ambari-server/src/main/resources/key_properties.json
@@ -157,5 +157,10 @@
     "Service": "ServiceComponentInfo/service_name",
     "Component": "ServiceComponentInfo/component_name",
     "Host": "HostRoles/host_name"
+  },
+  "StackLevelConfiguration": {
+    "Stack": "StackLevelConfigurations/stack_name",
+    "StackVersion": "StackLevelConfigurations/stack_version",
+    "StackLevelConfiguration": "StackLevelConfigurations/property_name"  
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bd0394a/ambari-server/src/main/resources/properties.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/properties.json b/ambari-server/src/main/resources/properties.json
index 785bd24..741ffe6 100644
--- a/ambari-server/src/main/resources/properties.json
+++ b/ambari-server/src/main/resources/properties.json
@@ -202,6 +202,7 @@
         "Versions/min_upgrade_version",
         "Versions/active",
         "Versions/parent_stack_version",
+        "Versions/config_types",
         "_"
     ],
     "OperatingSystem":[
@@ -444,5 +445,15 @@
         "ServiceComponentInfo/cluster_name",
         "HostRoles/host_name",
         "_"
+    ],
+    "StackLevelConfiguration":[
+        "StackLevelConfigurations/stack_name",
+        "StackLevelConfigurations/stack_version",
+        "StackLevelConfigurations/property_name",
+        "StackLevelConfigurations/property_value",
+        "StackLevelConfigurations/property_description",
+        "StackLevelConfigurations/type",
+        "StackLevelConfigurations/final",
+        "_"
     ]
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bd0394a/ambari-server/src/main/resources/stacks/HDP/1.3.2/configuration/cluster-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/configuration/cluster-env.xml b/ambari-server/src/main/resources/stacks/HDP/1.3.2/configuration/cluster-env.xml
new file mode 100644
index 0000000..a2df35a
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/configuration/cluster-env.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * 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.
+ */
+-->
+
+<configuration>
+    <property>
+        <name>security_enabled</name>
+        <value>false</value>
+        <description>Hadoop Security</description>
+    </property>
+    <property>
+        <name>kerberos_domain</name>
+        <value>EXAMPLE.COM</value>
+        <description>Kerberos realm.</description>
+    </property>
+    <property>
+        <name>ignore_groupsusers_create</name>
+        <value>false</value>
+        <description>Whether to ignore failures on users and group creation</description>
+    </property>
+    <property>
+        <name>smokeuser</name>
+        <value>ambari-qa</value>
+        <description>User executing service checks</description>
+    </property>
+    <property>
+        <name>user_group</name>
+        <value>hadoop</value>
+        <description>Hadoop user group.</description>
+    </property>
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bd0394a/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml b/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
new file mode 100644
index 0000000..a2df35a
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * 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.
+ */
+-->
+
+<configuration>
+    <property>
+        <name>security_enabled</name>
+        <value>false</value>
+        <description>Hadoop Security</description>
+    </property>
+    <property>
+        <name>kerberos_domain</name>
+        <value>EXAMPLE.COM</value>
+        <description>Kerberos realm.</description>
+    </property>
+    <property>
+        <name>ignore_groupsusers_create</name>
+        <value>false</value>
+        <description>Whether to ignore failures on users and group creation</description>
+    </property>
+    <property>
+        <name>smokeuser</name>
+        <value>ambari-qa</value>
+        <description>User executing service checks</description>
+    </property>
+    <property>
+        <name>user_group</name>
+        <value>hadoop</value>
+        <description>Hadoop user group.</description>
+    </property>
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bd0394a/ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryImplTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryImplTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryImplTest.java
index 5596a1e..e5a184b 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryImplTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryImplTest.java
@@ -272,7 +272,7 @@ public class QueryImplTest {
     Assert.assertEquals("StackVersion:1", versionNode.getName());
     Assert.assertEquals(Resource.Type.StackVersion, versionNode.getObject().getType());
 
-    Assert.assertEquals(2, versionNode.getChildren().size());
+    Assert.assertEquals(3, versionNode.getChildren().size());
     TreeNode<Resource> opSystemsNode = versionNode.getChild("operatingSystems");
     Assert.assertEquals(3, opSystemsNode.getChildren().size());
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bd0394a/ambari-server/src/test/java/org/apache/ambari/server/api/util/StackExtensionHelperTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/util/StackExtensionHelperTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/util/StackExtensionHelperTest.java
index 3a62147..c7af864 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/util/StackExtensionHelperTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/util/StackExtensionHelperTest.java
@@ -364,7 +364,7 @@ public class StackExtensionHelperTest {
     replay(serviceInfo);
 
     // eval
-    helper.addConfigTypeProperty(serviceInfo, "dep", "group", "key", "value");
+    helper.addConfigTypeProperty(serviceInfo.getConfigTypes(), "dep", "group", "key", "value");
 
     // verification
     verify(serviceInfo);
@@ -382,7 +382,7 @@ public class StackExtensionHelperTest {
     serviceInfo.setConfigTypes(configTypes);
 
     // eval
-    helper.addConfigTypeProperty(serviceInfo, "dep", "group", "key", "value");
+    helper.addConfigTypeProperty(serviceInfo.getConfigTypes(), "dep", "group", "key", "value");
 
     // assert
     configTypes = serviceInfo.getConfigTypes();
@@ -408,7 +408,7 @@ public class StackExtensionHelperTest {
     serviceInfo.setConfigTypes(configTypes);
 
     // eval
-    helper.addConfigTypeProperty(serviceInfo, "no_such_dep", "group", "key", "value");
+    helper.addConfigTypeProperty(serviceInfo.getConfigTypes(), "no_such_dep", "group", "key", "value");
 
     // assert
     configTypes = serviceInfo.getConfigTypes();
@@ -433,7 +433,7 @@ public class StackExtensionHelperTest {
     serviceInfo.setConfigTypes(configTypes);
 
     // eval
-    helper.addConfigTypeProperty(serviceInfo, "dep", "group", "key", "value");
+    helper.addConfigTypeProperty(serviceInfo.getConfigTypes(), "dep", "group", "key", "value");
 
     // assert
     configTypes = serviceInfo.getConfigTypes();
@@ -522,18 +522,14 @@ public class StackExtensionHelperTest {
     // expectations
     expect(serviceInfo.getConfigTypes()).andReturn(new HashMap<String, Map<String, Map<String, String>>>()).times(2);
     expect(serviceInfo.getProperties()).andReturn(properties).times(1);
-    expect(properties.addAll((Collection) anyObject())).andReturn(true).times(1);
-    helper.addConfigTypeProperty(serviceInfo, "yarn-site", StackExtensionHelper.Supports.KEYWORD,
-        StackExtensionHelper.Supports.FINAL.getPropertyName(), "false");
-    replay(properties);
-    replay(serviceInfo);
-    replay(helper);
+    expect(properties.addAll((Collection) anyObject())).andReturn(true).times(1);    
+    replay(properties, serviceInfo);
 
     // eval
     helper.populateServiceProperties(config, serviceInfo);
 
     // verification
-    verify(properties, serviceInfo, helper);
+    verify(properties, serviceInfo);
   }
 
   @Test
@@ -543,14 +539,13 @@ public class StackExtensionHelperTest {
     StackExtensionHelper helper = new StackExtensionHelper(injector, stackRoot);
     File config = new File(stackRootStr
         + "HDP/2.1.1/services/PIG/configuration/pig-properties.xml".replaceAll("/", File.separator));
-    ServiceInfo serviceInfo = createMock(ServiceInfo.class);
-    List<PropertyInfo> properties = createNiceMock(List.class);
+    ServiceInfo serviceInfo = createNiceMock(ServiceInfo.class);
+    List<PropertyInfo> properties = createMock(List.class);
 
     // expectations
     expect(serviceInfo.getConfigTypes()).andReturn(new HashMap<String, Map<String, Map<String, String>>>()).times(2);
     expect(serviceInfo.getProperties()).andReturn(properties).times(1);
     expect(properties.addAll((Collection) anyObject())).andReturn(true).times(1);
-    expect(serviceInfo.getConfigTypes()).andReturn(null).times(1);
     replay(properties);
     replay(serviceInfo);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bd0394a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractResourceProviderTest.java
index c1f4f5b..2187145 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractResourceProviderTest.java
@@ -39,6 +39,7 @@ import org.apache.ambari.server.controller.MemberRequest;
 import org.apache.ambari.server.controller.RequestStatusResponse;
 import org.apache.ambari.server.controller.ServiceComponentHostRequest;
 import org.apache.ambari.server.controller.StackConfigurationRequest;
+import org.apache.ambari.server.controller.StackLevelConfigurationRequest;
 import org.apache.ambari.server.controller.TaskStatusRequest;
 import org.apache.ambari.server.controller.UserRequest;
 import org.apache.ambari.server.controller.predicate.AlwaysPredicate;
@@ -362,6 +363,13 @@ public class AbstractResourceProviderTest {
       EasyMock.reportMatcher(new StackConfigurationRequestSetMatcher(stackName, stackVersion, serviceName, propertyName));
       return null;
     }
+    
+    public static Set<StackLevelConfigurationRequest> getStackLevelConfigurationRequestSet(String stackName, String stackVersion,
+        String propertyName)
+    {
+      EasyMock.reportMatcher(new StackLevelConfigurationRequestSetMatcher(stackName, stackVersion, propertyName));
+      return null;
+    }
   }
 
   /**
@@ -721,6 +729,43 @@ public class AbstractResourceProviderTest {
       stringBuffer.append("StackConfigurationRequestSetMatcher(").append(stackConfigurationRequest).append(")");
     }
   }
+  
+  public static class StackLevelConfigurationRequestSetMatcher extends HashSet<StackLevelConfigurationRequest> implements IArgumentMatcher {
+
+    private final StackLevelConfigurationRequest stackLevelConfigurationRequest;
+
+    public StackLevelConfigurationRequestSetMatcher(String stackName, String stackVersion,
+        String propertyName) {
+      this.stackLevelConfigurationRequest = new StackLevelConfigurationRequest(stackName, stackVersion, propertyName);
+      add(this.stackLevelConfigurationRequest);
+    }
+
+    @Override
+    public boolean matches(Object o) {
+
+      if (!(o instanceof Set)) {
+        return false;
+      }
+
+      Set set = (Set) o;
+
+      if (set.size() != 1) {
+        return false;
+      }
+
+      Object request = set.iterator().next();
+
+      return request instanceof StackLevelConfigurationRequest &&
+          eq(((StackLevelConfigurationRequest) request).getPropertyName(), stackLevelConfigurationRequest.getPropertyName()) &&
+          eq(((StackLevelConfigurationRequest) request).getStackName(), stackLevelConfigurationRequest.getStackName()) &&
+          eq(((StackLevelConfigurationRequest) request).getStackVersion(), stackLevelConfigurationRequest.getStackVersion());
+    }
+
+    @Override
+    public void appendTo(StringBuffer stringBuffer) {
+      stringBuffer.append("StackLevelConfigurationRequestSetMatcher(").append(stackLevelConfigurationRequest).append(")");
+    }
+  }
 
   /**
    * A test observer that records the last event.

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bd0394a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackLevelConfigurationResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackLevelConfigurationResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackLevelConfigurationResourceProviderTest.java
new file mode 100644
index 0000000..99d4423
--- /dev/null
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackLevelConfigurationResourceProviderTest.java
@@ -0,0 +1,181 @@
+/**
+ * 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.
+ */
+
+package org.apache.ambari.server.controller.internal;
+
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.ambari.server.controller.AmbariManagementController;
+import org.apache.ambari.server.controller.StackConfigurationResponse;
+import org.apache.ambari.server.controller.StackLevelConfigurationResponse;
+import org.apache.ambari.server.controller.spi.Request;
+import org.apache.ambari.server.controller.spi.Resource;
+import org.apache.ambari.server.controller.spi.ResourceProvider;
+import org.apache.ambari.server.controller.utilities.PropertyHelper;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class StackLevelConfigurationResourceProviderTest {
+  
+  private static final String PROPERTY_NAME = "name";
+  private static final String PROPERTY_VALUE = "value";
+  private static final String PROPERTY_DESC = "Desc";
+  private static final String TYPE = "type.xml";
+
+  @Test
+  public void testGetResources() throws Exception{
+       
+    Map<String, String> attributes = new HashMap<String, String>();
+    attributes.put("final", "true");
+
+    Resource.Type type = Resource.Type.StackLevelConfiguration;
+
+    AmbariManagementController managementController = createMock(AmbariManagementController.class);
+
+    Set<StackConfigurationResponse> allResponse = new HashSet<StackConfigurationResponse>();
+    
+    allResponse.add(new StackConfigurationResponse(PROPERTY_NAME, PROPERTY_VALUE, PROPERTY_DESC, TYPE, attributes));
+   
+    // set expectations
+    expect(managementController.getStackLevelConfigurations(
+        AbstractResourceProviderTest.Matcher.getStackLevelConfigurationRequestSet(null, null, null))).
+        andReturn(allResponse).times(1);
+    // replay
+    replay(managementController);
+
+    ResourceProvider provider = AbstractControllerResourceProvider.getResourceProvider(
+        type,
+        PropertyHelper.getPropertyIds(type),
+        PropertyHelper.getKeyPropertyIds(type),
+        managementController);
+
+    Set<String> propertyIds = new HashSet<String>();
+
+    propertyIds.add(StackLevelConfigurationResourceProvider.STACK_NAME_PROPERTY_ID);
+    propertyIds.add(StackLevelConfigurationResourceProvider.STACK_VERSION_PROPERTY_ID);
+    propertyIds.add(StackLevelConfigurationResourceProvider.PROPERTY_NAME_PROPERTY_ID);
+    propertyIds.add(StackLevelConfigurationResourceProvider.PROPERTY_VALUE_PROPERTY_ID);
+    propertyIds.add(StackLevelConfigurationResourceProvider.PROPERTY_DESCRIPTION_PROPERTY_ID);
+    propertyIds.add(StackLevelConfigurationResourceProvider.PROPERTY_TYPE_PROPERTY_ID);
+    propertyIds.add(StackLevelConfigurationResourceProvider.PROPERTY_FINAL_PROPERTY_ID);
+
+    // create the request
+    Request request = PropertyHelper.getReadRequest(propertyIds);
+
+    // get all ... no predicate
+    Set<Resource> resources = provider.getResources(request, null);
+
+    Assert.assertEquals(allResponse.size(), resources.size());
+    
+    for (Resource resource : resources) {   
+      String propertyName = (String) resource.getPropertyValue(StackLevelConfigurationResourceProvider.PROPERTY_NAME_PROPERTY_ID);
+      String propertyValue = (String) resource.getPropertyValue(StackLevelConfigurationResourceProvider.PROPERTY_VALUE_PROPERTY_ID);
+      String propertyDesc = (String) 
+          resource.getPropertyValue(StackLevelConfigurationResourceProvider.PROPERTY_DESCRIPTION_PROPERTY_ID);
+      String propertyType = (String) 
+          resource.getPropertyValue(StackLevelConfigurationResourceProvider.PROPERTY_TYPE_PROPERTY_ID);
+      String propertyIsFinal = (String)
+          resource.getPropertyValue(StackLevelConfigurationResourceProvider.PROPERTY_FINAL_PROPERTY_ID);
+      
+      Assert.assertEquals(PROPERTY_NAME, propertyName);
+      Assert.assertEquals(PROPERTY_VALUE, propertyValue);
+      Assert.assertEquals(PROPERTY_DESC, propertyDesc);
+      Assert.assertEquals(TYPE, propertyType);
+      Assert.assertEquals("true", propertyIsFinal);
+
+    }
+
+    // verify
+    verify(managementController);
+  }
+
+  @Test
+  public void testGetResources_noFinal() throws Exception{
+
+    Map<String, String> attributes = new HashMap<String, String>();
+
+    Resource.Type type = Resource.Type.StackLevelConfiguration;
+
+    AmbariManagementController managementController = createMock(AmbariManagementController.class);
+
+    Set<StackConfigurationResponse> allResponse = new HashSet<StackConfigurationResponse>();
+
+    allResponse.add(new StackConfigurationResponse(PROPERTY_NAME, PROPERTY_VALUE, PROPERTY_DESC, TYPE, attributes));
+
+    // set expectations
+    expect(managementController.getStackLevelConfigurations(
+        AbstractResourceProviderTest.Matcher.getStackLevelConfigurationRequestSet(null, null, null))).
+        andReturn(allResponse).times(1);
+    // replay
+    replay(managementController);
+
+    ResourceProvider provider = AbstractControllerResourceProvider.getResourceProvider(
+        type,
+        PropertyHelper.getPropertyIds(type),
+        PropertyHelper.getKeyPropertyIds(type),
+        managementController);
+
+    Set<String> propertyIds = new HashSet<String>();
+
+    propertyIds.add(StackLevelConfigurationResourceProvider.STACK_NAME_PROPERTY_ID);
+    propertyIds.add(StackLevelConfigurationResourceProvider.STACK_VERSION_PROPERTY_ID);
+    propertyIds.add(StackLevelConfigurationResourceProvider.PROPERTY_NAME_PROPERTY_ID);
+    propertyIds.add(StackLevelConfigurationResourceProvider.PROPERTY_VALUE_PROPERTY_ID);
+    propertyIds.add(StackLevelConfigurationResourceProvider.PROPERTY_DESCRIPTION_PROPERTY_ID);
+    propertyIds.add(StackLevelConfigurationResourceProvider.PROPERTY_TYPE_PROPERTY_ID);
+    propertyIds.add(StackLevelConfigurationResourceProvider.PROPERTY_FINAL_PROPERTY_ID);
+
+    // create the request
+    Request request = PropertyHelper.getReadRequest(propertyIds);
+
+    // get all ... no predicate
+    Set<Resource> resources = provider.getResources(request, null);
+
+    Assert.assertEquals(allResponse.size(), resources.size());
+
+    for (Resource resource : resources) {
+      String propertyName = (String) resource.getPropertyValue(StackLevelConfigurationResourceProvider.PROPERTY_NAME_PROPERTY_ID);
+      String propertyValue = (String) resource.getPropertyValue(StackLevelConfigurationResourceProvider.PROPERTY_VALUE_PROPERTY_ID);
+      String propertyDesc = (String)
+          resource.getPropertyValue(StackLevelConfigurationResourceProvider.PROPERTY_DESCRIPTION_PROPERTY_ID);
+      String propertyType = (String)
+          resource.getPropertyValue(StackLevelConfigurationResourceProvider.PROPERTY_TYPE_PROPERTY_ID);
+      String propertyIsFinal = (String)
+          resource.getPropertyValue(StackLevelConfigurationResourceProvider.PROPERTY_FINAL_PROPERTY_ID);
+
+      Assert.assertEquals(PROPERTY_NAME, propertyName);
+      Assert.assertEquals(PROPERTY_VALUE, propertyValue);
+      Assert.assertEquals(PROPERTY_DESC, propertyDesc);
+      Assert.assertEquals(TYPE, propertyType);
+      Assert.assertEquals("false", propertyIsFinal);
+
+    }
+
+    // verify
+    verify(managementController);
+  } 
+
+}


[05/45] git commit: Merge remote-tracking branch 'origin/trunk' into origin-trunk

Posted by jo...@apache.org.
Merge remote-tracking branch 'origin/trunk' into origin-trunk


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

Branch: refs/heads/branch-alerts-dev
Commit: 940abdc4a232c1c354ec3eff17abed89c224c161
Parents: 5e3c95f eb08925
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Wed Aug 27 17:41:40 2014 +0300
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Wed Aug 27 17:41:40 2014 +0300

----------------------------------------------------------------------
 .../ui/app/components/configSection.js          | 48 ++++++++++++++++++++
 .../createAppWizard/step3_controller.js         | 45 ++++++++++++++----
 .../src/main/resources/ui/app/helpers/helper.js |  5 +-
 .../app/templates/components/configSection.hbs  | 30 ++++++++++++
 .../ui/app/templates/createAppWizard/step3.hbs  |  4 +-
 5 files changed, 122 insertions(+), 10 deletions(-)
----------------------------------------------------------------------



[36/45] git commit: AMBARI-7013. Fix UI Unit tests. (onechiporenko)

Posted by jo...@apache.org.
AMBARI-7013. Fix UI Unit tests. (onechiporenko)


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

Branch: refs/heads/branch-alerts-dev
Commit: 6b7e796ab162aeb7915539b0e37ca740335366f8
Parents: fb83670
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Thu Aug 28 17:00:08 2014 +0300
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Thu Aug 28 17:00:08 2014 +0300

----------------------------------------------------------------------
 .../app/controllers/wizard/step3_controller.js  |   1 +
 .../dashboard/config_history_controller_test.js |  38 +--
 .../test/controllers/wizard/step3_test.js       | 325 +++++++++++++++++++
 .../test/controllers/wizard/step5_test.js       |  19 --
 .../test/controllers/wizard/step6_test.js       |  34 --
 .../test/controllers/wizard/step7_test.js       |  92 +-----
 ambari-web/test/models/stack_service_test.js    |  52 +--
 7 files changed, 344 insertions(+), 217 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6b7e796a/ambari-web/app/controllers/wizard/step3_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step3_controller.js b/ambari-web/app/controllers/wizard/step3_controller.js
index 3510150..e17c06b 100644
--- a/ambari-web/app/controllers/wizard/step3_controller.js
+++ b/ambari-web/app/controllers/wizard/step3_controller.js
@@ -1138,6 +1138,7 @@ App.WizardStep3Controller = Em.Controller.extend({
    * @method repoToAgentOsType
    */
   repoToAgentOsType : function (repoType) {
+    /* istanbul ignore next */
     switch (repoType) {
       case "redhat6":
         return ["redhat6", "centos6", "oraclelinux6", "rhel6"];

http://git-wip-us.apache.org/repos/asf/ambari/blob/6b7e796a/ambari-web/test/controllers/main/dashboard/config_history_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/dashboard/config_history_controller_test.js b/ambari-web/test/controllers/main/dashboard/config_history_controller_test.js
index 0692b9e..18ec48f 100644
--- a/ambari-web/test/controllers/main/dashboard/config_history_controller_test.js
+++ b/ambari-web/test/controllers/main/dashboard/config_history_controller_test.js
@@ -28,26 +28,21 @@ describe('MainConfigHistoryController', function () {
   describe('#realUrl', function () {
     it('cluster name is empty', function () {
       App.set('clusterName', '');
-      expect(controller.get('realUrl')).to.equal('/api/v1/clusters//configurations/serviceconfigversions?<parameters>fields=serviceconfigversion,user,group_id,group_name,createtime,service_name,service_config_version_note&minimal_response=true');
+      expect(controller.get('realUrl')).to.equal('/api/v1/clusters//configurations/service_config_versions?<parameters>fields=service_config_version,user,group_id,group_name,is_current,createtime,service_name,service_config_version_note&minimal_response=true');
     });
     it('cluster name is "mycluster"', function () {
       App.set('clusterName', 'mycluster');
-      expect(controller.get('realUrl')).to.equal('/api/v1/clusters/mycluster/configurations/serviceconfigversions?<parameters>fields=serviceconfigversion,user,group_id,group_name,createtime,service_name,service_config_version_note&minimal_response=true');
+      expect(controller.get('realUrl')).to.equal('/api/v1/clusters/mycluster/configurations/service_config_versions?<parameters>fields=service_config_version,user,group_id,group_name,is_current,createtime,service_name,service_config_version_note&minimal_response=true');
     });
   });
   describe('#load()', function () {
     it('', function () {
       sinon.stub(controller, 'updateTotalCounter', Em.K);
-      sinon.stub(controller, 'loadCurrentVersions', function(){
-        return {complete: Em.K};
-      });
 
       controller.load();
       expect(controller.updateTotalCounter.calledOnce).to.be.true;
-      expect(controller.loadCurrentVersions.calledOnce).to.be.true;
 
       controller.updateTotalCounter.restore();
-      controller.loadCurrentVersions.restore();
     });
   });
   describe('#loadConfigVersionsToModel()', function () {
@@ -69,16 +64,7 @@ describe('MainConfigHistoryController', function () {
       App.HttpClient.get.restore();
     });
   });
-  describe('#loadCurrentVersions()', function () {
-    it('', function () {
-      sinon.stub(App.ajax, 'send', Em.K);
 
-      controller.loadCurrentVersions();
-      expect(App.ajax.send.calledOnce).to.be.true;
-
-      App.ajax.send.restore();
-    });
-  });
   describe('#updateTotalCounter()', function () {
     it('', function () {
       sinon.stub(App.ajax, 'send', Em.K);
@@ -89,21 +75,7 @@ describe('MainConfigHistoryController', function () {
       App.ajax.send.restore();
     });
   });
-  describe('#loadCurrentVersionsSuccess()', function () {
-    it('', function () {
-      var data = {
-        Clusters: {
-          desired_serviceconfigversions: {
-            'SERVICE': {
-              serviceconfigversion: 1
-            }
-          }
-        }
-      };
-      controller.loadCurrentVersionsSuccess(data);
-      expect(App.cache['currentConfigVersions']).to.eql({SERVICE_1: true});
-    });
-  });
+
   describe('#updateTotalCounterSuccess()', function () {
     it('', function () {
       controller.updateTotalCounterSuccess({itemTotal: 1});
@@ -136,14 +108,14 @@ describe('MainConfigHistoryController', function () {
         if ('testMode' === k) return false;
         return Em.get(App, k);
       });
-      expect(controller.getUrl()).to.equal('/api/v1/clusters/mycluster/configurations/serviceconfigversions?fields=serviceconfigversion,user,group_id,group_name,createtime,service_name,service_config_version_note&minimal_response=true');
+      expect(controller.getUrl()).to.equal('/api/v1/clusters/mycluster/configurations/service_config_versions?fields=service_config_version,user,group_id,group_name,is_current,createtime,service_name,service_config_version_note&minimal_response=true');
     });
     it('query params is correct', function () {
       sinon.stub(App, 'get', function(k) {
         if ('testMode' === k) return false;
         return Em.get(App, k);
       });
-      expect(controller.getUrl({})).to.equal('/api/v1/clusters/mycluster/configurations/serviceconfigversions?paramsfields=serviceconfigversion,user,group_id,group_name,createtime,service_name,service_config_version_note&minimal_response=true');
+      expect(controller.getUrl({})).to.equal('/api/v1/clusters/mycluster/configurations/service_config_versions?paramsfields=service_config_version,user,group_id,group_name,is_current,createtime,service_name,service_config_version_note&minimal_response=true');
     });
   });
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/6b7e796a/ambari-web/test/controllers/wizard/step3_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step3_test.js b/ambari-web/test/controllers/wizard/step3_test.js
index d9b37cc..8ed17ad 100644
--- a/ambari-web/test/controllers/wizard/step3_test.js
+++ b/ambari-web/test/controllers/wizard/step3_test.js
@@ -1364,6 +1364,107 @@ describe('App.WizardStep3Controller', function () {
         });
       });
 
+    it('should parse umask warnings', function() {
+
+      var items = [
+        {Hosts:{host_name: 'c1', last_agent_env: {umask: 18}}},
+        {Hosts:{host_name: 'c2', last_agent_env: {umask: 1}}}
+      ];
+
+      c.parseWarnings({items: items});
+      var warnings = c.get('warnings');
+      expect(warnings.length).to.equal(1);
+      expect(warnings[0].hosts).to.eql(['c2']);
+      expect(warnings[0].onSingleHost).to.equal(true);
+
+    });
+
+    it('should parse umask warnings (2)', function() {
+
+      var items = [
+        {Hosts:{host_name: 'c1', last_agent_env: {umask: 8}}},
+        {Hosts:{host_name: 'c2', last_agent_env: {umask: 1}}}
+      ];
+
+      c.parseWarnings({items: items});
+      var warnings = c.get('warnings');
+      expect(warnings.length).to.equal(2);
+      expect(warnings.mapProperty('hosts')).to.eql([['c1'], ['c2']]);
+
+    });
+
+
+    it('should parse firewall warnings', function() {
+
+      var items = [
+        {Hosts:{host_name: 'c1', last_agent_env: {iptablesIsRunning: true}}},
+        {Hosts:{host_name: 'c2', last_agent_env: {iptablesIsRunning: false}}}
+      ];
+
+      c.parseWarnings({items: items});
+      var warnings = c.get('warnings');
+      expect(warnings.length).to.equal(1);
+      expect(warnings[0].hosts).to.eql(['c1']);
+      expect(warnings[0].onSingleHost).to.equal(true);
+
+    });
+
+    it('should parse firewall warnings (2)', function() {
+
+      var items = [
+        {Hosts:{host_name: 'c1', last_agent_env: {iptablesIsRunning: true}}},
+        {Hosts:{host_name: 'c2', last_agent_env: {iptablesIsRunning: true}}}
+      ];
+
+      c.parseWarnings({items: items});
+      var warnings = c.get('warnings');
+      expect(warnings.length).to.equal(1);
+      expect(warnings[0].hosts).to.eql(['c1','c2']);
+      expect(warnings[0].onSingleHost).to.equal(false);
+
+    });
+
+    it('should parse reverseLookup warnings', function() {
+
+      var items = [
+        {Hosts:{host_name: 'c1', last_agent_env: {reverseLookup: true}}}
+      ];
+
+      c.parseWarnings({items: items});
+      var warnings = c.get('warnings');
+      expect(warnings.length).to.equal(0);
+
+    });
+
+    it('should parse reverseLookup warnings (2)', function() {
+
+      var items = [
+        {Hosts:{host_name: 'c1', last_agent_env: {reverseLookup: false}}}
+      ];
+
+      c.parseWarnings({items: items});
+      var warnings = c.get('warnings');
+      expect(warnings.length).to.equal(1);
+      expect(warnings[0].hosts).to.eql(['c1']);
+      expect(warnings[0].onSingleHost).to.equal(true);
+
+    });
+
+    it('should parse reverseLookup warnings (3)', function() {
+
+      var items = [
+        {Hosts:{host_name: 'c1', last_agent_env: {reverseLookup: false}}},
+        {Hosts:{host_name: 'c2', last_agent_env: {reverseLookup: false}}}
+      ];
+
+      c.parseWarnings({items: items});
+      var warnings = c.get('warnings');
+      expect(warnings.length).to.equal(1);
+      expect(warnings[0].hosts).to.eql(['c1','c2']);
+      expect(warnings[0].onSingleHost).to.equal(false);
+
+    });
+
   });
 
   describe('#navigateStep', function() {
@@ -1710,4 +1811,228 @@ describe('App.WizardStep3Controller', function () {
     });
   });
 
+  describe('#getJDKName', function() {
+
+    beforeEach(function() {
+      sinon.stub($, 'ajax', Em.K);
+      sinon.stub(App, 'get', function(k) {
+        if ('testMode' === k) return false;
+        return Em.get(App, k);
+      });
+    });
+
+    afterEach(function() {
+      $.ajax.restore();
+      App.get.restore();
+    });
+
+    it('should do proper request to ambari-server', function() {
+      c.getJDKName();
+      expect($.ajax.args[0][0].type).to.contain('GET');
+      expect($.ajax.args[0][0].url).to.contain('/services/AMBARI/components/AMBARI_SERVER?fields=RootServiceComponents/properties/jdk.name,RootServiceComponents/properties/java.home,RootServiceComponents/properties/jdk_location');
+    });
+
+  });
+
+  describe('#getJDKNameSuccessCallback', function() {
+
+    it('should set proper data to controller properties', function() {
+
+      var expected = {
+          name: 'name',
+          home: 'home',
+          location: 'location'
+        },
+        data = {
+        RootServiceComponents: {
+          properties: {
+            'jdk.name': expected.name,
+            'java.home': expected.home,
+            'jdk_location': expected.location
+          }
+        }
+      };
+
+      c.getJDKNameSuccessCallback(data);
+      expect(c.get('needJDKCheckOnHosts')).to.equal(false);
+      expect(c.get('jdkLocation')).to.equal(expected.location);
+      expect(c.get('javaHome')).to.equal(expected.home);
+    });
+
+  });
+
+  describe('#doCheckJDK', function() {
+
+    beforeEach(function() {
+      sinon.stub($, 'ajax', Em.K);
+      sinon.stub(c, 'setRegistrationInProgressOnce', Em.K);
+      sinon.stub(App, 'get', function(k) {
+        if ('testMode' === k) return false;
+        return Em.get(App, k);
+      });
+    });
+
+    afterEach(function() {
+      $.ajax.restore();
+      c.setRegistrationInProgressOnce.restore();
+      App.get.restore();
+    });
+
+    it('should do proper request to the ambari-server', function() {
+
+      var bootHosts = [{name: 'n1'}, {name: 'n2'}],
+        javaHome = '/java',
+        jdkLocation = '/jdk';
+      c.reopen({
+        bootHosts: bootHosts,
+        javaHome: javaHome,
+        jdkLocation: jdkLocation
+      });
+      c.doCheckJDK();
+      var request = $.ajax.args[0][0], data = JSON.parse(request.data);
+      expect(request.type).to.equal('POST');
+      expect(request.url).to.contain('/requests');
+      expect(data.RequestInfo.parameters.java_home).to.equal(javaHome);
+      expect(data.RequestInfo.parameters.jdk_location).to.equal(jdkLocation);
+      expect(data['Requests/resource_filters'][0].hosts).to.equal('n1,n2');
+    });
+
+  });
+
+  describe('#doCheckJDKsuccessCallback', function() {
+
+    beforeEach(function() {
+      sinon.stub($, 'ajax', Em.K);
+      sinon.stub(App, 'get', function(k) {
+        if ('testMode' === k) return false;
+        return Em.get(App, k);
+      });
+    });
+
+    afterEach(function() {
+      $.ajax.restore();
+      App.get.restore();
+    });
+
+    it('should set jdkRequestIndex if data provided', function() {
+
+      var data = {
+          href: '/a/b/c'
+        },
+        expected = 'c';
+      c.set('jdkRequestIndex', null);
+      c.doCheckJDKsuccessCallback(data);
+      expect(c.get('jdkRequestIndex')).to.equal(expected);
+    });
+
+    it('should set isJDKWarningsLoaded to true if jdkCategoryWarnings is not null', function() {
+
+      var data = null,
+        expected = true;
+      c.set('isJDKWarningsLoaded', false);
+      c.set('jdkCategoryWarnings', {});
+      c.doCheckJDKsuccessCallback(data);
+      expect(c.get('isJDKWarningsLoaded')).to.equal(expected);
+    });
+
+    it('should do propert request to ambari-server', function() {
+
+      var data = null,
+        jdkRequestIndex = 'jdkRequestIndex',
+        url = '/requests/' + jdkRequestIndex + '?fields=*,tasks/Tasks/host_name,tasks/Tasks/status,tasks/Tasks/structured_out';
+      c.set('jdkRequestIndex', jdkRequestIndex);
+      c.set('jdkCategoryWarnings', null);
+      c.doCheckJDKsuccessCallback(data);
+      expect($.ajax.args[0][0].type).to.equal('GET');
+      expect($.ajax.args[0][0].url).to.contain(url);
+    });
+
+  });
+
+  describe('#doCheckJDKerrorCallback', function() {
+
+    it('should set isJDKWarningsLoaded to true', function() {
+
+      c.set('isJDKWarningsLoaded', false);
+      c.doCheckJDKerrorCallback();
+      c.set('isJDKWarningsLoaded', true);
+
+    });
+
+  });
+
+  describe('#parseJDKCheckResults', function() {
+
+    beforeEach(function() {
+      sinon.stub(c, 'doCheckJDKsuccessCallback', Em.K);
+    });
+
+    afterEach(function() {
+      c.doCheckJDKsuccessCallback.restore();
+    });
+
+    it('should set jdkCategoryWarnings to null if no data', function() {
+
+      var data = {Requests: {}};
+      c.set('jdkCategoryWarnings', {});
+      c.parseJDKCheckResults(data);
+      expect(c.get('jdkCategoryWarnings')).to.be.null;
+
+    });
+
+    it('should parse warnings (1)', function() {
+
+      var data = {
+        Requests: {
+          end_time: 1
+        },
+        tasks: []
+      };
+
+      c.set('jdkCategoryWarnings', {});
+      c.parseJDKCheckResults(data);
+      expect(c.get('jdkCategoryWarnings')).to.eql([]);
+
+    });
+
+    it('should parse warnings (2)', function() {
+
+      var data = {
+        Requests: {
+          end_time: 1
+        },
+        tasks: [
+          {
+            Tasks: {
+              host_name: 'h1',
+              structured_out: {
+                java_home_check: {
+                  exit_code: 1
+                }
+              }
+            }
+          },
+          {
+            Tasks: {
+              host_name: 'h2',
+              structured_out: {
+                java_home_check: {
+                  exit_code: 0
+                }
+              }
+            }
+          }
+        ]
+      };
+
+      c.set('jdkCategoryWarnings', {});
+      c.parseJDKCheckResults(data);
+      var result = c.get('jdkCategoryWarnings');
+      expect(result.length).to.equal(1);
+      expect(result[0].hostsNames).to.eql(['h1']);
+
+    });
+
+  });
+
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/6b7e796a/ambari-web/test/controllers/wizard/step5_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step5_test.js b/ambari-web/test/controllers/wizard/step5_test.js
index e39c7a8..23e0e36 100644
--- a/ambari-web/test/controllers/wizard/step5_test.js
+++ b/ambari-web/test/controllers/wizard/step5_test.js
@@ -481,25 +481,6 @@ describe('App.WizardStep5Controller', function () {
     });
   });
 
-  describe('#submit', function () {
-    beforeEach(function () {
-      sinon.stub(App.router, 'send', Em.K);
-    });
-    afterEach(function () {
-      App.router.send.restore();
-    });
-    it('should go next if not isSubmitDisabled', function () {
-      c.reopen({submitDisabled: false});
-      c.submit();
-      expect(App.router.send.calledWith('next')).to.equal(true);
-    });
-    it('shouldn\'t go next if submitDisabled true', function () {
-      c.reopen({submitDisabled: true});
-      c.submit();
-      expect(App.router.send.called).to.equal(false);
-    });
-  });
-
   describe('#removeComponent', function () {
     var tests = Em.A([
       {

http://git-wip-us.apache.org/repos/asf/ambari/blob/6b7e796a/ambari-web/test/controllers/wizard/step6_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step6_test.js b/ambari-web/test/controllers/wizard/step6_test.js
index abe91a6..67fd91c 100644
--- a/ambari-web/test/controllers/wizard/step6_test.js
+++ b/ambari-web/test/controllers/wizard/step6_test.js
@@ -141,40 +141,6 @@ describe('App.WizardStep6Controller', function () {
     });
   });
 
-  describe('#selectAllNodes', function () {
-    beforeEach(function () {
-      sinon.stub(controller, 'setAllNodes', Em.K);
-    });
-    afterEach(function () {
-      controller.setAllNodes.restore();
-    });
-    it('should call setAllNodes', function () {
-      controller.selectAllNodes({context: {name: 'name'}});
-      expect(controller.setAllNodes.calledWith('name', true)).to.equal(true);
-    });
-    it('shouldn\'t call setAllNodes', function () {
-      controller.selectAllNodes();
-      expect(controller.setAllNodes.called).to.equal(false);
-    });
-  });
-
-  describe('#deselectAllNodes', function () {
-    beforeEach(function () {
-      sinon.stub(controller, 'setAllNodes', Em.K);
-    });
-    afterEach(function () {
-      controller.setAllNodes.restore();
-    });
-    it('should call setAllNodes', function () {
-      controller.deselectAllNodes({context: {name: 'name'}});
-      expect(controller.setAllNodes.calledWith('name', false)).to.equal(true);
-    });
-    it('shouldn\'t call setAllNodes', function () {
-      controller.deselectAllNodes();
-      expect(controller.setAllNodes.called).to.equal(false);
-    });
-  });
-
   describe('#checkCallback', function () {
     beforeEach(function () {
       sinon.stub(controller, 'clearError', Em.K);

http://git-wip-us.apache.org/repos/asf/ambari/blob/6b7e796a/ambari-web/test/controllers/wizard/step7_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step7_test.js b/ambari-web/test/controllers/wizard/step7_test.js
index 859b83a..b550933 100644
--- a/ambari-web/test/controllers/wizard/step7_test.js
+++ b/ambari-web/test/controllers/wizard/step7_test.js
@@ -27,7 +27,18 @@ var installerStep7Controller;
 describe('App.InstallerStep7Controller', function () {
 
   beforeEach(function () {
-    installerStep7Controller = App.WizardStep7Controller.create();
+    sinon.stub(App.config, 'setPreDefinedServiceConfigs', Em.K);
+    installerStep7Controller = App.WizardStep7Controller.create({
+      content: {
+        advancedServiceConfig: [],
+        serviceConfigProperties: []
+      },
+      applyServicesConfigs: Em.K
+    });
+  });
+
+  afterEach(function() {
+    App.config.setPreDefinedServiceConfigs.restore();
   });
 
   describe('#installedServiceNames', function () {
@@ -1002,85 +1013,6 @@ describe('App.InstallerStep7Controller', function () {
       installerStep7Controller.loadStep();
       expect(installerStep7Controller.setInstalledServiceConfigs.calledOnce).to.equal(true);
     });
-    Em.A([
-        {
-          allSelectedServiceNames: ['STORM'],
-          installedServiceNames: ['STORM'],
-          m: 'allSelectedServiceNames contains STORM, installedServiceNames contains STORM',
-          e: true
-        },
-        {
-          allSelectedServiceNames: [],
-          installedServiceNames: ['STORM'],
-          m: 'allSelectedServiceNames doesn\'t contain STORM, installedServiceNames contains STORM',
-          e: true
-        },
-        {
-          allSelectedServiceNames: ['STORM'],
-          installedServiceNames: [],
-          m: 'allSelectedServiceNames contains STORM, installedServiceNames doesn\'t contain STORM',
-          e: true
-        },
-        {
-          allSelectedServiceNames: [],
-          installedServiceNames: [],
-          m: 'allSelectedServiceNames doesn\'t contain STORM, installedServiceNames doesn\'t contain STORM',
-          e: false
-        }
-      ]).forEach(function (test) {
-        it(test.m, function () {
-          installerStep7Controller.reopen({
-            allSelectedServiceNames: test.allSelectedServiceNames,
-            installedServiceNames: test.installedServiceNames
-          });
-          installerStep7Controller.loadStep();
-          if (test.e) {
-            expect(installerStep7Controller.resolveServiceDependencyConfigs.calledOnce).to.equal(true);
-          }
-          else {
-            expect(installerStep7Controller.resolveServiceDependencyConfigs.called).to.equal(false);
-          }
-        });
-      });
-    it('should call setStepConfigs', function () {
-      installerStep7Controller.loadStep();
-      expect(installerStep7Controller.setStepConfigs.calledOnce).to.equal(true);
-    });
-    it('should call checkHostOverrideInstaller', function () {
-      installerStep7Controller.loadStep();
-      expect(installerStep7Controller.checkHostOverrideInstaller.calledOnce).to.equal(true);
-    });
-    it('should call activateSpecialConfigs', function () {
-      installerStep7Controller.loadStep();
-      expect(installerStep7Controller.activateSpecialConfigs.calledOnce).to.equal(true);
-    });
-    it('should call selectProperService', function () {
-      installerStep7Controller.loadStep();
-      expect(installerStep7Controller.selectProperService.calledOnce).to.equal(true);
-    });
-    Em.A([
-        {
-          m: 'should skip config step',
-          skipConfigStep: true,
-          e: true
-        },
-        {
-          m: 'shouldn\'t skip config step',
-          skipConfigStep: false,
-          e: false
-        }
-      ]).forEach(function (test) {
-        it(test.m, function () {
-          installerStep7Controller.set('content.skipConfigStep', test.skipConfigStep);
-          installerStep7Controller.loadStep();
-          if (test.e) {
-            expect(App.router.send.calledWith('next')).to.equal(true);
-          }
-          else {
-            expect(App.router.send.called).to.equal(false);
-          }
-        });
-      });
   });
 
   describe('#_updateValueForCheckBoxConfig', function () {

http://git-wip-us.apache.org/repos/asf/ambari/blob/6b7e796a/ambari-web/test/models/stack_service_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/models/stack_service_test.js b/ambari-web/test/models/stack_service_test.js
index 07b4d66..7cbe4c7 100644
--- a/ambari-web/test/models/stack_service_test.js
+++ b/ambari-web/test/models/stack_service_test.js
@@ -75,7 +75,7 @@ describe('App.StackService', function () {
     it('service name is "GLUSTERFS"', function () {
       ss.set('serviceName', 'GLUSTERFS');
       ss.propertyDidChange('configTypesRendered');
-      expect(ss.get('configTypesRendered')).to.eql({'core-site': {}, 'hdfs-site': {}});
+      expect(ss.get('configTypesRendered')).to.eql({'hdfs-site': {}});
     });
     it('service name is "HDFS"', function () {
       ss.set('serviceName', 'HDFS');
@@ -128,56 +128,6 @@ describe('App.StackService', function () {
     });
   });
 
-  describe('#dependentServices', function () {
-    var mock = {
-      isHadoop2Stack: false
-    };
-    beforeEach(function () {
-      sinon.stub(App, 'get', function () {
-        return mock.isHadoop2Stack;
-      })
-    });
-    afterEach(function () {
-      App.get.restore();
-    });
-    it('isHadoop2Stack is false', function () {
-      ss.set('serviceName', 'HDFS');
-      ss.propertyDidChange('dependentServices');
-      expect(ss.get('dependentServices')).to.eql(['MAPREDUCE', 'HBASE', 'SQOOP']);
-    });
-    it('isHadoop2Stack is true', function () {
-      mock.isHadoop2Stack = true;
-      ss.set('serviceName', 'HDFS');
-      ss.propertyDidChange('dependentServices');
-      expect(ss.get('dependentServices')).to.eql(['YARN', 'HBASE', 'FLUME', 'SQOOP']);
-    });
-  });
-
-  describe('#serviceDependency', function () {
-    var mock = {
-      isHadoop2Stack: false
-    };
-    beforeEach(function () {
-      sinon.stub(App, 'get', function () {
-        return mock.isHadoop2Stack;
-      })
-    });
-    afterEach(function () {
-      App.get.restore();
-    });
-    it('isHadoop2Stack is false', function () {
-      ss.set('serviceName', 'HDFS');
-      ss.propertyDidChange('serviceDependency');
-      expect(ss.get('serviceDependency')).to.eql([]);
-    });
-    it('isHadoop2Stack is true', function () {
-      mock.isHadoop2Stack = true;
-      ss.set('serviceName', 'HDFS');
-      ss.propertyDidChange('serviceDependency');
-      expect(ss.get('serviceDependency')).to.eql(["ZOOKEEPER"]);
-    });
-  });
-
   describe('#isMonitoringService', function () {
     var testCases = [
       {


[37/45] git commit: AMBARI-7058. Improve logging on Ubuntu on package install failure. (aonishuk)

Posted by jo...@apache.org.
AMBARI-7058. Improve logging on Ubuntu on package install failure. (aonishuk)


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

Branch: refs/heads/branch-alerts-dev
Commit: 1b017b7cd4b4f8fbd89beaf7b1adf8bf9eaac3a2
Parents: 6b7e796
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Thu Aug 28 18:05:09 2014 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Thu Aug 28 18:05:09 2014 +0300

----------------------------------------------------------------------
 .../python/resource_management/TestPackageResource.py    |  6 +++---
 .../resource_management/core/providers/package/apt.py    | 11 ++++++++---
 2 files changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/1b017b7c/ambari-agent/src/test/python/resource_management/TestPackageResource.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/test/python/resource_management/TestPackageResource.py b/ambari-agent/src/test/python/resource_management/TestPackageResource.py
index d36c543..1628322 100644
--- a/ambari-agent/src/test/python/resource_management/TestPackageResource.py
+++ b/ambari-agent/src/test/python/resource_management/TestPackageResource.py
@@ -36,11 +36,11 @@ class TestPackageResource(TestCase):
       )
     call_mock.assert_has_calls([call("dpkg --get-selections some_package | grep -v deinstall"),
                                 call("DEBIAN_FRONTEND=noninteractive /usr/bin/apt-get -q -o Dpkg::Options::='--force-confdef'"
-                                      " --allow-unauthenticated --assume-yes install some_package")
+                                      " --allow-unauthenticated --assume-yes install some_package"),
+                                call("apt-get update -qq")
                               ])
     
-    shell_mock.assert_has_calls([call("apt-get update -qq"),
-                                call("DEBIAN_FRONTEND=noninteractive /usr/bin/apt-get -q -o Dpkg::Options::='--force-confdef' --allow-unauthenticated --assume-yes install some_package")
+    shell_mock.assert_has_calls([call("DEBIAN_FRONTEND=noninteractive /usr/bin/apt-get -q -o Dpkg::Options::='--force-confdef' --allow-unauthenticated --assume-yes install some_package")
                               ])
   
   @patch.object(shell, "call")

http://git-wip-us.apache.org/repos/asf/ambari/blob/1b017b7c/ambari-common/src/main/python/resource_management/core/providers/package/apt.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/core/providers/package/apt.py b/ambari-common/src/main/python/resource_management/core/providers/package/apt.py
index 4c6e2dd..f001f14 100644
--- a/ambari-common/src/main/python/resource_management/core/providers/package/apt.py
+++ b/ambari-common/src/main/python/resource_management/core/providers/package/apt.py
@@ -33,12 +33,17 @@ class AptProvider(PackageProvider):
     if not self._check_existence(name):
       cmd = INSTALL_CMD % (name)
       Logger.info("Installing package %s ('%s')" % (name, cmd))
-      code = shell.call(cmd)[0]
+      code, out = shell.call(cmd)
       
       # apt-get update wasn't done too long
       if code:
-        Logger.info("Failed to install package %s. Executing `apt-get update`" % (name))
-        shell.checked_call(REPO_UPDATE_CMD)
+        Logger.info("Execution of '%s' returned %d. %s" % (cmd, code, out))
+        Logger.info("Failed to install package %s. Executing `%s`" % (name, REPO_UPDATE_CMD))
+        code, out = shell.call(REPO_UPDATE_CMD)
+        
+        if code:
+          Logger.info("Execution of '%s' returned %d. %s" % (REPO_UPDATE_CMD, code, out))
+          
         Logger.info("Retrying to install package %s" % (name))
         shell.checked_call(cmd)
     else:


[25/45] git commit: AMBARI-7047. BE: Config validation type of values less than recommended should be WARNs

Posted by jo...@apache.org.
AMBARI-7047. BE: Config validation type of values less than recommended should be WARNs


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

Branch: refs/heads/branch-alerts-dev
Commit: fa10e3bff6f18aeee1d93eecf1f15ad0d7657235
Parents: d87cf7f
Author: Srimanth Gunturi <sg...@hortonworks.com>
Authored: Wed Aug 27 13:51:39 2014 -0700
Committer: Srimanth Gunturi <sg...@hortonworks.com>
Committed: Wed Aug 27 18:31:29 2014 -0700

----------------------------------------------------------------------
 .../stacks/HDP/2.0.6/services/stack_advisor.py  | 56 +++++++++++---------
 .../stacks/HDP/2.1/services/stack_advisor.py    | 14 ++---
 .../stacks/2.0.6/common/test_stack_advisor.py   | 36 ++++++++++---
 3 files changed, 67 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/fa10e3bf/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
index ad0dcc0..083286e 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
@@ -415,58 +415,66 @@ class HDP206StackAdvisor(StackAdvisor):
       "YARN": ["yarn-site", self.validateYARNConfigurations]
     }.get(serviceName, None)
 
-  def toConfigurationValidationErrors(self, items, siteName):
+  def toConfigurationValidationProblems(self, validationProblems, siteName):
     result = []
-    for item in items:
-      if item["message"] is not None:
-        error = { "type": 'configuration', "level": 'ERROR', "message": item["message"], "config-type": siteName, "config-name": item["config-name"] }
-        result.append(error)
+    for validationProblem in validationProblems:
+      validationItem = validationProblem.get("item", None)
+      if validationItem is not None:
+        problem = { "type": 'configuration', "level": validationItem["level"], "message": validationItem["message"],
+                  "config-type": siteName, "config-name": validationProblem["config-name"] }
+        result.append(problem)
     return result
 
+  def getWarnItem(self, message):
+    return {"level": "WARN", "message": message}
+
+  def getErrorItem(self, message):
+    return {"level": "ERROR", "message": message}
+
   def validatorLessThenDefaultValue(self, properties, recommendedDefaults, propertyName):
     if not propertyName in properties:
-      return "Value should be set"
+      return self.getErrorItem("Value should be set")
     value = to_number(properties[propertyName])
     if value is None:
-      return "Value should be integer"
+      return self.getErrorItem("Value should be integer")
     defaultValue = to_number(recommendedDefaults[propertyName])
     if defaultValue is None:
       return None
     if value < defaultValue:
-      return "Value is less than the recommended default of {0}".format(defaultValue)
+      return self.getWarnItem("Value is less than the recommended default of {0}".format(defaultValue))
     return None
 
   def validateXmxValue(self, properties, recommendedDefaults, propertyName):
     if not propertyName in properties:
-      return "Value should be set"
+      return self.getErrorItem("Value should be set")
     value = properties[propertyName]
     defaultValue = recommendedDefaults[propertyName]
     if defaultValue is None:
-      return "Config's default value can't be null or undefined"
+      return self.getErrorItem("Config's default value can't be null or undefined")
     if not checkXmxValueFormat(value):
-      return 'Invalid value format'
+      return self.getErrorItem('Invalid value format')
     valueInt = formatXmxSizeToBytes(getXmxSize(value))
     defaultValueXmx = getXmxSize(defaultValue)
     defaultValueInt = formatXmxSizeToBytes(defaultValueXmx)
     if valueInt < defaultValueInt:
-      return "Value is less than the recommended default of -Xmx" + defaultValueXmx
+      return self.getWarnItem("Value is less than the recommended default of -Xmx" + defaultValueXmx)
     return None
 
   def validateMapReduce2Configurations(self, properties, recommendedDefaults):
-    validationItems = [ {"config-name": 'mapreduce.map.java.opts', "message": self.validateXmxValue(properties, recommendedDefaults, 'mapreduce.map.java.opts')},
-                        {"config-name": 'mapreduce.reduce.java.opts', "message": self.validateXmxValue(properties, recommendedDefaults, 'mapreduce.reduce.java.opts')},
-                        {"config-name": 'mapreduce.task.io.sort.mb', "message": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'mapreduce.task.io.sort.mb')},
-                        {"config-name": 'mapreduce.map.memory.mb', "message": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'mapreduce.map.memory.mb')},
-                        {"config-name": 'mapreduce.reduce.memory.mb', "message": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'mapreduce.reduce.memory.mb')},
-                        {"config-name": 'yarn.app.mapreduce.am.resource.mb', "message": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'yarn.app.mapreduce.am.resource.mb')},
-                        {"config-name": 'yarn.app.mapreduce.am.command-opts', "message": self.validateXmxValue(properties, recommendedDefaults, 'yarn.app.mapreduce.am.command-opts')} ]
-    return self.toConfigurationValidationErrors(validationItems, "mapred-site")
+    validationItems = [ {"config-name": 'mapreduce.map.java.opts', "item": self.validateXmxValue(properties, recommendedDefaults, 'mapreduce.map.java.opts')},
+                        {"config-name": 'mapreduce.reduce.java.opts', "item": self.validateXmxValue(properties, recommendedDefaults, 'mapreduce.reduce.java.opts')},
+                        {"config-name": 'mapreduce.task.io.sort.mb', "item": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'mapreduce.task.io.sort.mb')},
+                        {"config-name": 'mapreduce.map.memory.mb', "item": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'mapreduce.map.memory.mb')},
+                        {"config-name": 'mapreduce.reduce.memory.mb', "item": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'mapreduce.reduce.memory.mb')},
+                        {"config-name": 'yarn.app.mapreduce.am.resource.mb', "item": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'yarn.app.mapreduce.am.resource.mb')},
+                        {"config-name": 'yarn.app.mapreduce.am.command-opts', "item": self.validateXmxValue(properties, recommendedDefaults, 'yarn.app.mapreduce.am.command-opts')} ]
+    return self.toConfigurationValidationProblems(validationItems, "mapred-site")
 
   def validateYARNConfigurations(self, properties, recommendedDefaults):
-    validationItems = [ {"config-name": 'yarn.nodemanager.resource.memory-mb', "message": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'yarn.nodemanager.resource.memory-mb')},
-                        {"config-name": 'yarn.scheduler.minimum-allocation-mb', "message": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'yarn.scheduler.minimum-allocation-mb')},
-                        {"config-name": 'yarn.scheduler.maximum-allocation-mb', "message": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'yarn.scheduler.maximum-allocation-mb')} ]
-    return self.toConfigurationValidationErrors(validationItems, "yarn-site")
+    validationItems = [ {"config-name": 'yarn.nodemanager.resource.memory-mb', "item": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'yarn.nodemanager.resource.memory-mb')},
+                        {"config-name": 'yarn.scheduler.minimum-allocation-mb', "item": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'yarn.scheduler.minimum-allocation-mb')},
+                        {"config-name": 'yarn.scheduler.maximum-allocation-mb', "item": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'yarn.scheduler.maximum-allocation-mb')} ]
+    return self.toConfigurationValidationProblems(validationItems, "yarn-site")
 
 
 # Validation helper methods

http://git-wip-us.apache.org/repos/asf/ambari/blob/fa10e3bf/ambari-server/src/main/resources/stacks/HDP/2.1/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.1/services/stack_advisor.py
index e4168d7..98fee5d 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1/services/stack_advisor.py
@@ -89,14 +89,14 @@ class HDP21StackAdvisor(HDP206StackAdvisor):
       return validator
 
   def validateHiveConfigurations(self, properties, recommendedDefaults):
-    validationItems = [ {"config-name": 'hive.tez.container.size', "message": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'hive.tez.container.size')},
-                        {"config-name": 'hive.tez.java.opts', "message": self.validateXmxValue(properties, recommendedDefaults, 'hive.tez.java.opts')},
-                        {"config-name": 'hive.auto.convert.join.noconditionaltask.size', "message": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'hive.auto.convert.join.noconditionaltask.size')} ]
-    return self.toConfigurationValidationErrors(validationItems, "hive-site")
+    validationItems = [ {"config-name": 'hive.tez.container.size', "item": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'hive.tez.container.size')},
+                        {"config-name": 'hive.tez.java.opts', "item": self.validateXmxValue(properties, recommendedDefaults, 'hive.tez.java.opts')},
+                        {"config-name": 'hive.auto.convert.join.noconditionaltask.size', "item": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'hive.auto.convert.join.noconditionaltask.size')} ]
+    return self.toConfigurationValidationProblems(validationItems, "hive-site")
 
   def validateTezConfigurations(self, properties, recommendedDefaults):
-    validationItems = [ {"config-name": 'tez.am.resource.memory.mb', "message": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'tez.am.resource.memory.mb')},
-                        {"config-name": 'tez.am.java.opts', "message": self.validateXmxValue(properties, recommendedDefaults, 'tez.am.java.opts')} ]
-    return self.toConfigurationValidationErrors(validationItems, "tez-site")
+    validationItems = [ {"config-name": 'tez.am.resource.memory.mb', "item": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'tez.am.resource.memory.mb')},
+                        {"config-name": 'tez.am.java.opts', "item": self.validateXmxValue(properties, recommendedDefaults, 'tez.am.java.opts')} ]
+    return self.toConfigurationValidationProblems(validationItems, "tez-site")
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/fa10e3bf/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
index d32fa56..898797a 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
@@ -99,9 +99,9 @@ class TestHDP206StackAdvisor(TestCase):
     result = self.stackAdvisor.validateComponentLayout(services, hosts)
 
     expectedItems = [
-      {"message": "NameNode and Secondary NameNode cannot be hosted on same machine", "host": "host1"},
-      {"message": "NameNode and Secondary NameNode cannot be hosted on same machine", "host": "host1"},
-      {"message": "Host is not used", "host": "host2"}
+      {"message": "NameNode and Secondary NameNode cannot be hosted on same machine", "level": "WARN", "host": "host1"},
+      {"message": "NameNode and Secondary NameNode cannot be hosted on same machine", "level": "WARN", "host": "host1"},
+      {"message": "Host is not used", "level": "ERROR", "host": "host2"}
     ]
     self.assertValidationResult(expectedItems, result)
 
@@ -120,7 +120,27 @@ class TestHDP206StackAdvisor(TestCase):
     result = self.stackAdvisor.validateComponentLayout(services, hosts)
 
     expectedItems = [
-      {"message": "Cardinality violation, cardinality=ALL, hosts count=1"}
+      {"message": "Cardinality violation, cardinality=ALL, hosts count=1", "level": "ERROR"}
+    ]
+    self.assertValidationResult(expectedItems, result)
+
+  def test_validationWarnMessagesIfLessThanDefault(self):
+    servicesInfo = [
+      {
+        "name": "YARN",
+        "components": []
+      }
+    ]
+    services = self.prepareServices(servicesInfo)
+    services["configurations"] = {"yarn-site":{"properties":{"yarn.nodemanager.resource.memory-mb": "0",
+                                                             "yarn.scheduler.minimum-allocation-mb": "str"}}}
+    hosts = self.prepareHosts([])
+    result = self.stackAdvisor.validateConfigurations(services, hosts)
+
+    expectedItems = [
+      {"message": "Value is less than the recommended default of 2046", "level": "WARN"},
+      {"message": "Value should be integer", "level": "ERROR"},
+      {"message": "Value should be set", "level": "ERROR"}
     ]
     self.assertValidationResult(expectedItems, result)
 
@@ -139,7 +159,7 @@ class TestHDP206StackAdvisor(TestCase):
     result = self.stackAdvisor.validateComponentLayout(services, hosts)
 
     expectedItems = [
-      {"message": "Host is not used", "host": "host1"}
+      {"message": "Host is not used", "host": "host1", "level": "ERROR"}
     ]
     self.assertValidationResult(expectedItems, result)
 
@@ -157,7 +177,7 @@ class TestHDP206StackAdvisor(TestCase):
     result = self.stackAdvisor.validateComponentLayout(services, hosts)
 
     expectedItems = [
-      {"message": "Cardinality violation, cardinality=0-1, hosts count=2"}
+      {"message": "Cardinality violation, cardinality=0-1, hosts count=2", "level": "ERROR"}
     ]
     self.assertValidationResult(expectedItems, result)
 
@@ -175,7 +195,7 @@ class TestHDP206StackAdvisor(TestCase):
     result = self.stackAdvisor.validateComponentLayout(services, hosts)
 
     expectedItems = [
-      {"message": "Host is not used", "host": "host2"}
+      {"message": "Host is not used", "host": "host2", "level": "ERROR"}
     ]
     self.assertValidationResult(expectedItems, result)
 
@@ -244,7 +264,7 @@ class TestHDP206StackAdvisor(TestCase):
   def assertValidationResult(self, expectedItems, result):
     actualItems = []
     for item in result["items"]:
-      next = { "message": item["message"] }
+      next = {"message": item["message"], "level": item["level"]}
       try:
         next["host"] = item["host"]
       except KeyError, err:


[42/45] git commit: AMBARI-7061 Config History: View, Compare, and Make Current buttons should be disabled in certain cases. (atkach)

Posted by jo...@apache.org.
AMBARI-7061 Config History: View, Compare, and Make Current buttons should be disabled in certain cases. (atkach)


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

Branch: refs/heads/branch-alerts-dev
Commit: 86d4083972567347c0092288e9a131d4e9a7e705
Parents: c4f1e16
Author: atkach <at...@hortonworks.com>
Authored: Thu Aug 28 19:27:32 2014 +0300
Committer: atkach <at...@hortonworks.com>
Committed: Thu Aug 28 19:27:32 2014 +0300

----------------------------------------------------------------------
 ambari-web/app/messages.js                          |  3 +++
 ambari-web/app/models/service_config_version.js     | 16 +++++++++++++++-
 ambari-web/app/styles/application.less              |  4 ++++
 .../common/configs/config_history_flow.hbs          | 12 ++++++------
 4 files changed, 28 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/86d40839/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 36bfa10..11c2015 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -2004,6 +2004,9 @@ Em.I18n.translations = {
   'dashboard.configHistory.info-bar.makeCurrent.popup.title': 'Make Current Confirmation',
   'dashboard.configHistory.info-bar.save.popup.placeholder': 'What did you change?',
   'dashboard.configHistory.info-bar.revert.button': 'Make current',
+  'dashboard.configHistory.info-bar.view.button.disabled': 'You are currently viewing this version.',
+  'dashboard.configHistory.info-bar.compare.button.disabled': 'You cannot compare against the same version.',
+  'dashboard.configHistory.info-bar.revert.button.disabled': 'This is the current version.',
 
 
   'timeRange.presets.1hour':'1h',

http://git-wip-us.apache.org/repos/asf/ambari/blob/86d40839/ambari-web/app/models/service_config_version.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/service_config_version.js b/ambari-web/app/models/service_config_version.js
index 807d76f..93da4aa 100644
--- a/ambari-web/app/models/service_config_version.js
+++ b/ambari-web/app/models/service_config_version.js
@@ -56,7 +56,21 @@ App.ServiceConfigVersion = DS.Model.extend({
   isRequested: DS.attr('boolean'),
   isRestartRequired: function () {
     return this.get('service.isRestartRequired') && this.get('isCurrent');
-  }.property('service.isRestartRequired', 'isCurrent')
+  }.property('service.isRestartRequired', 'isCurrent'),
+  disabledActionMessages: function () {
+    return {
+      view: (this.get('isDisplayed')) ? Em.I18n.t('dashboard.configHistory.info-bar.view.button.disabled') : '',
+      compare: (this.get('isDisplayed')) ? Em.I18n.t('dashboard.configHistory.info-bar.compare.button.disabled') : '',
+      revert: (this.get('isCurrent')) ? Em.I18n.t('dashboard.configHistory.info-bar.revert.button.disabled') : ''
+    }
+  }.property('isDisplayed', 'isCurrent'),
+  disabledActionAttr: function () {
+    return {
+      view: (this.get('isDisplayed')) ? 'disabled' : false,
+      compare: (this.get('isDisabled') || this.get('isDisplayed')) ? 'disabled' : false,
+      revert: (this.get('isDisabled') || this.get('isCurrent')) ? 'disabled' : false
+    }
+  }.property('isDisplayed', 'isCurrent', 'isDisabled')
 });
 
 App.ServiceConfigVersion.FIXTURES = [];

http://git-wip-us.apache.org/repos/asf/ambari/blob/86d40839/ambari-web/app/styles/application.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less
index 0570220..a5843eb 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -6808,6 +6808,10 @@ i.icon-asterisks {
   border: 0;
 }
 
+.not-allowed-cursor {
+  cursor: not-allowed !important;
+}
+
 #flume-summary {
   text-align:left !important;
   max-height: 490px;

http://git-wip-us.apache.org/repos/asf/ambari/blob/86d40839/ambari-web/app/templates/common/configs/config_history_flow.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/config_history_flow.hbs b/ambari-web/app/templates/common/configs/config_history_flow.hbs
index 55e622f..5dabe52 100644
--- a/ambari-web/app/templates/common/configs/config_history_flow.hbs
+++ b/ambari-web/app/templates/common/configs/config_history_flow.hbs
@@ -44,9 +44,9 @@
               <div class="notes">{{serviceVersion.briefNotes}}</div>
             </div>
             <div>
-              <button class="btn" {{action switchVersion serviceVersion target="view"}}><i class="icon-search"></i>&nbsp;{{t common.view}}</button>
-              <button class="btn" {{bindAttr disabled="serviceVersion.isDisabled"}} {{action compare serviceVersion target="view"}}><i class="icon-copy"></i>&nbsp;{{t common.compare}}</button>
-              <button class="btn" {{bindAttr disabled="serviceVersion.isDisabled"}} {{action revert serviceVersion target="view"}}>{{t dashboard.configHistory.info-bar.revert.button}}</button>
+                <button {{bindAttr disabled="serviceVersion.disabledActionAttr.view" class=":btn serviceVersion.isDisplayed:not-allowed-cursor" title="serviceVersion.disabledActionMessages.view"}} {{action switchVersion serviceVersion target="view"}}><i class="icon-search"></i>&nbsp;{{t common.view}}</button>
+                <button {{bindAttr disabled="serviceVersion.disabledActionAttr.compare" class=":btn serviceVersion.isDisplayed:not-allowed-cursor" title="serviceVersion.disabledActionMessages.compare"}} {{action compare serviceVersion target="view"}}><i class="icon-copy"></i>&nbsp;{{t common.compare}}</button>
+                <button {{bindAttr disabled="serviceVersion.disabledActionAttr.revert" class=":btn serviceVersion.isCurrent:not-allowed-cursor" title="serviceVersion.disabledActionMessages.revert"}} {{action revert serviceVersion target="view"}}>{{t dashboard.configHistory.info-bar.revert.button}}</button>
             </div>
           </div>
         </div>
@@ -99,9 +99,9 @@
                                     <div class="notes">{{serviceVersion.briefNotes}}</div>
                                 </div>
                                 <div>
-                                    <button class="btn" {{action switchVersion serviceVersion target="view"}}><i class="icon-search"></i>&nbsp;{{t common.view}}</button>
-                                    <button class="btn" {{bindAttr disabled="serviceVersion.isDisabled"}} {{action compare serviceVersion target="view"}}><i class="icon-copy"></i>&nbsp;{{t common.compare}}</button>
-                                    <button class="btn" {{bindAttr disabled="serviceVersion.isDisabled"}} {{action revert serviceVersion target="view"}}>{{t dashboard.configHistory.info-bar.revert.button}}</button>
+                                    <button {{bindAttr disabled="serviceVersion.disabledActionAttr.view" class=":btn serviceVersion.isDisplayed:not-allowed-cursor" title="serviceVersion.disabledActionMessages.view"}} {{action switchVersion serviceVersion target="view"}}><i class="icon-search"></i>&nbsp;{{t common.view}}</button>
+                                    <button {{bindAttr disabled="serviceVersion.disabledActionAttr.compare" class=":btn serviceVersion.isDisplayed:not-allowed-cursor" title="serviceVersion.disabledActionMessages.compare"}} {{action compare serviceVersion target="view"}}><i class="icon-copy"></i>&nbsp;{{t common.compare}}</button>
+                                    <button {{bindAttr disabled="serviceVersion.disabledActionAttr.revert" class=":btn serviceVersion.isCurrent:not-allowed-cursor" title="serviceVersion.disabledActionMessages.revert"}} {{action revert serviceVersion target="view"}}>{{t dashboard.configHistory.info-bar.revert.button}}</button>
                                 </div>
                             </ul>
                         </li>


[28/45] git commit: AMBARI-6967. Admin View: default login behavior (route to Admin View, Cluster Dashboard, or Views Landing page). (yusaku)

Posted by jo...@apache.org.
AMBARI-6967. Admin View: default login behavior (route to Admin View, Cluster Dashboard, or Views Landing page). (yusaku)


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

Branch: refs/heads/branch-alerts-dev
Commit: e1634809f0c4c6a6acfe1b2672b4ddfcaf2d5e92
Parents: 2051c64
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Wed Aug 27 23:09:59 2014 -0700
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Wed Aug 27 23:09:59 2014 -0700

----------------------------------------------------------------------
 .../controllers/global/cluster_controller.js    | 44 --------------------
 1 file changed, 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e1634809/ambari-web/app/controllers/global/cluster_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/cluster_controller.js b/ambari-web/app/controllers/global/cluster_controller.js
index 246ad8b..bc09b0a 100644
--- a/ambari-web/app/controllers/global/cluster_controller.js
+++ b/ambari-web/app/controllers/global/cluster_controller.js
@@ -347,50 +347,6 @@ App.ClusterController = Em.Controller.extend({
     }, callback)
   },
 
-  loadAmbariViews: function () {
-    App.ajax.send({
-      name: 'views.info',
-      sender: this,
-      success: 'loadAmbariViewsSuccess'
-    });
-  },
-
-  loadAmbariViewsSuccess: function (data) {
-    if (data.items.length) {
-      App.ajax.send({
-        name: 'views.instances',
-        sender: this,
-        success: 'loadViewInstancesSuccess'
-      });
-    } else {
-      this.set('ambariViews', []);
-    }
-  },
-
-  loadViewInstancesSuccess: function (data) {
-    this.set('ambariViews', []);
-    var self = this;
-    data.items.forEach(function (view) {
-      view.versions.forEach(function (version) {
-        version.instances.forEach(function (instance) {
-          var current_instance = Em.Object.create({
-            iconPath: instance.ViewInstanceInfo.icon_path || "/img/ambari-view-default.png",
-            label: instance.ViewInstanceInfo.label || version.ViewVersionInfo.label || instance.ViewInstanceInfo.view_name,
-            visible: instance.ViewInstanceInfo.visible || false,
-            version: instance.ViewInstanceInfo.version,
-            description: instance.ViewInstanceInfo.description || Em.I18n.t('views.main.instance.noDescription'),
-            viewName: instance.ViewInstanceInfo.view_name,
-            instanceName: instance.ViewInstanceInfo.instance_name,
-            href: instance.ViewInstanceInfo.context_path
-          });
-          if( current_instance.visible){
-            self.get('ambariViews').pushObject(current_instance);
-          }
-        }, this);
-      }, this);
-    }, this);
-  },
-
   /**
    *
    * @param callback


[31/45] git commit: AMBARI-7052 Unable to load step 1 of Add Service Wizard. (Max Shepel via ababiichuk)

Posted by jo...@apache.org.
AMBARI-7052 Unable to load step 1 of Add Service Wizard.  (Max Shepel via ababiichuk)


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

Branch: refs/heads/branch-alerts-dev
Commit: b35b87d6f70d5b2cca7501826096f5840b9fc9eb
Parents: cd0081c
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Thu Aug 28 12:50:15 2014 +0300
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Thu Aug 28 12:50:15 2014 +0300

----------------------------------------------------------------------
 ambari-web/app/mappers/stack_service_mapper.js | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b35b87d6/ambari-web/app/mappers/stack_service_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/stack_service_mapper.js b/ambari-web/app/mappers/stack_service_mapper.js
index 1f3d0c2..e74308d 100644
--- a/ambari-web/app/mappers/stack_service_mapper.js
+++ b/ambari-web/app/mappers/stack_service_mapper.js
@@ -103,7 +103,6 @@ App.stackServiceMapper = App.QuickDataMapper.create({
         Ember.run(this, function () {
           rec.deleteRecord();
           App.store.commit();
-          rec.get('stateManager').transitionTo('loading');
         });
       }, this);
     }, this);


[21/45] git commit: Revert "AMBARI-7031. FE: Next button not enabled when only /validation ERRORs are there. (ababiichuk via srimanth)"

Posted by jo...@apache.org.
Revert "AMBARI-7031. FE: Next button not enabled when only /validation ERRORs are there. (ababiichuk via srimanth)"

This reverts commit 966fff415353beff39a4c4cc72ae38b5974ffaa5.


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

Branch: refs/heads/branch-alerts-dev
Commit: fdb54a10f7f22dac46e3fcd4aaa6deba0c262916
Parents: fc626c9
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Wed Aug 27 16:00:38 2014 -0700
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Wed Aug 27 16:00:38 2014 -0700

----------------------------------------------------------------------
 ambari-web/app/mixins/common/serverValidator.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/fdb54a10/ambari-web/app/mixins/common/serverValidator.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/serverValidator.js b/ambari-web/app/mixins/common/serverValidator.js
index 71169c5..3a1dbed 100644
--- a/ambari-web/app/mixins/common/serverValidator.js
+++ b/ambari-web/app/mixins/common/serverValidator.js
@@ -236,8 +236,8 @@ App.ServerValidatorMixin = Em.Mixin.create({
               if ((property.get('filename') == item['config-type'] + '.xml') && (property.get('name') == item['config-name'])) {
                 if (item.level == "ERROR") {
                   self.set('configValidationError', true);
-                  property.set('errorMessage', item.message);
-                  property.set('error', true);
+                  property.set('warnMessage', item.message);
+                  property.set('warn', true);
                 } else if (item.level == "WARN") {
                   self.set('configValidationWarning', true);
                   property.set('warnMessage', item.message);


[18/45] git commit: Revert "AMBARI-7043. BE: Move stack_advisor.py abstract class one folder up"

Posted by jo...@apache.org.
Revert "AMBARI-7043. BE: Move stack_advisor.py abstract class one folder up"

This reverts commit 40e3f0fc5d34b4d96a95e0e568e8754b042dc6f5.


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

Branch: refs/heads/branch-alerts-dev
Commit: 4c5ed4c0cf7eb305fcdfbfd110476a015afbd5e1
Parents: debf29c
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Wed Aug 27 15:44:13 2014 -0700
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Wed Aug 27 15:44:18 2014 -0700

----------------------------------------------------------------------
 .../src/main/resources/scripts/stack_advisor.py |  2 +-
 .../main/resources/stacks/HDP/stack_advisor.py  | 37 ++++++++
 .../src/main/resources/stacks/stack_advisor.py  | 37 --------
 .../server/api/services/AmbariMetaInfoTest.java |  4 +-
 .../AmbariManagementControllerTest.java         |  2 +-
 .../src/test/python/TestStackAdvisor.py         | 93 --------------------
 .../stacks/2.0.6/common/test_stack_advisor.py   |  2 +-
 .../stacks/XYZ/1.0.0/services/stack_advisor.py  | 67 --------------
 .../stacks/XYZ/1.0.1/services/stack_advisor.py  | 30 -------
 9 files changed, 41 insertions(+), 233 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4c5ed4c0/ambari-server/src/main/resources/scripts/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/scripts/stack_advisor.py b/ambari-server/src/main/resources/scripts/stack_advisor.py
index ed50866..61d1e09 100755
--- a/ambari-server/src/main/resources/scripts/stack_advisor.py
+++ b/ambari-server/src/main/resources/scripts/stack_advisor.py
@@ -33,7 +33,7 @@ ALL_ACTIONS = [ RECOMMEND_COMPONENT_LAYOUT_ACTION, VALIDATE_COMPONENT_LAYOUT_ACT
 USAGE = "Usage: <action> <hosts_file> <services_file>\nPossible actions are: {0}\n".format( str(ALL_ACTIONS) )
 
 SCRIPT_DIRECTORY = os.path.dirname(os.path.abspath(__file__))
-STACK_ADVISOR_PATH_TEMPLATE = os.path.join(SCRIPT_DIRECTORY, '../stacks/stack_advisor.py')
+STACK_ADVISOR_PATH_TEMPLATE = os.path.join(SCRIPT_DIRECTORY, '../stacks/{0}/stack_advisor.py')
 STACK_ADVISOR_IMPL_PATH_TEMPLATE = os.path.join(SCRIPT_DIRECTORY, './../stacks/{0}/{1}/services/stack_advisor.py')
 STACK_ADVISOR_IMPL_CLASS_TEMPLATE = '{0}{1}StackAdvisor'
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/4c5ed4c0/ambari-server/src/main/resources/stacks/HDP/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/stack_advisor.py
new file mode 100644
index 0000000..5f66fff
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/stack_advisor.py
@@ -0,0 +1,37 @@
+#!/usr/bin/env ambari-python-wrap
+"""
+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.
+"""
+
+class StackAdvisor(object):
+
+  def recommendComponentLayout(self, services, hosts):
+    """Returns Services object with hostnames array populated for components"""
+    pass
+
+  def validateComponentLayout(self, services, hosts):
+    """Returns array of Validation objects about issues with hostnames components assigned to"""
+    pass
+
+  def recommendConfigurations(self, services, hosts):
+    """Returns Services object with configurations object populated"""
+    pass
+
+  def validateConfigurations(self, services, hosts):
+    """Returns array of Validation objects about issues with configuration values provided in services"""
+    pass
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/4c5ed4c0/ambari-server/src/main/resources/stacks/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/stack_advisor.py b/ambari-server/src/main/resources/stacks/stack_advisor.py
deleted file mode 100644
index 5f66fff..0000000
--- a/ambari-server/src/main/resources/stacks/stack_advisor.py
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/usr/bin/env ambari-python-wrap
-"""
-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.
-"""
-
-class StackAdvisor(object):
-
-  def recommendComponentLayout(self, services, hosts):
-    """Returns Services object with hostnames array populated for components"""
-    pass
-
-  def validateComponentLayout(self, services, hosts):
-    """Returns array of Validation objects about issues with hostnames components assigned to"""
-    pass
-
-  def recommendConfigurations(self, services, hosts):
-    """Returns Services object with configurations object populated"""
-    pass
-
-  def validateConfigurations(self, services, hosts):
-    """Returns array of Validation objects about issues with configuration values provided in services"""
-    pass
-

http://git-wip-us.apache.org/repos/asf/ambari/blob/4c5ed4c0/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java
index c08534c..37d1af4 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java
@@ -73,7 +73,6 @@ import com.google.inject.Injector;
 public class AmbariMetaInfoTest {
 
   private static final String STACK_NAME_HDP = "HDP";
-  private static final String STACK_NAME_XYZ = "XYZ";
   private static final String STACK_VERSION_HDP = "0.1";
   private static final String EXT_STACK_NAME = "2.0.6";
   private static final String STACK_VERSION_HDP_02 = "0.2";
@@ -89,7 +88,7 @@ public class AmbariMetaInfoTest {
   private static final String NON_EXT_VALUE = "XXX";
 
   private static final int REPOS_CNT = 3;
-  private static final int STACKS_NAMES_CNT = 2;
+  private static final int STACKS_NAMES_CNT = 1;
   private static final int PROPERTIES_CNT = 62;
   private static final int OS_CNT = 4;
 
@@ -409,7 +408,6 @@ public class AmbariMetaInfoTest {
     Set<Stack> stackNames = metaInfo.getStackNames();
     assertEquals(stackNames.size(), STACKS_NAMES_CNT);
     assertTrue(stackNames.contains(new Stack(STACK_NAME_HDP)));
-    assertTrue(stackNames.contains(new Stack(STACK_NAME_XYZ)));
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/ambari/blob/4c5ed4c0/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
index 5fdd619..1bfc25a 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
@@ -156,7 +156,7 @@ public class AmbariManagementControllerTest {
   private static final String NAGIOS_SERVICE_NAME = "NAGIOS";
   private static final int STACK_VERSIONS_CNT = 12;
   private static final int REPOS_CNT = 3;
-  private static final int STACKS_CNT = 2;
+  private static final int STACKS_CNT = 1;
   private static final int STACK_PROPERTIES_CNT = 99;
   private static final int STACK_COMPONENTS_CNT = 4;
   private static final int OS_CNT = 2;

http://git-wip-us.apache.org/repos/asf/ambari/blob/4c5ed4c0/ambari-server/src/test/python/TestStackAdvisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/TestStackAdvisor.py b/ambari-server/src/test/python/TestStackAdvisor.py
deleted file mode 100644
index 5a1a242..0000000
--- a/ambari-server/src/test/python/TestStackAdvisor.py
+++ /dev/null
@@ -1,93 +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.
-'''
-
-from unittest import TestCase
-import os
-
-class TestStackAdvisorInitialization(TestCase):
-
-  def setUp(self):
-    import imp
-
-    self.test_directory = os.path.dirname(os.path.abspath(__file__))
-    stack_advisor_path = os.path.join(self.test_directory, '../../main/resources/scripts/stack_advisor.py')
-    with open(stack_advisor_path, 'rb') as fp:
-        self.stack_advisor = imp.load_module( 'stack_advisor', fp, stack_advisor_path, ('.py', 'rb', imp.PY_SOURCE) )
-
-  def test_stackAdvisorLoadedForNotHDPStack(self):
-    path_template = os.path.join(self.test_directory, '../resources/stacks/{0}/{1}/services/stack_advisor.py')
-    path_template_name = "STACK_ADVISOR_IMPL_PATH_TEMPLATE"
-    setattr(self.stack_advisor, path_template_name, path_template)
-    self.assertEquals(path_template, getattr(self.stack_advisor, path_template_name))
-    instantiate_stack_advisor_method_name = 'instantiateStackAdvisor'
-    instantiate_stack_advisor_method = getattr(self.stack_advisor, instantiate_stack_advisor_method_name)
-    stack_advisor = instantiate_stack_advisor_method("XYZ", "1.0.1", ["1.0.0"])
-    self.assertEquals("XYZ101StackAdvisor", stack_advisor.__class__.__name__)
-    services = {"Versions":
-                  {
-                    "stack_name":"XYZ",
-                    "stack_version":"1.0.1"
-                  },
-                "services":[
-                  {
-                    "StackServices":{
-                      "service_name":"YARN"
-                    },
-                    "components":[
-                      {
-                        "StackServiceComponents": {
-                          "component_name": "RESOURCEMANAGER"
-                        }
-                      },
-                      {
-                        "StackServiceComponents": {
-                          "component_name": "APP_TIMELINE_SERVER"
-                        }
-                      },
-                      {
-                        "StackServiceComponents": {
-                          "component_name":"YARN_CLIENT"
-                        }
-                      },
-                      {
-                        "StackServiceComponents": {
-                          "component_name": "NODEMANAGER"
-                        }
-                      }
-                    ]
-                  }
-                ]
-    }
-    hosts= {
-      "items": [
-        {"Hosts": {"host_name": "host1"}},
-        {"Hosts": {"host_name": "host2"}}
-      ]
-    }
-    config_recommendations = stack_advisor.recommendConfigurations(services, hosts)
-    yarn_configs = config_recommendations["recommendations"]["blueprint"]["configurations"]["yarn-site"]["properties"]
-    '''Check that value is populated from child class, not parent'''
-    self.assertEquals("-Xmx101m", yarn_configs["yarn.nodemanager.resource.memory-mb"])
-
-  def test_stackAdvisorSuperClassIsFoundAndReturnedAsDefaultImpl(self):
-    instantiate_stack_advisor_method_name = 'instantiateStackAdvisor'
-    instantiate_stack_advisor_method = getattr(self.stack_advisor, instantiate_stack_advisor_method_name)
-    '''Not existent stack - to return default implementation'''
-    default_stack_advisor = instantiate_stack_advisor_method("HDP1", "2.0.6", [])
-    self.assertEquals("StackAdvisor", default_stack_advisor.__class__.__name__)
-

http://git-wip-us.apache.org/repos/asf/ambari/blob/4c5ed4c0/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
index b1b9f7a..71e329b 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
@@ -26,7 +26,7 @@ class TestHDP206StackAdvisor(TestCase):
     import os
 
     testDirectory = os.path.dirname(os.path.abspath(__file__))
-    stackAdvisorPath = os.path.join(testDirectory, '../../../../../main/resources/stacks/stack_advisor.py')
+    stackAdvisorPath = os.path.join(testDirectory, '../../../../../main/resources/stacks/HDP/stack_advisor.py')
     hdp206StackAdvisorPath = os.path.join(testDirectory, '../../../../../main/resources/stacks/HDP/2.0.6/services/stack_advisor.py')
     hdp206StackAdvisorClassName = 'HDP206StackAdvisor'
     with open(stackAdvisorPath, 'rb') as fp:

http://git-wip-us.apache.org/repos/asf/ambari/blob/4c5ed4c0/ambari-server/src/test/resources/stacks/XYZ/1.0.0/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/stacks/XYZ/1.0.0/services/stack_advisor.py b/ambari-server/src/test/resources/stacks/XYZ/1.0.0/services/stack_advisor.py
deleted file mode 100644
index ba140bb..0000000
--- a/ambari-server/src/test/resources/stacks/XYZ/1.0.0/services/stack_advisor.py
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/env ambari-python-wrap
-"""
-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.
-"""
-
-from stack_advisor import StackAdvisor
-
-class XYZ100StackAdvisor(StackAdvisor):
-
-  def recommendConfigurations(self, services, hosts):
-    stackName = services["Versions"]["stack_name"]
-    stackVersion = services["Versions"]["stack_version"]
-    hostsList = [host["Hosts"]["host_name"] for host in hosts["items"]]
-    servicesList = [service["StackServices"]["service_name"] for service in services["services"]]
-
-    recommendations = {
-      "Versions": {"stack_name": stackName, "stack_version": stackVersion},
-      "hosts": hostsList,
-      "services": servicesList,
-      "recommendations": {
-        "blueprint": {
-          "configurations": {},
-          "host_groups": []
-        },
-        "blueprint_cluster_binding": {
-          "host_groups": []
-        }
-      }
-    }
-
-    configurations = recommendations["recommendations"]["blueprint"]["configurations"]
-    for service in servicesList:
-      calculation = self.recommendServiceConfigurations(service)
-      if calculation is not None:
-        calculation(configurations)
-
-    return recommendations
-
-  def recommendServiceConfigurations(self, service):
-    return {
-      "YARN": self.recommendYARNConfigurations,
-    }.get(service, None)
-
-  def putProperty(self, config, configType):
-    config[configType] = {"properties": {}}
-    def appendProperty(key, value):
-      config[configType]["properties"][key] = str(value)
-    return appendProperty
-
-  def recommendYARNConfigurations(self, configurations):
-    putYarnProperty = self.putProperty(configurations, "yarn-site")
-    putYarnProperty('yarn.nodemanager.resource.memory-mb', "-Xmx100m")
-

http://git-wip-us.apache.org/repos/asf/ambari/blob/4c5ed4c0/ambari-server/src/test/resources/stacks/XYZ/1.0.1/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/stacks/XYZ/1.0.1/services/stack_advisor.py b/ambari-server/src/test/resources/stacks/XYZ/1.0.1/services/stack_advisor.py
deleted file mode 100644
index 74a4b31..0000000
--- a/ambari-server/src/test/resources/stacks/XYZ/1.0.1/services/stack_advisor.py
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/env ambari-python-wrap
-"""
-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 re
-import socket
-import sys
-
-from stack_advisor import StackAdvisor
-
-class XYZ101StackAdvisor(XYZ100StackAdvisor):
-
-  def recommendYARNConfigurations(self, configurations):
-    putYarnProperty = self.putProperty(configurations, "yarn-site")
-    putYarnProperty('yarn.nodemanager.resource.memory-mb', "-Xmx101m")


[33/45] git commit: AMBARI-7054. Slider View: Create app wizard should allow adding of custom-configs. (onechiporenko)

Posted by jo...@apache.org.
AMBARI-7054. Slider View: Create app wizard should allow adding of custom-configs. (onechiporenko)


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

Branch: refs/heads/branch-alerts-dev
Commit: 0fb6e635577aab62157711f1a73c65feb38018c2
Parents: 6bcd6d5
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Thu Aug 28 16:26:23 2014 +0300
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Thu Aug 28 16:26:23 2014 +0300

----------------------------------------------------------------------
 .../ui/app/components/configSection.js          | 122 +++++++++++++++++--
 .../createAppWizard/step1_controller.js         |   1 +
 .../createAppWizard/step3_controller.js         |  13 +-
 .../controllers/create_app_wizard_controller.js |  27 +++-
 .../app/templates/components/configSection.hbs  |  58 ++++++++-
 .../ui/app/templates/createAppWizard/step3.hbs  |   6 +-
 .../src/main/resources/ui/app/translations.js   |   6 +
 7 files changed, 207 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0fb6e635/contrib/views/slider/src/main/resources/ui/app/components/configSection.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/components/configSection.js b/contrib/views/slider/src/main/resources/ui/app/components/configSection.js
index 7b2481d..c5858bc 100644
--- a/contrib/views/slider/src/main/resources/ui/app/components/configSection.js
+++ b/contrib/views/slider/src/main/resources/ui/app/components/configSection.js
@@ -17,32 +17,134 @@
  */
 
 App.ConfigSectionComponent = Em.Component.extend({
-  layoutName:'components/configSection',
-  config:null,
-  section:'',
+
+  layoutName: 'components/configSection',
+
+  config: null,
+
+  section: '',
 
   /**
    * label for current section
    * @return {String}
    */
   sectionLabel: function () {
-    return this.get('section').classify();
+    return this.get('section').classify().replace(/([A-Z])/g, ' $1');
   }.property(),
 
   /**
    * Return True is section name equals 'general'
    * @type {Boolean}
    */
-  isGeneral:Ember.computed.equal('section', 'general'),
+  isGeneral: Ember.computed.equal('section', 'general'),
+
+  /**
+   * Return True is section name equals 'custom'
+   * @type {Boolean}
+   */
+  isCustom: Ember.computed.equal('section', 'custom'),
 
   /**
    * Filtered configs for current section
    */
-  sectionConfigs: Ember.computed.filter('config', function(item) {
+  sectionConfigs: Ember.computed.filter('config', function (item) {
     if (this.get('isGeneral')) {
-      return !item.name.match('^site.');
-    } else {
-      return !!item.name.match('^site.'+this.get('section')) ;
+      return !item.name.match('^site.') && this.get('predefinedConfigNames').contains(item.name);
+    }
+    else {
+      if (this.get('isCustom')) {
+        return !this.get('predefinedConfigNames').contains(item.name);
+      }
+      else {
+        return !!item.name.match('^site.' + this.get('section'));
+      }
+    }
+  }),
+
+  /**
+   * Is button "Add Property" visible
+   * True - yes, false - no (and "App Property"-form is visible)
+   * @type {bool}
+   */
+  buttonVisible: true,
+
+  /**
+   * Template for new config
+   * @type {Ember.Object}
+   */
+  newConfig: Em.Object.create({
+    name: '',
+    value: '',
+    nameError: '',
+    hasError: false
+  }),
+
+  /**
+   * Clear <code>newConfig</code>
+   * @method cleanNewConfig
+   */
+  cleanNewConfig: function() {
+    this.get('newConfig').setProperties({
+      name: '',
+      value: '',
+      messsage: '',
+      hasError: false
+    });
+  },
+
+  actions: {
+
+    /**
+     * Click on "App Property"-button
+     * @method addProperty
+     */
+    addProperty: function() {
+      this.toggleProperty('buttonVisible');
+    },
+
+    /**
+     * Delete custom config added by user
+     * @param {{name: string, label: string, value: *}} config
+     * @method deleteConfig
+     */
+    deleteConfig: function(config) {
+      this.get('config').removeObject(config);
+    },
+
+    /**
+     * Validate and save custom config added by user
+     * @method submit
+     */
+    submit: function() {
+      var name = this.get('newConfig.name'),
+        value = this.get('newConfig.value');
+      if (this.get('config').mapBy('name').contains(name)) {
+        this.get('newConfig').setProperties({
+          hasError: true,
+          messsage: Em.I18n.t('configs.add_property.name_exists')
+        });
+        return;
+      }
+      if (!/^[A-Za-z][A-Za-z0-9_\-\.]*$/.test(name)) {
+        this.get('newConfig').setProperties({
+          hasError: true,
+          messsage: Em.I18n.t('configs.add_property.invalid_name')
+        });
+        return;
+      }
+      this.get('config').pushObject({name: name, value: value, label: name});
+      this.cleanNewConfig();
+      this.toggleProperty('buttonVisible');
+    },
+
+    /**
+     * Hide "Add Property"-form
+     * @method discard
+     */
+    discard: function() {
+      this.cleanNewConfig();
+      this.toggleProperty('buttonVisible');
     }
-  })
+  }
+
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/0fb6e635/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step1_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step1_controller.js b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step1_controller.js
index 42c0080..b267170 100644
--- a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step1_controller.js
+++ b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step1_controller.js
@@ -171,6 +171,7 @@ App.CreateAppWizardStep1Controller = Ember.Controller.extend({
     newApp.set('appType', this.get('selectedType'));
     newApp.set('name', this.get('newAppName'));
     newApp.set('configs', this.get('selectedType.configs'));
+    newApp.set('predefinedConfigNames', Em.keys(this.get('selectedType.configs')));
     this.set('appWizardController.newApp', newApp);
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/0fb6e635/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js
index 12dd699..1018314 100644
--- a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js
+++ b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js
@@ -31,19 +31,19 @@ App.CreateAppWizardStep3Controller = Ember.ObjectController.extend({
   configs: Em.A(),
 
   /**
-   * Convert configs to array of uniq section names
-   * @return {Array}
+   * Convert configs to array of unique section names
+   * @type {Array}
    */
-  sectionKeys:function () {
+  sectionKeys: function () {
     var configs = this.get('newAppConfigs') || {},
-        k = ["general"];
+      k = ["general"];
 
     Object.keys(configs).forEach(function (key) {
       if (key.split('.')[0] == "site") {
         k.push(key.split('.')[1])
       }
     });
-
+    k.push('custom');
     return k.uniq();
   }.property('newAppConfigs'),
 
@@ -111,7 +111,7 @@ App.CreateAppWizardStep3Controller = Ember.ObjectController.extend({
     try {
       configs.forEach(function (item) {
         configsObject[item.name] = item.value;
-      })
+      });
       self.set('configsObject', configsObject);
     } catch (e) {
       self.set('isError', true);
@@ -129,6 +129,7 @@ App.CreateAppWizardStep3Controller = Ember.ObjectController.extend({
   },
 
   actions: {
+
     /**
      * If <code>configs</code> is valid, than save it and proceed to the next step
      */

http://git-wip-us.apache.org/repos/asf/ambari/blob/0fb6e635/contrib/views/slider/src/main/resources/ui/app/controllers/create_app_wizard_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/create_app_wizard_controller.js b/contrib/views/slider/src/main/resources/ui/app/controllers/create_app_wizard_controller.js
index 432027c..ee46ee6 100644
--- a/contrib/views/slider/src/main/resources/ui/app/controllers/create_app_wizard_controller.js
+++ b/contrib/views/slider/src/main/resources/ui/app/controllers/create_app_wizard_controller.js
@@ -49,18 +49,39 @@ App.CreateAppWizardController = Ember.ObjectController.extend({
   /**
    * Proceed user to selected step
    * @param {number} step step's number
-   * @param {bool} fromNextButon is user came from "Next"-button click
+   * @param {bool} fromNextButton is user came from "Next"-button click
    * @method gotoStep
    */
-  gotoStep: function (step, fromNextButon) {
-    if (step > this.get('TOTAL_STEPS_NUMBER') || step < 1 || (!fromNextButon && step > this.get('currentStep'))) {
+  gotoStep: function (step, fromNextButton) {
+    if (step > this.get('TOTAL_STEPS_NUMBER') || step < 1 || (!fromNextButton && step > this.get('currentStep'))) {
       return;
     }
     this.set('currentStep', step);
+
+    if (step == 1) {
+      this.dropCustomConfigs();
+    }
     this.transitionToRoute('createAppWizard.step' + step);
   },
 
   /**
+   * Custom configs added by used should be dropped if user come back to the 1st step
+   * @method dropCustomConfigs
+   */
+  dropCustomConfigs: function() {
+    var configs = this.get('newApp.configs'),
+      predefined = this.get('newApp.predefinedConfigNames'),
+      filtered = {};
+    if (!configs) return;
+    Em.keys(configs).forEach(function(name) {
+      if (predefined.contains(name)) {
+        filtered[name] = configs[name];
+      }
+    });
+    this.set('newApp.configs', filtered);
+  },
+
+  /**
    * Proceed user no next step
    * @method nextStep
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/0fb6e635/contrib/views/slider/src/main/resources/ui/app/templates/components/configSection.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/templates/components/configSection.hbs b/contrib/views/slider/src/main/resources/ui/app/templates/components/configSection.hbs
index 9b47650..c6c77ec 100644
--- a/contrib/views/slider/src/main/resources/ui/app/templates/components/configSection.hbs
+++ b/contrib/views/slider/src/main/resources/ui/app/templates/components/configSection.hbs
@@ -18,13 +18,59 @@
 
 {{#bs-panel heading=sectionLabel collapsible=true dismiss=false open=isGeneral }}
   <form class="form-horizontal" role="form">
-    {{#each sectionConfigs}}
-    <div class="form-group">
-      <label class="col-sm-4 control-label">{{formatWordBreak label devider='.'}}</label>
-      <div class="col-sm-6">
-        {{input value=value class="form-control"}}
+    {{#each config in sectionConfigs}}
+      <div class="form-group">
+
+        <label class="col-sm-4 control-label">{{formatWordBreak config.label devider='.'}}</label>
+
+        <div class="col-sm-6">
+          {{input value=config.value class="form-control"}}
+        </div>
+
+        {{#if isCustom}}
+          <div class="col-sm-2">
+            {{#bs-button clicked="deleteConfig" clickedParamBinding="config" type="danger"}}{{t common.delete}}{{/bs-button}}
+          </div>
+        {{/if}}
+
       </div>
-    </div>
     {{/each}}
   </form>
+  {{#if isCustom}}
+    {{#if buttonVisible}}
+      {{#bs-button clicked="addProperty" type="primary"}}{{t configs.add_property}}{{/bs-button}}
+    {{else}}
+      {{! "Add Property"-form}}
+      <form class="form-horizontal" role="form">
+        <div class="form-group">
+          <div class="col-sm-4">
+            <label class="control-label">{{t common.name}}</label>
+          </div>
+          <div class="col-sm-6">
+            <label class="control-label">{{t common.value}}</label>
+          </div>
+        </div>
+        <div {{bind-attr class=":form-group newConfig.hasError:has-error"}}>
+          <div class="col-sm-4">
+            {{input value=newConfig.name class="form-control"}}
+          </div>
+          <div class="col-sm-6">
+            {{input value=newConfig.value class="form-control"}}
+          </div>
+        </div>
+        <div class="form-group">
+          {{#if newConfig.hasError}}
+            <div class="col-sm-10">
+              <div class="alert alert-danger">
+                {{newConfig.messsage}}
+                </div>
+            </div>
+          {{/if}}
+        </div>
+        {{#bs-button clicked="submit" type="primary"}}{{t common.add}}{{/bs-button}}
+        {{#bs-button clicked="discard"}}{{t common.cancel}}{{/bs-button}}
+      </form>
+    {{! "Add Property"-form end}}
+    {{/if}}
+  {{/if}}
 {{/bs-panel}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/0fb6e635/contrib/views/slider/src/main/resources/ui/app/templates/createAppWizard/step3.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/templates/createAppWizard/step3.hbs b/contrib/views/slider/src/main/resources/ui/app/templates/createAppWizard/step3.hbs
index 181e93e..c7ae662 100644
--- a/contrib/views/slider/src/main/resources/ui/app/templates/createAppWizard/step3.hbs
+++ b/contrib/views/slider/src/main/resources/ui/app/templates/createAppWizard/step3.hbs
@@ -21,7 +21,11 @@
 </p>
 <div {{bind-attr class="controller.isError:has-error :form-group"}}>
   {{#each controller.sectionKeys}}
-    {{config-section section=this config=controller.configs}}
+    {{config-section
+      section=this
+      config=controller.configs
+      predefinedConfigNames=controller.appWizardController.newApp.predefinedConfigNames
+    }}
   {{/each}}
   {{#if controller.isError}}
     <div class="alert alert-danger">{{t wizard.step3.error}}</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/0fb6e635/contrib/views/slider/src/main/resources/ui/app/translations.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/translations.js b/contrib/views/slider/src/main/resources/ui/app/translations.js
index f687abb..6679e4d 100644
--- a/contrib/views/slider/src/main/resources/ui/app/translations.js
+++ b/contrib/views/slider/src/main/resources/ui/app/translations.js
@@ -24,11 +24,13 @@ Em.I18n.translations = {
   'no': 'No',
 
   'common' : {
+    'add': 'Add',
     'show': 'Show',
     'actions': 'Actions',
     'cancel': 'Cancel',
     'name': "Name",
     'back': "Back",
+    'delete': 'Delete',
     'value': "Value",
     'next': "Next",
     'quickLinks': "Quick Links",
@@ -58,6 +60,10 @@ Em.I18n.translations = {
   'tableView.filters.clearSelection': 'clear selection All',
   'tableView.filters.noItems' : 'There are no items to show',
 
+  'configs.add_property': 'Add Property',
+  'configs.add_property.invalid_name': 'Config name should consists only of letters, numbers, \'-\', \'_\', \'.\' and first character should be a letter.',
+  'configs.add_property.name_exists': 'Config name already exists',
+
   'slider.apps.title': 'Slider Apps',
   'slider.apps.create': 'Create App',
   'sliderApps.filters.info': '{0} of {1} sliders showing',


[23/45] git commit: AMBARI-7050. Installer incorrectly says Hive + HCatalog + WebHCat needed. (jaimin)

Posted by jo...@apache.org.
AMBARI-7050. Installer incorrectly says Hive + HCatalog + WebHCat needed. (jaimin)


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

Branch: refs/heads/branch-alerts-dev
Commit: 39c7ae74bc9c1b3983a61c032f5c1ca745c9f48c
Parents: 51215cc
Author: Jaimin Jetly <ja...@hortonworks.com>
Authored: Wed Aug 27 16:49:33 2014 -0700
Committer: Jaimin Jetly <ja...@hortonworks.com>
Committed: Wed Aug 27 16:49:39 2014 -0700

----------------------------------------------------------------------
 .../app/controllers/wizard/step4_controller.js   | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/39c7ae74/ambari-web/app/controllers/wizard/step4_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step4_controller.js b/ambari-web/app/controllers/wizard/step4_controller.js
index 92dbed4..d98a848 100644
--- a/ambari-web/app/controllers/wizard/step4_controller.js
+++ b/ambari-web/app/controllers/wizard/step4_controller.js
@@ -122,9 +122,9 @@ App.WizardStep4Controller = Em.ArrayController.extend({
    */
   submit: function () {
     if (!this.get('isSubmitDisabled')) {
+      this.setGroupedServices();
       if (this.validate()) {
         this.set('errorStack', []);
-        this.setGroupedServices();
         App.router.send('next');
       }
     }
@@ -258,15 +258,14 @@ App.WizardStep4Controller = Em.ArrayController.extend({
     var missingDependencies = [];
     var missingDependenciesDisplayName = [];
     selectedServices.forEach(function(service){
-    
-      var dependentServices =  service.get('requiredServices');
-      if (!!dependentServices) {
-        dependentServices.forEach(function(_dependentService){
-          var dependentService = this.findProperty('serviceName', _dependentService);
-          if (dependentService && dependentService.get('isSelected') === false) {
-            if(missingDependencies.indexOf(_dependentService) == -1 ) {
-              missingDependencies.push(_dependentService);
-              missingDependenciesDisplayName.push(dependentService.get('displayNameOnSelectServicePage'));
+      var requiredServices =  service.get('requiredServices');
+      if (!!requiredServices && requiredServices.length) {
+        requiredServices.forEach(function(_requiredService){
+          var requiredService = this.findProperty('serviceName', _requiredService);
+          if (requiredService && requiredService.get('isSelected') === false) {
+            if(missingDependencies.indexOf(_requiredService) == -1 ) {
+              missingDependencies.push(_requiredService);
+              missingDependenciesDisplayName.push(requiredService.get('displayNameOnSelectServicePage'));
             }
           }
         },this);


[08/45] git commit: AMBARI-7004 - Views: Need ability to remove view event listener.

Posted by jo...@apache.org.
AMBARI-7004 - Views: Need ability to remove view event listener.


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

Branch: refs/heads/branch-alerts-dev
Commit: 8ca145bbda6134f0541c9f14ff7d99a0d3ac081e
Parents: af1db65
Author: tbeerbower <tb...@hortonworks.com>
Authored: Mon Aug 25 14:38:55 2014 -0400
Committer: tbeerbower <tb...@hortonworks.com>
Committed: Wed Aug 27 12:45:33 2014 -0400

----------------------------------------------------------------------
 .../ambari/server/view/ViewContextImpl.java     |  9 ++++
 .../apache/ambari/server/view/ViewRegistry.java | 30 ++++++++++--
 .../ambari/server/view/ViewRegistryTest.java    | 50 ++++++++++++++++++++
 .../org/apache/ambari/view/ViewController.java  | 19 ++++++++
 4 files changed, 103 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8ca145bb/ambari-server/src/main/java/org/apache/ambari/server/view/ViewContextImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewContextImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewContextImpl.java
index d36ad6e..8915134 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewContextImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewContextImpl.java
@@ -322,6 +322,15 @@ public class ViewContextImpl implements ViewContext, ViewController {
     viewRegistry.registerListener(listener, viewName, viewVersion);
   }
 
+  @Override
+  public void unregisterListener(Listener listener, String viewName) {
+    viewRegistry.unregisterListener(listener, viewName, null);
+  }
+
+  @Override
+  public void unregisterListener(Listener listener, String viewName, String viewVersion) {
+    viewRegistry.unregisterListener(listener, viewName, viewVersion);
+  }
 
   // ----- helper methods ----------------------------------------------------
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/8ca145bb/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java
index 6e5f0a2..36c9081 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java
@@ -37,6 +37,7 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 
@@ -46,6 +47,7 @@ import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBException;
 import javax.xml.bind.Unmarshaller;
 
+import com.google.common.collect.Sets;
 import org.apache.ambari.server.api.resources.ResourceInstanceFactoryImpl;
 import org.apache.ambari.server.api.resources.SubResourceDefinition;
 import org.apache.ambari.server.api.resources.ViewExternalSubResourceDefinition;
@@ -135,8 +137,8 @@ public class ViewRegistry {
   /**
    * Mapping of view names to registered listeners.
    */
-  private final Map<String, List<Listener>> listeners =
-      new HashMap<String, List<Listener>>();
+  private final Map<String, Set<Listener>> listeners =
+      new ConcurrentHashMap<String, Set<Listener>>();
 
   /**
    * Helper class.
@@ -633,10 +635,10 @@ public class ViewRegistry {
 
     String name = viewVersion == null ? viewName : ViewEntity.getViewName(viewName, viewVersion);
 
-    List<Listener> listeners = this.listeners.get(name);
+    Set<Listener> listeners = this.listeners.get(name);
 
     if (listeners == null) {
-      listeners = new LinkedList<Listener>();
+      listeners = Sets.newSetFromMap(new ConcurrentHashMap<Listener, Boolean>());
       this.listeners.put(name, listeners);
     }
 
@@ -644,6 +646,24 @@ public class ViewRegistry {
   }
 
   /**
+   * Un-register the given listener from the view identified by the given name and version.
+   *
+   * @param listener     the listener
+   * @param viewName     the view name
+   * @param viewVersion  the view version; null indicates all versions
+   */
+  public synchronized void unregisterListener(Listener listener, String viewName, String viewVersion) {
+
+    String name = viewVersion == null ? viewName : ViewEntity.getViewName(viewName, viewVersion);
+
+    Set<Listener> listeners = this.listeners.get(name);
+
+    if (listeners != null) {
+      listeners.remove(listener);
+    }
+  }
+
+  /**
    * Determine whether or not the access specified by the given permission
    * is permitted for the given user on the view instance identified by
    * the given resource.
@@ -1212,7 +1232,7 @@ public class ViewRegistry {
 
   // notify the view identified by the given view name of the given event
   private void fireEvent(Event event, String viewName) {
-    List<Listener> listeners = this.listeners.get(viewName);
+    Set<Listener> listeners = this.listeners.get(viewName);
 
     if (listeners != null) {
       for (Listener listener : listeners) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/8ca145bb/ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java b/ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java
index 55dca84..dea9b3b 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java
@@ -412,6 +412,56 @@ public class ViewRegistryTest {
 
     listener.clear();
 
+    // fire an event for a different view
+    event = EventImplTest.getEvent("MyEvent", Collections.<String, String>emptyMap(), view_xml2);
+
+    registry.fireEvent(event);
+
+    Assert.assertNull(listener.getLastEvent());
+
+    // un-register the listener
+    registry.unregisterListener(listener, "MY_VIEW", "1.0.0");
+
+    event = EventImplTest.getEvent("MyEvent", Collections.<String, String>emptyMap(), view_xml1);
+
+    registry.fireEvent(event);
+
+    Assert.assertNull(listener.getLastEvent());
+  }
+
+  @Test
+  public void testListener_allVersions() throws Exception {
+    ViewRegistry registry = getRegistry();
+
+    TestListener listener = new TestListener();
+    registry.registerListener(listener, "MY_VIEW", null); // all versions of MY_VIEW
+
+    EventImpl event = EventImplTest.getEvent("MyEvent", Collections.<String, String>emptyMap(), view_xml1);
+
+    registry.fireEvent(event);
+
+    Assert.assertEquals(event, listener.getLastEvent());
+
+    listener.clear();
+
+    // fire an event for a different view
+    event = EventImplTest.getEvent("MyEvent", Collections.<String, String>emptyMap(), view_xml2);
+
+    registry.fireEvent(event);
+
+    Assert.assertEquals(event, listener.getLastEvent());
+
+    listener.clear();
+
+    // un-register the listener
+    registry.unregisterListener(listener, "MY_VIEW", null); // all versions of MY_VIEW
+
+    event = EventImplTest.getEvent("MyEvent", Collections.<String, String>emptyMap(), view_xml1);
+
+    registry.fireEvent(event);
+
+    Assert.assertNull(listener.getLastEvent());
+
     event = EventImplTest.getEvent("MyEvent", Collections.<String, String>emptyMap(), view_xml2);
 
     registry.fireEvent(event);

http://git-wip-us.apache.org/repos/asf/ambari/blob/8ca145bb/ambari-views/src/main/java/org/apache/ambari/view/ViewController.java
----------------------------------------------------------------------
diff --git a/ambari-views/src/main/java/org/apache/ambari/view/ViewController.java b/ambari-views/src/main/java/org/apache/ambari/view/ViewController.java
index d182de0..741ec2e 100644
--- a/ambari-views/src/main/java/org/apache/ambari/view/ViewController.java
+++ b/ambari-views/src/main/java/org/apache/ambari/view/ViewController.java
@@ -53,4 +53,23 @@ public interface ViewController {
    * @param viewVersion  the view version
    */
   public void registerListener(Listener listener, String viewName, String viewVersion);
+
+  /**
+   * Un-register the listener that is registered for the view identified by the
+   * given name.
+   *
+   * @param listener  the listener
+   * @param viewName  the view to listen to
+   */
+  public void unregisterListener(Listener listener, String viewName);
+
+  /**
+   * Un-register the listener that is registered for the view identified by the
+   * given name and version.
+   *
+   * @param listener     the listener
+   * @param viewName     the view to listen to
+   * @param viewVersion  the view version
+   */
+  public void unregisterListener(Listener listener, String viewName, String viewVersion);
 }


[04/45] git commit: AMBARI-7038. Main menu disappears after view-page refresh. (onechiporenko)

Posted by jo...@apache.org.
AMBARI-7038. Main menu disappears after view-page refresh. (onechiporenko)


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

Branch: refs/heads/branch-alerts-dev
Commit: 5e3c95fe4efb1efc8cf653f55e2d677208552cd5
Parents: c79fad2
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Wed Aug 27 17:39:29 2014 +0300
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Wed Aug 27 17:39:29 2014 +0300

----------------------------------------------------------------------
 ambari-web/app/router.js                |  2 --
 ambari-web/app/routes/main.js           |  1 +
 ambari-web/app/routes/views.js          | 15 +++------------
 ambari-web/app/views/main/menu.js       |  4 ++--
 ambari-web/app/views/main/views_view.js |  2 +-
 5 files changed, 7 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/5e3c95fe/ambari-web/app/router.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/router.js b/ambari-web/app/router.js
index 9e16359..211651c 100644
--- a/ambari-web/app/router.js
+++ b/ambari-web/app/router.js
@@ -436,8 +436,6 @@ App.Router = Em.Router.extend({
 
     main: require('routes/main'),
 
-    views: require('routes/views'),
-
     experimental: Em.Route.extend({
       route: '/experimental',
       enter: function (router, context) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/5e3c95fe/ambari-web/app/routes/main.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js
index f822c48..06a05c5 100644
--- a/ambari-web/app/routes/main.js
+++ b/ambari-web/app/routes/main.js
@@ -225,6 +225,7 @@ module.exports = Em.Route.extend({
     }
   }),
 
+  views: require('routes/views'),
 
   hosts: Em.Route.extend({
     route: '/hosts',

http://git-wip-us.apache.org/repos/asf/ambari/blob/5e3c95fe/ambari-web/app/routes/views.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/views.js b/ambari-web/app/routes/views.js
index d72dbf0..b0e2f15 100644
--- a/ambari-web/app/routes/views.js
+++ b/ambari-web/app/routes/views.js
@@ -17,26 +17,17 @@
  */
 
 var App = require('app');
-var stringUtils = require('utils/string_utils');
 
 module.exports = Em.Route.extend({
   route: '/views',
   enter: function (router) {
-    router.getAuthenticated().done(function (loggedIn) {
-      if (loggedIn) {
-        router.get('mainViewsController').loadAmbariViews();
-      } else {
-        Em.run.next(function () {
-          router.transitionTo('login');
-        });
-      }
-    });
+    router.get('mainViewsController').loadAmbariViews();
   },
   index: Em.Route.extend({
     route: '/',
     connectOutlets: function (router) {
       router.get('mainViewsController').dataLoading().done(function() {
-        router.get('applicationController').connectOutlet('mainViews');
+        router.get('mainController').connectOutlet('mainViews');
       });
     }
   }),
@@ -45,7 +36,7 @@ module.exports = Em.Route.extend({
     connectOutlets: function (router, params) {
       // find and set content for `mainViewsDetails` and associated controller
       router.get('mainViewsController').dataLoading().done(function() {
-        router.get('applicationController').connectOutlet('mainViewsDetails', App.router.get('mainViewsController.ambariViews')
+        router.get('mainController').connectOutlet('mainViewsDetails', App.router.get('mainViewsController.ambariViews')
           .findProperty('href', ['/views', params.viewName, params.version, params.instanceName].join('/')));
       });
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/5e3c95fe/ambari-web/app/views/main/menu.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/menu.js b/ambari-web/app/views/main/menu.js
index c9d475a..34eeac4 100644
--- a/ambari-web/app/views/main/menu.js
+++ b/ambari-web/app/views/main/menu.js
@@ -57,7 +57,7 @@ App.MainMenuView = Em.CollectionView.extend({
       }
 
       if (App.supports.views) {
-        result.push({ label:Em.I18n.t('menu.item.views'), routing:'views', isView:true, views: this.get('views')});
+        result.push({ label:Em.I18n.t('menu.item.views'), routing:'views.index', isView:true, views: this.get('views')});
       }
 
     }
@@ -116,7 +116,7 @@ App.MainMenuView = Em.CollectionView.extend({
       return this.get('content').routing == 'services';
     }.property(''),
     isViewsItem: function () {
-      return this.get('content').routing == 'views';
+      return this.get('content').routing.contains('views');
     }.property(''),
     goToSection: function (event) {
       if (event.context === 'hosts') {

http://git-wip-us.apache.org/repos/asf/ambari/blob/5e3c95fe/ambari-web/app/views/main/views_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/views_view.js b/ambari-web/app/views/main/views_view.js
index 3c97baf..46b3e43 100644
--- a/ambari-web/app/views/main/views_view.js
+++ b/ambari-web/app/views/main/views_view.js
@@ -26,7 +26,7 @@ App.MainViewsView = Em.View.extend({
 
   views: function() {
     return App.router.get('mainViewsController.ambariViews');
-  }.property('App.router.mainViewsController.ambariViews'),
+  }.property('App.router.mainViewsController.ambariViews.@each'),
 
   selectedViewBinding: 'controller.selectedView'
 


[16/45] git commit: AMBARI-7030. Config History: integrate the current label for each config group.(xiwang)

Posted by jo...@apache.org.
AMBARI-7030. Config History: integrate the current label for each config group.(xiwang)


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

Branch: refs/heads/branch-alerts-dev
Commit: f77e9e818614582d9fbcead4fa781076388b3358
Parents: f23e09d
Author: Xi Wang <xi...@apache.org>
Authored: Wed Aug 27 15:01:51 2014 -0700
Committer: Xi Wang <xi...@apache.org>
Committed: Wed Aug 27 15:05:57 2014 -0700

----------------------------------------------------------------------
 .../main/dashboard/config_history_controller.js | 28 +++-----------------
 .../controllers/main/service/info/configs.js    | 15 ++++++-----
 .../mappers/service_config_version_mapper.js    |  3 +--
 ambari-web/app/utils/ajax/ajax.js               |  2 +-
 .../views/common/configs/config_history_flow.js | 13 ++++++---
 5 files changed, 24 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f77e9e81/ambari-web/app/controllers/main/dashboard/config_history_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/dashboard/config_history_controller.js b/ambari-web/app/controllers/main/dashboard/config_history_controller.js
index d8a4722..a747017 100644
--- a/ambari-web/app/controllers/main/dashboard/config_history_controller.js
+++ b/ambari-web/app/controllers/main/dashboard/config_history_controller.js
@@ -31,7 +31,7 @@ App.MainConfigHistoryController = Em.ArrayController.extend(App.TableServerMixin
   filteredCount: 0,
   mockUrl: '/data/configurations/service_versions.json',
   realUrl: function () {
-    return App.apiPrefix + '/clusters/' + App.get('clusterName') + '/configurations/service_config_versions?<parameters>fields=service_config_version,user,group_id,group_name,createtime,service_name,service_config_version_note&minimal_response=true';
+    return App.apiPrefix + '/clusters/' + App.get('clusterName') + '/configurations/service_config_versions?<parameters>fields=service_config_version,user,group_id,group_name,is_current,createtime,service_name,service_config_version_note&minimal_response=true';
   }.property('App.clusterName'),
 
   /**
@@ -154,13 +154,9 @@ App.MainConfigHistoryController = Em.ArrayController.extend(App.TableServerMixin
    */
   load: function () {
     var dfd = $.Deferred();
-    var self = this;
-
     this.updateTotalCounter();
-    this.loadCurrentVersions().complete(function () {
-      self.loadConfigVersionsToModel().done(function () {
-        dfd.resolve();
-      });
+    this.loadConfigVersionsToModel().done(function () {
+      dfd.resolve();
     });
     return dfd.promise();
   },
@@ -181,24 +177,6 @@ App.MainConfigHistoryController = Em.ArrayController.extend(App.TableServerMixin
     return dfd.promise();
   },
 
-  loadCurrentVersions: function () {
-    return App.ajax.send({
-      name: 'service.serviceConfigVersions.get.current',
-      sender: this,
-      data: {},
-      success: 'loadCurrentVersionsSuccess'
-    })
-  },
-
-  loadCurrentVersionsSuccess: function (data, opt, params) {
-    var currentConfigVersions = {};
-
-    for (var service in data.Clusters.desired_service_config_versions) {
-      currentConfigVersions[service + '_' + data.Clusters.desired_service_config_versions[service][0].service_config_version] = true;
-    }
-    App.cache['currentConfigVersions'] = currentConfigVersions;
-  },
-
   updateTotalCounter: function () {
     return App.ajax.send({
       name: 'service.serviceConfigVersions.get.total',

http://git-wip-us.apache.org/repos/asf/ambari/blob/f77e9e81/ambari-web/app/controllers/main/service/info/configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/configs.js b/ambari-web/app/controllers/main/service/info/configs.js
index ab7afeb..78c9b53 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -288,21 +288,24 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM
 
   /**
    * load current service config version number
-   * set currentVersion
+   * set currentVersion (current version for default group)
    * @param data
    * @param opt
    * @param params
    */
   loadCurrentVersionsSuccess: function (data, opt, params) {
-    var currentConfigVersions = {};
     var self = this;
     for (var service in data.Clusters.desired_service_config_versions) {
-      currentConfigVersions[service + '_' + data.Clusters.desired_service_config_versions[service][0].service_config_version] = true;
       if (self.get('content.serviceName') == service) {
-        self.set('currentVersion', data.Clusters.desired_service_config_versions[service][0].service_config_version);
+        //current version of default config group
+        data.Clusters.desired_service_config_versions[service].forEach (function(version) {
+          if (version.group_id == null) {
+            self.set('currentVersion', version.service_config_version);
+          }
+        });
       }
     }
-    App.cache['currentConfigVersions'] = currentConfigVersions;
+
   },
 
   /**
@@ -324,7 +327,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM
       success: 'loadSelectedVersionSuccess'
     }).complete(function () {
         self.loadServiceTagsAndGroups();
-      });
+    });
   },
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/f77e9e81/ambari-web/app/mappers/service_config_version_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/service_config_version_mapper.js b/ambari-web/app/mappers/service_config_version_mapper.js
index f3cca6c..11a1d25 100644
--- a/ambari-web/app/mappers/service_config_version_mapper.js
+++ b/ambari-web/app/mappers/service_config_version_mapper.js
@@ -35,12 +35,11 @@ App.serviceConfigVersionsMapper = App.QuickDataMapper.create({
   map: function (json) {
     var result = [];
     var itemIds = {};
-    var currentConfigVersions = App.cache['currentConfigVersions'];
+
     if (json && json.items) {
       json.items.forEach(function (item, index) {
         var parsedItem = this.parseIt(item, this.get('config'));
         parsedItem.id = parsedItem.service_name + '_' + parsedItem.version;
-        parsedItem.is_current = !!currentConfigVersions[parsedItem.id];
         parsedItem.is_requested = true;
         itemIds[parsedItem.id] = true;
         parsedItem.index = index;

http://git-wip-us.apache.org/repos/asf/ambari/blob/f77e9e81/ambari-web/app/utils/ajax/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js
index 7d0c23c..fa7dc72 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -1894,7 +1894,7 @@ var urls = {
     }
   },
   'service.serviceConfigVersions.get': {
-    real: '/clusters/{clusterName}/configurations/service_config_versions?service_name={serviceName}&fields=service_config_version,user,group_id,group_name,createtime,service_name,service_config_version_note&minimal_response=true',
+    real: '/clusters/{clusterName}/configurations/service_config_versions?service_name={serviceName}&fields=service_config_version,user,group_id,group_name,is_current,createtime,service_name,service_config_version_note&minimal_response=true',
     mock: '/data/configurations/service_versions.json'
   },
   'service.serviceConfigVersions.get.current': {

http://git-wip-us.apache.org/repos/asf/ambari/blob/f77e9e81/ambari-web/app/views/common/configs/config_history_flow.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/config_history_flow.js b/ambari-web/app/views/common/configs/config_history_flow.js
index 280c674..8c81f42 100644
--- a/ambari-web/app/views/common/configs/config_history_flow.js
+++ b/ambari-web/app/views/common/configs/config_history_flow.js
@@ -141,8 +141,15 @@ App.ConfigHistoryFlowView = Em.View.extend({
     var startIndex = 0;
 
     serviceVersions.setEach('isDisplayed', false);
-    if (serviceVersions.findProperty('isCurrent')) {
-      serviceVersions.findProperty('isCurrent').set('isDisplayed', true);
+    //set the correct version to display
+    var allCurrent = serviceVersions.filterProperty('isCurrent');
+    if (this.get('isDefaultConfigGroupSelected')) {
+      // display current in default group
+      allCurrent.findProperty('groupName', null).set('isDisplayed', true);
+    }else {
+      // display current in selected group
+      var current = allCurrent.findProperty('groupName', this.get('selectedConfigGroupName'));
+      current ? current.set('isDisplayed', true) : allCurrent.findProperty('groupName', null).set('isDisplayed', true);
     }
 
     if (serviceVersions.length > 0) {
@@ -152,7 +159,7 @@ App.ConfigHistoryFlowView = Em.View.extend({
       this.set('startIndex', startIndex);
       this.adjustFlowView();
     }
-    this.keepInfoBarAtTop()
+    this.keepInfoBarAtTop();
   },
 
   /**


[06/45] git commit: AMBARI-7039. Incorrect displaying of Job Id in Job charts window. (Max Shepel via akovalenko)

Posted by jo...@apache.org.
AMBARI-7039. Incorrect displaying of Job Id in Job charts window. (Max Shepel via akovalenko)


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

Branch: refs/heads/branch-alerts-dev
Commit: 9385d47ab0f09e61e861f6d00a640c94488d385f
Parents: 940abdc
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Wed Aug 27 18:06:34 2014 +0300
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Wed Aug 27 18:06:34 2014 +0300

----------------------------------------------------------------------
 ambari-web/app/styles/apps.less | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9385d47a/ambari-web/app/styles/apps.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/apps.less b/ambari-web/app/styles/apps.less
index 8426380..9a42efc 100644
--- a/ambari-web/app/styles/apps.less
+++ b/ambari-web/app/styles/apps.less
@@ -391,6 +391,12 @@
     }
   }
 
+  #innerTable {
+    td {
+      word-wrap: break-word;
+    }
+  }
+
   #jobs-table {
 
     .is-not-link{


[41/45] git commit: Merge remote-tracking branch 'origin/trunk' into origin-trunk

Posted by jo...@apache.org.
Merge remote-tracking branch 'origin/trunk' into origin-trunk


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

Branch: refs/heads/branch-alerts-dev
Commit: c4f1e16a74f6afb1d5b9fb12f7257ad2bb554edb
Parents: 9f6b7b3 f2f5dff
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Thu Aug 28 19:05:02 2014 +0300
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Thu Aug 28 19:05:02 2014 +0300

----------------------------------------------------------------------
 .../resource_management/TestPackageResource.py  |   6 +-
 .../core/providers/package/apt.py               |  11 +-
 .../ambari/server/api/query/QueryImpl.java      |   1 -
 .../resources/ResourceInstanceFactoryImpl.java  |   4 +
 ...ackLevelConfigurationResourceDefinition.java |  53 ++++++
 .../StackVersionResourceDefinition.java         |   1 +
 .../server/api/services/AmbariMetaInfo.java     |  34 +++-
 .../server/api/services/StacksService.java      |  35 +++-
 .../server/api/util/StackExtensionHelper.java   | 105 ++++++++---
 .../controller/AmbariManagementController.java  |   8 +
 .../AmbariManagementControllerImpl.java         |  44 +++++
 .../StackLevelConfigurationRequest.java         |  42 +++++
 .../StackLevelConfigurationResponse.java        |  37 ++++
 .../server/controller/StackVersionResponse.java |  14 +-
 .../AbstractControllerResourceProvider.java     |   2 +
 ...StackLevelConfigurationResourceProvider.java | 159 ++++++++++++++++
 .../internal/StackVersionResourceProvider.java  |   6 +
 .../ambari/server/controller/spi/Resource.java  |   4 +-
 .../apache/ambari/server/state/ServiceInfo.java |   1 +
 .../apache/ambari/server/state/StackInfo.java   |  26 ++-
 .../src/main/resources/key_properties.json      |   5 +
 .../src/main/resources/properties.json          |  11 ++
 .../HDP/1.3.2/configuration/cluster-env.xml     |  49 +++++
 .../HDP/2.0.6/configuration/cluster-env.xml     |  49 +++++
 .../ambari/server/api/query/QueryImplTest.java  |   2 +-
 .../api/util/StackExtensionHelperTest.java      |  23 +--
 .../internal/AbstractResourceProviderTest.java  |  45 +++++
 ...kLevelConfigurationResourceProviderTest.java | 181 +++++++++++++++++++
 .../controllers/main/service/add_controller.js  |  24 +--
 .../app/controllers/wizard/step8_controller.js  |  12 +-
 ambari-web/app/routes/add_host_routes.js        |   2 +
 ambari-web/app/routes/add_service_routes.js     |   2 +
 ambari-web/app/routes/installer.js              |   2 +
 .../main/service/add_controller_test.js         |  10 +
 34 files changed, 939 insertions(+), 71 deletions(-)
----------------------------------------------------------------------



[26/45] git commit: AMBARI-7031. FE: Next button not enabled when only /validation ERRORs are there. (ababiichuk via srimanth)

Posted by jo...@apache.org.
AMBARI-7031. FE: Next button not enabled when only /validation ERRORs are there. (ababiichuk via srimanth)


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

Branch: refs/heads/branch-alerts-dev
Commit: 94ca14a559ddd9eab59bc2db138dd2005dfffeec
Parents: fa10e3b
Author: Srimanth Gunturi <sg...@hortonworks.com>
Authored: Wed Aug 27 14:14:53 2014 -0700
Committer: Srimanth Gunturi <sg...@hortonworks.com>
Committed: Wed Aug 27 18:39:43 2014 -0700

----------------------------------------------------------------------
 ambari-web/app/mixins/common/serverValidator.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/94ca14a5/ambari-web/app/mixins/common/serverValidator.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/serverValidator.js b/ambari-web/app/mixins/common/serverValidator.js
index 3a1dbed..71169c5 100644
--- a/ambari-web/app/mixins/common/serverValidator.js
+++ b/ambari-web/app/mixins/common/serverValidator.js
@@ -236,8 +236,8 @@ App.ServerValidatorMixin = Em.Mixin.create({
               if ((property.get('filename') == item['config-type'] + '.xml') && (property.get('name') == item['config-name'])) {
                 if (item.level == "ERROR") {
                   self.set('configValidationError', true);
-                  property.set('warnMessage', item.message);
-                  property.set('warn', true);
+                  property.set('errorMessage', item.message);
+                  property.set('error', true);
                 } else if (item.level == "WARN") {
                   self.set('configValidationWarning', true);
                   property.set('warnMessage', item.message);


[17/45] git commit: AMBARI-7049. Remove the explicit logic of rendering specific configType category just for specific services. (jaimin)

Posted by jo...@apache.org.
AMBARI-7049. Remove the explicit logic of rendering specific configType category just for specific services. (jaimin)


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

Branch: refs/heads/branch-alerts-dev
Commit: debf29c23365c0826902f699a3f3cc9e23dc76a6
Parents: f77e9e8
Author: Jaimin Jetly <ja...@hortonworks.com>
Authored: Wed Aug 27 15:41:52 2014 -0700
Committer: Jaimin Jetly <ja...@hortonworks.com>
Committed: Wed Aug 27 15:41:52 2014 -0700

----------------------------------------------------------------------
 ambari-web/app/models/stack_service.js | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/debf29c2/ambari-web/app/models/stack_service.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/stack_service.js b/ambari-web/app/models/stack_service.js
index a711936..89b2b81 100644
--- a/ambari-web/app/models/stack_service.js
+++ b/ambari-web/app/models/stack_service.js
@@ -332,25 +332,12 @@ App.StackService.configCategories = function () {
   serviceConfigCategories.pushObject(App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Advanced'}));
 
   var configTypes = Object.keys(this.get('configTypes'));
-  if (this.get('serviceName') !== 'HDFS') {
-    configTypes = configTypes.without('core-site');
-  }
+
   //Falcon has dependency on oozie-site but oozie-site advanced/custom section should not be shown on Falcon page
   if (this.get('serviceName') !== 'OOZIE') {
     configTypes = configTypes.without('oozie-site');
   }
 
-  //Hive has dependency on tez-site but tez-site advanced/custom section should not be shown on Hive page
-  if (this.get('serviceName') !== 'TEZ') {
-    configTypes = configTypes.without('tez-site');
-  }
-
-  //oozie has dependency on yarn-site but yarn-site advanced/custom section should not be shown on Oozie page
-  if (this.get('serviceName') !== 'YARN') {
-    configTypes = configTypes.without('yarn-site');
-  }
-
-
   // Add Advanced section for every configType to all the services
   configTypes.forEach(function (type) {
     var displayName = 'Advanced ' + type;


[45/45] git commit: Merge branch 'trunk' into branch-alerts-dev

Posted by jo...@apache.org.
Merge branch 'trunk' into branch-alerts-dev


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

Branch: refs/heads/branch-alerts-dev
Commit: 52d1af7634e4a13ea4f9b94e34a1734c2bcd416c
Parents: 76fc94e 869b00c
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Thu Aug 28 13:49:15 2014 -0400
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Thu Aug 28 13:49:15 2014 -0400

----------------------------------------------------------------------
 .../resource_management/TestPackageResource.py  |   6 +-
 .../core/providers/package/apt.py               |  11 +-
 .../libraries/script/script.py                  |   9 +-
 ambari-server/pom.xml                           |  22 ++
 .../ambari/server/api/query/QueryImpl.java      |   1 -
 .../resources/ResourceInstanceFactoryImpl.java  |   4 +
 ...ackLevelConfigurationResourceDefinition.java |  53 +++
 .../StackVersionResourceDefinition.java         |   1 +
 .../server/api/services/AmbariMetaInfo.java     |  34 +-
 .../server/api/services/StacksService.java      |  35 +-
 .../server/api/util/StackExtensionHelper.java   | 105 ++++--
 .../controller/AmbariManagementController.java  |   8 +
 .../AmbariManagementControllerImpl.java         |  44 +++
 .../StackLevelConfigurationRequest.java         |  42 +++
 .../StackLevelConfigurationResponse.java        |  37 +++
 .../server/controller/StackVersionResponse.java |  14 +-
 .../AbstractControllerResourceProvider.java     |   2 +
 ...StackLevelConfigurationResourceProvider.java | 159 +++++++++
 .../internal/StackVersionResourceProvider.java  |   6 +
 .../ambari/server/controller/spi/Resource.java  |   4 +-
 .../apache/ambari/server/state/ServiceInfo.java |   1 +
 .../apache/ambari/server/state/StackInfo.java   |  26 +-
 .../ambari/server/view/ViewContextImpl.java     |   9 +
 .../apache/ambari/server/view/ViewRegistry.java |  30 +-
 .../main/resources/custom_actions/check_host.py |   2 +-
 .../src/main/resources/key_properties.json      |   5 +
 .../src/main/resources/properties.json          |  11 +
 .../src/main/resources/scripts/stack_advisor.py |   2 +-
 .../HDP/1.3.2/configuration/cluster-env.xml     |  49 +++
 .../1.3.2/hooks/before-START/scripts/params.py  |   4 +-
 .../HDP/1.3.2/services/HBASE/metainfo.xml       |   2 +-
 .../stacks/HDP/1.3.2/services/HDFS/metainfo.xml |   4 +-
 .../HIVE/package/scripts/hive_service.py        |   2 +-
 .../HDP/1.3.2/services/MAPREDUCE/metainfo.xml   |   9 +-
 .../OOZIE/package/scripts/oozie_service.py      |   2 +-
 .../stacks/HDP/1.3.2/services/PIG/metainfo.xml  |   2 +-
 .../HDP/1.3.2/services/ZOOKEEPER/metainfo.xml   |   2 +-
 .../stacks/HDP/1.3.2/services/stack_advisor.py  |   4 +-
 .../HDP/2.0.6/configuration/cluster-env.xml     |  49 +++
 .../HDP/2.0.6/services/HBASE/metainfo.xml       |   2 +-
 .../stacks/HDP/2.0.6/services/HDFS/metainfo.xml |   4 +-
 .../HIVE/package/scripts/hive_service.py        |   2 +-
 .../OOZIE/package/scripts/oozie_service.py      |   2 +-
 .../stacks/HDP/2.0.6/services/PIG/metainfo.xml  |  10 +-
 .../stacks/HDP/2.0.6/services/YARN/metainfo.xml |   4 +-
 .../HDP/2.0.6/services/ZOOKEEPER/metainfo.xml   |   2 +-
 .../stacks/HDP/2.0.6/services/stack_advisor.py  |  60 ++--
 .../services/FALCON/configuration/global.xml    |  63 ----
 .../2.1.GlusterFS/services/FALCON/metainfo.xml  |  19 +-
 .../GLUSTERFS/configuration/core-site.xml       | 169 ----------
 .../services/GLUSTERFS/configuration/global.xml |  59 ----
 .../services/GLUSTERFS/metainfo.xml             |   1 +
 .../services/STORM/configuration/global.xml     |  39 ---
 .../2.1.GlusterFS/services/STORM/metainfo.xml   |   1 +
 .../services/TEZ/configuration/global.xml       |  29 --
 .../HDP/2.1.GlusterFS/services/TEZ/metainfo.xml |  22 +-
 .../stacks/HDP/2.1/services/FALCON/metainfo.xml |  10 +
 .../stacks/HDP/2.1/services/stack_advisor.py    |  14 +-
 .../main/resources/stacks/HDP/stack_advisor.py  |  37 ---
 .../src/main/resources/stacks/stack_advisor.py  |  37 +++
 .../ambari/server/api/query/QueryImplTest.java  |   2 +-
 .../server/api/services/AmbariMetaInfoTest.java |   4 +-
 .../api/util/StackExtensionHelperTest.java      |  23 +-
 .../AmbariManagementControllerTest.java         |   2 +-
 .../internal/AbstractResourceProviderTest.java  |  45 +++
 ...kLevelConfigurationResourceProviderTest.java | 181 +++++++++++
 .../ambari/server/view/ViewRegistryTest.java    |  50 +++
 ambari-server/src/test/python/TestCheckHost.py  |   2 +-
 .../src/test/python/TestResourceFilesKeeper.py  |   2 +-
 .../src/test/python/TestStackAdvisor.py         |  93 ++++++
 .../stacks/1.3.2/HIVE/test_hive_metastore.py    |   4 +-
 .../stacks/1.3.2/HIVE/test_hive_server.py       |   4 +-
 .../hooks/before-START/test_before_start.py     |   2 +-
 .../stacks/2.0.6/HDFS/test_hdfs_client.py       |   4 +
 .../stacks/2.0.6/HIVE/test_hive_metastore.py    |   4 +-
 .../stacks/2.0.6/HIVE/test_hive_server.py       |   4 +-
 .../stacks/2.0.6/common/test_stack_advisor.py   |  38 ++-
 .../python/stacks/2.0.6/configs/default.json    |   2 +-
 .../stacks/2.1/HIVE/test_hive_metastore.py      |   4 +-
 .../HIVE/package/scripts/hive_service.py        |   2 +-
 .../stacks/XYZ/1.0.0/services/stack_advisor.py  |  67 ++++
 .../stacks/XYZ/1.0.1/services/stack_advisor.py  |  30 ++
 .../org/apache/ambari/view/ViewController.java  |  19 ++
 .../controllers/global/cluster_controller.js    |  44 ---
 .../main/dashboard/config_history_controller.js |  28 +-
 .../controllers/main/service/add_controller.js  |  24 +-
 .../controllers/main/service/info/configs.js    |  24 +-
 .../app/controllers/wizard/step3_controller.js  |   1 +
 .../app/controllers/wizard/step4_controller.js  |  42 ++-
 .../app/controllers/wizard/step8_controller.js  |  30 +-
 .../mappers/service_config_version_mapper.js    |   5 +-
 ambari-web/app/mappers/stack_service_mapper.js  |   2 +-
 ambari-web/app/messages.js                      |  12 +-
 ambari-web/app/mixins/common/serverValidator.js |   4 +-
 ambari-web/app/models/service_config.js         |   4 +
 ambari-web/app/models/service_config_version.js |  16 +-
 ambari-web/app/models/stack_service.js          |  63 +---
 ambari-web/app/router.js                        |  14 +-
 ambari-web/app/routes/add_host_routes.js        |   2 +
 ambari-web/app/routes/add_service_routes.js     |   2 +
 ambari-web/app/routes/installer.js              |   2 +
 ambari-web/app/routes/main.js                   |   1 +
 ambari-web/app/routes/views.js                  |  15 +-
 ambari-web/app/styles/application.less          |  29 +-
 ambari-web/app/styles/apps.less                 |   6 +
 .../common/configs/compare_property.hbs         |   8 +
 .../common/configs/config_history_flow.hbs      | 142 ++++----
 .../common/configs/service_config_category.hbs  |  30 +-
 ambari-web/app/utils/ajax/ajax.js               |   8 +-
 .../views/common/configs/config_history_flow.js |  29 +-
 ambari-web/app/views/main/menu.js               |   4 +-
 ambari-web/app/views/main/views_view.js         |   2 +-
 .../dashboard/config_history_controller_test.js |  38 +--
 .../main/service/add_controller_test.js         |  10 +
 .../test/controllers/wizard/step3_test.js       | 325 +++++++++++++++++++
 .../test/controllers/wizard/step4_test.js       |  38 ++-
 .../test/controllers/wizard/step5_test.js       |  19 --
 .../test/controllers/wizard/step6_test.js       |  34 --
 .../test/controllers/wizard/step7_test.js       |  92 +-----
 ambari-web/test/models/stack_service_test.js    |  52 +--
 ambari-web/test/service_components.js           |  58 +++-
 .../src/main/resources/ui/app/scripts/app.js    |   2 +-
 .../app/scripts/controllers/job_controller.js   |   2 +-
 .../app/scripts/controllers/jobs_controller.js  |  14 +-
 .../resources/ui/app/scripts/helpers/ajax.js    |  17 +-
 .../resources/ui/app/scripts/helpers/jobs.js    |  78 ++---
 .../mappers/application_status_mapper.js        |  47 +++
 contrib/views/jobs/src/main/resources/view.xml  |  10 +
 .../ui/app/components/configSection.js          | 150 +++++++++
 .../createAppWizard/step1_controller.js         |  31 ++
 .../createAppWizard/step3_controller.js         |  55 +++-
 .../controllers/create_app_wizard_controller.js |  27 +-
 .../src/main/resources/ui/app/helpers/ajax.js   |  27 +-
 .../src/main/resources/ui/app/helpers/helper.js |  37 ++-
 .../src/main/resources/ui/app/initialize.js     |   2 +
 .../ui/app/mappers/application_status.js        |  25 ++
 .../ui/app/mappers/slider_apps_mapper.js        |   2 +-
 .../app/templates/components/configSection.hbs  |  76 +++++
 .../ui/app/templates/createAppWizard/step3.hbs  |   8 +-
 .../resources/ui/app/templates/slider_app.hbs   |   2 +-
 .../ui/app/templates/slider_app/summary.hbs     |   2 +-
 .../src/main/resources/ui/app/translations.js   |   6 +
 142 files changed, 2717 insertions(+), 1148 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/52d1af76/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/52d1af76/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/52d1af76/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/52d1af76/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/52d1af76/ambari-server/src/main/resources/key_properties.json
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/52d1af76/ambari-server/src/main/resources/properties.json
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/52d1af76/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/52d1af76/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
----------------------------------------------------------------------


[22/45] git commit: Revert "AMBARI-7047. BE: Config validation type of values less than recommended should be WARNs"

Posted by jo...@apache.org.
Revert "AMBARI-7047. BE: Config validation type of values less than recommended should be WARNs"

This reverts commit e007d7f4fac0bbef2e753e7004e368a0f6329212.


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

Branch: refs/heads/branch-alerts-dev
Commit: 51215cc36e680b6b0cb1ae318901c7ed78930134
Parents: fdb54a1
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Wed Aug 27 16:03:09 2014 -0700
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Wed Aug 27 16:03:09 2014 -0700

----------------------------------------------------------------------
 .../stacks/HDP/2.0.6/services/stack_advisor.py  | 56 +++++++++-----------
 .../stacks/2.0.6/common/test_stack_advisor.py   | 36 +++----------
 2 files changed, 32 insertions(+), 60 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/51215cc3/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
index 083286e..ad0dcc0 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
@@ -415,66 +415,58 @@ class HDP206StackAdvisor(StackAdvisor):
       "YARN": ["yarn-site", self.validateYARNConfigurations]
     }.get(serviceName, None)
 
-  def toConfigurationValidationProblems(self, validationProblems, siteName):
+  def toConfigurationValidationErrors(self, items, siteName):
     result = []
-    for validationProblem in validationProblems:
-      validationItem = validationProblem.get("item", None)
-      if validationItem is not None:
-        problem = { "type": 'configuration', "level": validationItem["level"], "message": validationItem["message"],
-                  "config-type": siteName, "config-name": validationProblem["config-name"] }
-        result.append(problem)
+    for item in items:
+      if item["message"] is not None:
+        error = { "type": 'configuration', "level": 'ERROR', "message": item["message"], "config-type": siteName, "config-name": item["config-name"] }
+        result.append(error)
     return result
 
-  def getWarnItem(self, message):
-    return {"level": "WARN", "message": message}
-
-  def getErrorItem(self, message):
-    return {"level": "ERROR", "message": message}
-
   def validatorLessThenDefaultValue(self, properties, recommendedDefaults, propertyName):
     if not propertyName in properties:
-      return self.getErrorItem("Value should be set")
+      return "Value should be set"
     value = to_number(properties[propertyName])
     if value is None:
-      return self.getErrorItem("Value should be integer")
+      return "Value should be integer"
     defaultValue = to_number(recommendedDefaults[propertyName])
     if defaultValue is None:
       return None
     if value < defaultValue:
-      return self.getWarnItem("Value is less than the recommended default of {0}".format(defaultValue))
+      return "Value is less than the recommended default of {0}".format(defaultValue)
     return None
 
   def validateXmxValue(self, properties, recommendedDefaults, propertyName):
     if not propertyName in properties:
-      return self.getErrorItem("Value should be set")
+      return "Value should be set"
     value = properties[propertyName]
     defaultValue = recommendedDefaults[propertyName]
     if defaultValue is None:
-      return self.getErrorItem("Config's default value can't be null or undefined")
+      return "Config's default value can't be null or undefined"
     if not checkXmxValueFormat(value):
-      return self.getErrorItem('Invalid value format')
+      return 'Invalid value format'
     valueInt = formatXmxSizeToBytes(getXmxSize(value))
     defaultValueXmx = getXmxSize(defaultValue)
     defaultValueInt = formatXmxSizeToBytes(defaultValueXmx)
     if valueInt < defaultValueInt:
-      return self.getWarnItem("Value is less than the recommended default of -Xmx" + defaultValueXmx)
+      return "Value is less than the recommended default of -Xmx" + defaultValueXmx
     return None
 
   def validateMapReduce2Configurations(self, properties, recommendedDefaults):
-    validationItems = [ {"config-name": 'mapreduce.map.java.opts', "item": self.validateXmxValue(properties, recommendedDefaults, 'mapreduce.map.java.opts')},
-                        {"config-name": 'mapreduce.reduce.java.opts', "item": self.validateXmxValue(properties, recommendedDefaults, 'mapreduce.reduce.java.opts')},
-                        {"config-name": 'mapreduce.task.io.sort.mb', "item": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'mapreduce.task.io.sort.mb')},
-                        {"config-name": 'mapreduce.map.memory.mb', "item": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'mapreduce.map.memory.mb')},
-                        {"config-name": 'mapreduce.reduce.memory.mb', "item": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'mapreduce.reduce.memory.mb')},
-                        {"config-name": 'yarn.app.mapreduce.am.resource.mb', "item": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'yarn.app.mapreduce.am.resource.mb')},
-                        {"config-name": 'yarn.app.mapreduce.am.command-opts', "item": self.validateXmxValue(properties, recommendedDefaults, 'yarn.app.mapreduce.am.command-opts')} ]
-    return self.toConfigurationValidationProblems(validationItems, "mapred-site")
+    validationItems = [ {"config-name": 'mapreduce.map.java.opts', "message": self.validateXmxValue(properties, recommendedDefaults, 'mapreduce.map.java.opts')},
+                        {"config-name": 'mapreduce.reduce.java.opts', "message": self.validateXmxValue(properties, recommendedDefaults, 'mapreduce.reduce.java.opts')},
+                        {"config-name": 'mapreduce.task.io.sort.mb', "message": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'mapreduce.task.io.sort.mb')},
+                        {"config-name": 'mapreduce.map.memory.mb', "message": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'mapreduce.map.memory.mb')},
+                        {"config-name": 'mapreduce.reduce.memory.mb', "message": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'mapreduce.reduce.memory.mb')},
+                        {"config-name": 'yarn.app.mapreduce.am.resource.mb', "message": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'yarn.app.mapreduce.am.resource.mb')},
+                        {"config-name": 'yarn.app.mapreduce.am.command-opts', "message": self.validateXmxValue(properties, recommendedDefaults, 'yarn.app.mapreduce.am.command-opts')} ]
+    return self.toConfigurationValidationErrors(validationItems, "mapred-site")
 
   def validateYARNConfigurations(self, properties, recommendedDefaults):
-    validationItems = [ {"config-name": 'yarn.nodemanager.resource.memory-mb', "item": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'yarn.nodemanager.resource.memory-mb')},
-                        {"config-name": 'yarn.scheduler.minimum-allocation-mb', "item": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'yarn.scheduler.minimum-allocation-mb')},
-                        {"config-name": 'yarn.scheduler.maximum-allocation-mb', "item": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'yarn.scheduler.maximum-allocation-mb')} ]
-    return self.toConfigurationValidationProblems(validationItems, "yarn-site")
+    validationItems = [ {"config-name": 'yarn.nodemanager.resource.memory-mb', "message": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'yarn.nodemanager.resource.memory-mb')},
+                        {"config-name": 'yarn.scheduler.minimum-allocation-mb', "message": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'yarn.scheduler.minimum-allocation-mb')},
+                        {"config-name": 'yarn.scheduler.maximum-allocation-mb', "message": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'yarn.scheduler.maximum-allocation-mb')} ]
+    return self.toConfigurationValidationErrors(validationItems, "yarn-site")
 
 
 # Validation helper methods

http://git-wip-us.apache.org/repos/asf/ambari/blob/51215cc3/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
index b8e0d58..b5bdba6 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
@@ -99,9 +99,9 @@ class TestHDP206StackAdvisor(TestCase):
     result = self.stackAdvisor.validateComponentLayout(services, hosts)
 
     expectedItems = [
-      {"message": "NameNode and Secondary NameNode cannot be hosted on same machine", "level": "WARN", "host": "host1"},
-      {"message": "NameNode and Secondary NameNode cannot be hosted on same machine", "level": "WARN", "host": "host1"},
-      {"message": "Host is not used", "level": "ERROR", "host": "host2"}
+      {"message": "NameNode and Secondary NameNode cannot be hosted on same machine", "host": "host1"},
+      {"message": "NameNode and Secondary NameNode cannot be hosted on same machine", "host": "host1"},
+      {"message": "Host is not used", "host": "host2"}
     ]
     self.assertValidationResult(expectedItems, result)
 
@@ -120,27 +120,7 @@ class TestHDP206StackAdvisor(TestCase):
     result = self.stackAdvisor.validateComponentLayout(services, hosts)
 
     expectedItems = [
-      {"message": "Cardinality violation, cardinality=ALL, hosts count=1", "level": "ERROR"}
-    ]
-    self.assertValidationResult(expectedItems, result)
-
-  def test_validationWarnMessagesIfLessThanDefault(self):
-    servicesInfo = [
-      {
-        "name": "YARN",
-        "components": []
-      }
-    ]
-    services = self.prepareServices(servicesInfo)
-    services["configurations"] = {"yarn-site":{"properties":{"yarn.nodemanager.resource.memory-mb": "0",
-                                                             "yarn.scheduler.minimum-allocation-mb": "str"}}}
-    hosts = self.prepareHosts([])
-    result = self.stackAdvisor.validateConfigurations(services, hosts)
-
-    expectedItems = [
-      {"message": "Value is less than the recommended default of 2046", "level": "WARN"},
-      {"message": "Value should be integer", "level": "ERROR"},
-      {"message": "Value should be set", "level": "ERROR"}
+      {"message": "Cardinality violation, cardinality=ALL, hosts count=1"}
     ]
     self.assertValidationResult(expectedItems, result)
 
@@ -159,7 +139,7 @@ class TestHDP206StackAdvisor(TestCase):
     result = self.stackAdvisor.validateComponentLayout(services, hosts)
 
     expectedItems = [
-      {"message": "Host is not used", "host": "host1", "level": "ERROR"}
+      {"message": "Host is not used", "host": "host1"}
     ]
     self.assertValidationResult(expectedItems, result)
 
@@ -177,7 +157,7 @@ class TestHDP206StackAdvisor(TestCase):
     result = self.stackAdvisor.validateComponentLayout(services, hosts)
 
     expectedItems = [
-      {"message": "Cardinality violation, cardinality=0-1, hosts count=2", "level": "ERROR"}
+      {"message": "Cardinality violation, cardinality=0-1, hosts count=2"}
     ]
     self.assertValidationResult(expectedItems, result)
 
@@ -195,7 +175,7 @@ class TestHDP206StackAdvisor(TestCase):
     result = self.stackAdvisor.validateComponentLayout(services, hosts)
 
     expectedItems = [
-      {"message": "Host is not used", "host": "host2", "level": "ERROR"}
+      {"message": "Host is not used", "host": "host2"}
     ]
     self.assertValidationResult(expectedItems, result)
 
@@ -264,7 +244,7 @@ class TestHDP206StackAdvisor(TestCase):
   def assertValidationResult(self, expectedItems, result):
     actualItems = []
     for item in result["items"]:
-      next = {"message": item["message"], "level": item["level"]}
+      next = { "message": item["message"] }
       try:
         next["host"] = item["host"]
       except KeyError, err:


[40/45] git commit: AMBARI-7060. Ambari Falcon config setup issue - localhost must be replaced with the falcon host. (Max Shepel via onechiporenko)

Posted by jo...@apache.org.
AMBARI-7060. Ambari Falcon config setup issue - localhost must be replaced with the falcon host. (Max Shepel via onechiporenko)


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

Branch: refs/heads/branch-alerts-dev
Commit: 9f6b7b3867bcf6fe6a07404c84846250a56924eb
Parents: 6b7e796
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Thu Aug 28 19:01:34 2014 +0300
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Thu Aug 28 19:01:34 2014 +0300

----------------------------------------------------------------------
 ambari-web/app/models/service_config.js | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9f6b7b38/ambari-web/app/models/service_config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/service_config.js b/ambari-web/app/models/service_config.js
index 2df2ad7..8326dd4 100644
--- a/ambari-web/app/models/service_config.js
+++ b/ambari-web/app/models/service_config.js
@@ -501,6 +501,10 @@ App.ServiceConfigProperty = Ember.Object.extend({
       case 'storm.local.dir':
         this.unionAllMountPoints(isOnlyFirstOneNeeded, localDB);
         break;
+      case '*.broker.url':
+        var falconServerHost = masterComponentHostsInDB.findProperty('component', 'FALCON_SERVER').hostName;
+        this.setDefaultValue('localhost', falconServerHost);
+        break;
     }
   },
 


[43/45] git commit: AMBARI-7062. Client Config Download: log4j properties filenames should be the same as on an installed cluster host. (dlysnichenko)

Posted by jo...@apache.org.
AMBARI-7062. Client Config Download: log4j properties filenames should be the same as on an installed cluster host. (dlysnichenko)


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

Branch: refs/heads/branch-alerts-dev
Commit: d1bdc818e5d4c481d43955bcd7f4ece253b15eb5
Parents: 86d4083
Author: Lisnichenko Dmitro <dl...@hortonworks.com>
Authored: Thu Aug 28 20:34:34 2014 +0300
Committer: Lisnichenko Dmitro <dl...@hortonworks.com>
Committed: Thu Aug 28 20:34:34 2014 +0300

----------------------------------------------------------------------
 .../python/resource_management/libraries/script/script.py |  9 ++++++---
 .../stacks/HDP/1.3.2/services/HBASE/metainfo.xml          |  2 +-
 .../resources/stacks/HDP/1.3.2/services/HDFS/metainfo.xml |  4 ++--
 .../stacks/HDP/1.3.2/services/MAPREDUCE/metainfo.xml      |  9 ++-------
 .../resources/stacks/HDP/1.3.2/services/PIG/metainfo.xml  |  2 +-
 .../stacks/HDP/1.3.2/services/ZOOKEEPER/metainfo.xml      |  2 +-
 .../stacks/HDP/2.0.6/services/HBASE/metainfo.xml          |  2 +-
 .../resources/stacks/HDP/2.0.6/services/HDFS/metainfo.xml |  4 ++--
 .../resources/stacks/HDP/2.0.6/services/PIG/metainfo.xml  | 10 +---------
 .../resources/stacks/HDP/2.0.6/services/YARN/metainfo.xml |  4 ++--
 .../stacks/HDP/2.0.6/services/ZOOKEEPER/metainfo.xml      |  2 +-
 .../resources/stacks/HDP/2.1/services/FALCON/metainfo.xml | 10 ++++++++++
 .../src/test/python/stacks/2.0.6/HDFS/test_hdfs_client.py |  4 ++++
 .../src/test/python/stacks/2.0.6/configs/default.json     |  2 +-
 14 files changed, 35 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d1bdc818/ambari-common/src/main/python/resource_management/libraries/script/script.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/script/script.py b/ambari-common/src/main/python/resource_management/libraries/script/script.py
index 7b7d931..80bfeab 100644
--- a/ambari-common/src/main/python/resource_management/libraries/script/script.py
+++ b/ambari-common/src/main/python/resource_management/libraries/script/script.py
@@ -258,10 +258,13 @@ class Script(object):
                   configuration_attributes=params.config['configuration_attributes'][dict],
         )
     for file_dict in env_configs_list:
-      for filename,dict in file_dict.iteritems():
+      for filename,dicts in file_dict.iteritems():
+        content = ''
+        for dict in dicts.split(','):
+          if dict.strip() in params.config['configurations']:
+            content += params.config['configurations'][dict.strip()]['content']
         File(os.path.join(conf_tmp_dir, filename),
-             content=InlineTemplate(params.config['configurations'][dict]['content'])
-        )
+             content=InlineTemplate(content))
     with closing(tarfile.open(output_filename, "w:gz")) as tar:
       tar.add(conf_tmp_dir, arcname=os.path.basename("."))
       tar.close()

http://git-wip-us.apache.org/repos/asf/ambari/blob/d1bdc818/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/metainfo.xml
index f209475..090bad8 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/metainfo.xml
@@ -108,7 +108,7 @@
             </configFile>
             <configFile>
               <type>env</type>
-              <fileName>hbase-log4j.properties</fileName>
+              <fileName>log4j.properties</fileName>
               <dictionaryName>hbase-log4j</dictionaryName>
             </configFile>            
           </configFiles>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d1bdc818/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/metainfo.xml
index 7112c31..2aa0590 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/metainfo.xml
@@ -99,8 +99,8 @@
             </configFile>      
             <configFile>
               <type>env</type>
-              <fileName>hdfs-log4j.properties</fileName>
-              <dictionaryName>hdfs-log4j</dictionaryName>
+              <fileName>log4j.properties</fileName>
+              <dictionaryName>hdfs-log4j,mapreduce-log4j</dictionaryName>
             </configFile>            
           </configFiles>
         </component>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d1bdc818/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/MAPREDUCE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/MAPREDUCE/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/MAPREDUCE/metainfo.xml
index facdc07..875b858 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/MAPREDUCE/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/MAPREDUCE/metainfo.xml
@@ -82,13 +82,8 @@
             </configFile>                       
             <configFile>
               <type>env</type>
-              <fileName>mapred-env.sh</fileName>
-              <dictionaryName>mapred-env</dictionaryName>
-            </configFile>
-            <configFile>
-              <type>env</type>
-              <fileName>mapreduce-log4j.properties</fileName>
-              <dictionaryName>mapreduce-log4j</dictionaryName>
+              <fileName>log4j.properties</fileName>
+              <dictionaryName>hdfs-log4j,mapreduce-log4j</dictionaryName>
             </configFile>            
           </configFiles>
         </component>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d1bdc818/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/PIG/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/PIG/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/PIG/metainfo.xml
index 8e87a50..85d5961 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/PIG/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/PIG/metainfo.xml
@@ -42,7 +42,7 @@
             </configFile>
             <configFile>
               <type>env</type>
-              <fileName>pig-log4j.properties</fileName>
+              <fileName>log4j.properties</fileName>
               <dictionaryName>pig-log4j</dictionaryName>
             </configFile>
             <configFile>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d1bdc818/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/ZOOKEEPER/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/ZOOKEEPER/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/ZOOKEEPER/metainfo.xml
index 4cdb1c8..21234db 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/ZOOKEEPER/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/ZOOKEEPER/metainfo.xml
@@ -54,7 +54,7 @@
             </configFile>
             <configFile>
               <type>env</type>
-              <fileName>zookeeper-log4j.properties</fileName>
+              <fileName>log4j.properties</fileName>
               <dictionaryName>zookeeper-log4j</dictionaryName>
             </configFile>            
           </configFiles>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d1bdc818/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/metainfo.xml
index 67d4adf..0816591 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/metainfo.xml
@@ -98,7 +98,7 @@
             </configFile>
             <configFile>
               <type>env</type>
-              <fileName>hbase-log4j.properties</fileName>
+              <fileName>log4j.properties</fileName>
               <dictionaryName>hbase-log4j</dictionaryName>
             </configFile>            
           </configFiles>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d1bdc818/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/metainfo.xml
index 57308c0..8bb0369 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/metainfo.xml
@@ -103,8 +103,8 @@
             </configFile>
             <configFile>
               <type>env</type>
-              <fileName>hdfs-log4j.properties</fileName>
-              <dictionaryName>hdfs-log4j</dictionaryName>
+              <fileName>log4j.properties</fileName>
+              <dictionaryName>hdfs-log4j,yarn-log4j</dictionaryName>
             </configFile>                          
             <configFile>
               <type>env</type>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d1bdc818/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/PIG/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/PIG/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/PIG/metainfo.xml
index a41d1f7..27bf492 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/PIG/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/PIG/metainfo.xml
@@ -42,7 +42,7 @@
             </configFile>
             <configFile>
               <type>env</type>
-              <fileName>pig-log4j.properties</fileName>
+              <fileName>log4j.properties</fileName>
               <dictionaryName>pig-log4j</dictionaryName>
             </configFile>
             <configFile>
@@ -70,14 +70,6 @@
         <timeout>300</timeout>
       </commandScript>
 
-      <configFiles>
-        <configFile>
-          <type>env</type>
-          <fileName>pig-env.sh</fileName>
-          <dictionaryName>pig-env</dictionaryName>
-        </configFile>
-      </configFiles>
-      
       <requiredServices>
         <service>YARN</service>
       </requiredServices>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d1bdc818/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/metainfo.xml
index dd0a780..fc49b27 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/metainfo.xml
@@ -99,8 +99,8 @@
             </configFile>
             <configFile>
               <type>env</type>
-              <fileName>yarn-log4j.properties</fileName>
-              <dictionaryName>yarn-log4j</dictionaryName>
+              <fileName>log4j.properties</fileName>
+              <dictionaryName>hdfs-log4j,yarn-log4j</dictionaryName>
             </configFile>
             <configFile>
               <type>xml</type>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d1bdc818/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/ZOOKEEPER/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/ZOOKEEPER/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/ZOOKEEPER/metainfo.xml
index 66713a0..2b1bfdb 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/ZOOKEEPER/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/ZOOKEEPER/metainfo.xml
@@ -53,7 +53,7 @@
             </configFile>
             <configFile>
               <type>env</type>
-              <fileName>zookeeper-log4j.properties</fileName>
+              <fileName>log4j.properties</fileName>
               <dictionaryName>zookeeper-log4j</dictionaryName>
             </configFile>            
           </configFiles>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d1bdc818/ambari-server/src/main/resources/stacks/HDP/2.1/services/FALCON/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1/services/FALCON/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.1/services/FALCON/metainfo.xml
index e8af69d..0a79704 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1/services/FALCON/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1/services/FALCON/metainfo.xml
@@ -40,6 +40,16 @@
               <fileName>falcon-env.sh</fileName>
               <dictionaryName>falcon-env</dictionaryName>
             </configFile>
+            <configFile>
+              <type>xml</type>
+              <fileName>runtime.properties</fileName>
+              <dictionaryName>falcon-runtime.properties</dictionaryName>
+            </configFile>
+            <configFile>
+              <type>xml</type>
+              <fileName>startup.properties</fileName>
+              <dictionaryName>falcon-startup.properties</dictionaryName>
+            </configFile>
           </configFiles>
         </component>
         <component>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d1bdc818/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_hdfs_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_hdfs_client.py b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_hdfs_client.py
index 1a9e1f8..0a4bfb5 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_hdfs_client.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_hdfs_client.py
@@ -48,6 +48,10 @@ class Test(RMFTestCase):
     self.assertResourceCalled('File', '/tmp/123/hadoop-env.sh',
                               content = InlineTemplate(self.getConfig()['configurations']['hadoop-env']['content']),
                               )
+    self.assertResourceCalled('File', '/tmp/123/log4j.properties',
+                              content = InlineTemplate(self.getConfig()['configurations']['hdfs-log4j']['content']+
+                                                       self.getConfig()['configurations']['yarn-log4j']['content']),
+                              )
     self.assertResourceCalled('Directory', '/tmp/123',
                               action = ['delete'],
                               )

http://git-wip-us.apache.org/repos/asf/ambari/blob/d1bdc818/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/configs/default.json b/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
index c8e8588..f563bb0 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
+++ b/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
@@ -28,7 +28,7 @@
         "excluded_hosts": "host1,host2",
         "mark_draining_only" : "false",
         "xml_configs_list":[{"hdfs-site.xml":"hdfs-site"}],
-        "env_configs_list":[{"hadoop-env.sh":"hadoop-env"}],
+        "env_configs_list":[{"hadoop-env.sh":"hadoop-env"},{"log4j.properties":"hdfs-log4j,yarn-log4j"}],
         "output_file":"HDFS_CLIENT-configs.tar.gz"
 
     },


[02/45] git commit: AMBARI-7036 restrict /#/experimental to only AMBARI.ADMIN (ababiichuk)

Posted by jo...@apache.org.
AMBARI-7036 restrict /#/experimental to only AMBARI.ADMIN (ababiichuk)


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

Branch: refs/heads/branch-alerts-dev
Commit: c79fad2501a024379d409cb911e6ea72c8574ee5
Parents: 61695fa
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Wed Aug 27 16:03:39 2014 +0300
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Wed Aug 27 16:03:39 2014 +0300

----------------------------------------------------------------------
 ambari-web/app/router.js | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c79fad25/ambari-web/app/router.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/router.js b/ambari-web/app/router.js
index 04c6385..9e16359 100644
--- a/ambari-web/app/router.js
+++ b/ambari-web/app/router.js
@@ -441,12 +441,16 @@ App.Router = Em.Router.extend({
     experimental: Em.Route.extend({
       route: '/experimental',
       enter: function (router, context) {
-        
+        if (!App.get('isAdmin')) {
+          router.transitionTo("main");
+        }
       },
       connectOutlets: function (router, context) {
-        $('title').text("Ambari Experimental");
-        console.log('/experimental:connectOutlet');
-        router.get('applicationController').connectOutlet('experimental');
+        if (App.get('isAdmin')) {
+          $('title').text("Ambari Experimental");
+          console.log('/experimental:connectOutlet');
+          router.get('applicationController').connectOutlet('experimental');
+        }
       }
     }),
 


[09/45] git commit: AMBARI-7042. When using JDBC URL with connection modifiers in Ambari Hive conf, it fails with java.lang.ArrayIndexOutOfBoundsException(vbrodetskyi)

Posted by jo...@apache.org.
AMBARI-7042. When using JDBC URL with connection modifiers in Ambari Hive conf, it fails with java.lang.ArrayIndexOutOfBoundsException(vbrodetskyi)


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

Branch: refs/heads/branch-alerts-dev
Commit: e20f15b61e2d29321537602a4fed24b19db48fdd
Parents: 8ca145b
Author: Vitaly Brodetskyi <vb...@hortonworks.com>
Authored: Wed Aug 27 20:56:33 2014 +0300
Committer: Vitaly Brodetskyi <vb...@hortonworks.com>
Committed: Wed Aug 27 20:56:33 2014 +0300

----------------------------------------------------------------------
 ambari-server/src/main/resources/custom_actions/check_host.py    | 2 +-
 .../HDP/1.3.2/services/HIVE/package/scripts/hive_service.py      | 2 +-
 .../HDP/1.3.2/services/OOZIE/package/scripts/oozie_service.py    | 2 +-
 .../HDP/2.0.6/services/HIVE/package/scripts/hive_service.py      | 2 +-
 .../HDP/2.0.6/services/OOZIE/package/scripts/oozie_service.py    | 2 +-
 ambari-server/src/test/python/TestCheckHost.py                   | 2 +-
 ambari-server/src/test/python/TestResourceFilesKeeper.py         | 2 +-
 .../src/test/python/stacks/1.3.2/HIVE/test_hive_metastore.py     | 4 ++--
 .../src/test/python/stacks/1.3.2/HIVE/test_hive_server.py        | 4 ++--
 .../src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py     | 4 ++--
 .../src/test/python/stacks/2.0.6/HIVE/test_hive_server.py        | 4 ++--
 .../src/test/python/stacks/2.1/HIVE/test_hive_metastore.py       | 4 ++--
 .../dummy_stack/HIVE/package/scripts/hive_service.py             | 2 +-
 13 files changed, 18 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e20f15b6/ambari-server/src/main/resources/custom_actions/check_host.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/custom_actions/check_host.py b/ambari-server/src/main/resources/custom_actions/check_host.py
index 8e9b222..ddb1c59 100644
--- a/ambari-server/src/main/resources/custom_actions/check_host.py
+++ b/ambari-server/src/main/resources/custom_actions/check_host.py
@@ -201,7 +201,7 @@ class CheckHost(Script):
     # try to connect to db
   
     db_connection_check_command = format("{java64_home}/bin/java -cp /usr/lib/ambari-agent/{check_db_connection_jar_name}:" \
-           "/usr/lib/ambari-agent/{jdbc_name} org.apache.ambari.server.DBConnectionVerification {db_connection_url} " \
+           "/usr/lib/ambari-agent/{jdbc_name} org.apache.ambari.server.DBConnectionVerification '{db_connection_url}' " \
            "{user_name} {user_passwd!p} {jdbc_driver}")
   
     process = subprocess.Popen(db_connection_check_command,

http://git-wip-us.apache.org/repos/asf/ambari/blob/e20f15b6/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hive_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hive_service.py b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hive_service.py
index 8a57b01..bea7c3d 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hive_service.py
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hive_service.py
@@ -53,7 +53,7 @@ def hive_service(
        params.hive_jdbc_driver == "oracle.jdbc.driver.OracleDriver":
       
       db_connection_check_command = format(
-        "{java64_home}/bin/java -cp {check_db_connection_jar}:/usr/share/java/{jdbc_jar_name} org.apache.ambari.server.DBConnectionVerification {hive_jdbc_connection_url} {hive_metastore_user_name} {hive_metastore_user_passwd!p} {hive_jdbc_driver}")
+        "{java64_home}/bin/java -cp {check_db_connection_jar}:/usr/share/java/{jdbc_jar_name} org.apache.ambari.server.DBConnectionVerification '{hive_jdbc_connection_url}' {hive_metastore_user_name} {hive_metastore_user_passwd!p} {hive_jdbc_driver}")
       
       Execute(db_connection_check_command,
               path='/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin', tries=5, try_sleep=10)

http://git-wip-us.apache.org/repos/asf/ambari/blob/e20f15b6/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/oozie_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/oozie_service.py b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/oozie_service.py
index 2be172b..f4cc283 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/oozie_service.py
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/oozie_service.py
@@ -32,7 +32,7 @@ def oozie_service(action = 'start'): # 'start' or 'stop'
     if params.jdbc_driver_name == "com.mysql.jdbc.Driver" or \
        params.jdbc_driver_name == "org.postgresql.Driver" or \
        params.jdbc_driver_name == "oracle.jdbc.driver.OracleDriver":
-      db_connection_check_command = format("{java_home}/bin/java -cp {check_db_connection_jar}:{jdbc_driver_jar} org.apache.ambari.server.DBConnectionVerification {oozie_jdbc_connection_url} {oozie_metastore_user_name} {oozie_metastore_user_passwd!p} {jdbc_driver_name}")
+      db_connection_check_command = format("{java_home}/bin/java -cp {check_db_connection_jar}:{jdbc_driver_jar} org.apache.ambari.server.DBConnectionVerification '{oozie_jdbc_connection_url}' {oozie_metastore_user_name} {oozie_metastore_user_passwd!p} {jdbc_driver_name}")
     else:
       db_connection_check_command = None
       

http://git-wip-us.apache.org/repos/asf/ambari/blob/e20f15b6/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive_service.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive_service.py
index cb10940..8507816 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive_service.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive_service.py
@@ -57,7 +57,7 @@ def hive_service(
        params.hive_jdbc_driver == "oracle.jdbc.driver.OracleDriver":
       
       db_connection_check_command = format(
-        "{java64_home}/bin/java -cp {check_db_connection_jar}:/usr/share/java/{jdbc_jar_name} org.apache.ambari.server.DBConnectionVerification {hive_jdbc_connection_url} {hive_metastore_user_name} {hive_metastore_user_passwd!p} {hive_jdbc_driver}")
+        "{java64_home}/bin/java -cp {check_db_connection_jar}:/usr/share/java/{jdbc_jar_name} org.apache.ambari.server.DBConnectionVerification '{hive_jdbc_connection_url}' {hive_metastore_user_name} {hive_metastore_user_passwd!p} {hive_jdbc_driver}")
       
       Execute(db_connection_check_command,
               path='/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin', tries=5, try_sleep=10)

http://git-wip-us.apache.org/repos/asf/ambari/blob/e20f15b6/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie_service.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie_service.py
index 2fafd1f..aa2b7e2 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie_service.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie_service.py
@@ -32,7 +32,7 @@ def oozie_service(action = 'start'): # 'start' or 'stop'
     if params.jdbc_driver_name == "com.mysql.jdbc.Driver" or \
        params.jdbc_driver_name == "org.postgresql.Driver" or \
        params.jdbc_driver_name == "oracle.jdbc.driver.OracleDriver":
-      db_connection_check_command = format("{java_home}/bin/java -cp {check_db_connection_jar}:{jdbc_driver_jar} org.apache.ambari.server.DBConnectionVerification {oozie_jdbc_connection_url} {oozie_metastore_user_name} {oozie_metastore_user_passwd!p} {jdbc_driver_name}")
+      db_connection_check_command = format("{java_home}/bin/java -cp {check_db_connection_jar}:{jdbc_driver_jar} org.apache.ambari.server.DBConnectionVerification '{oozie_jdbc_connection_url}' {oozie_metastore_user_name} {oozie_metastore_user_passwd!p} {jdbc_driver_name}")
     else:
       db_connection_check_command = None
       

http://git-wip-us.apache.org/repos/asf/ambari/blob/e20f15b6/ambari-server/src/test/python/TestCheckHost.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/TestCheckHost.py b/ambari-server/src/test/python/TestCheckHost.py
index 2f2a54a..6a471ec 100644
--- a/ambari-server/src/test/python/TestCheckHost.py
+++ b/ambari-server/src/test/python/TestCheckHost.py
@@ -143,7 +143,7 @@ class TestCheckHost(TestCase):
                                                                                     'exit_code': 1}})
     self.assertEquals(format_mock.call_args[0][0],'{java64_home}/bin/java -cp /usr/lib/ambari-agent/{check_db_' \
                                                 'connection_jar_name}:/usr/lib/ambari-agent/{jdbc_name} org.' \
-                                                'apache.ambari.server.DBConnectionVerification {db_connection_url} ' \
+                                                'apache.ambari.server.DBConnectionVerification \'{db_connection_url}\' ' \
                                                 '{user_name} {user_passwd!p} {jdbc_driver}')
 
     # test, db connection success

http://git-wip-us.apache.org/repos/asf/ambari/blob/e20f15b6/ambari-server/src/test/python/TestResourceFilesKeeper.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/TestResourceFilesKeeper.py b/ambari-server/src/test/python/TestResourceFilesKeeper.py
index 84b206d..afa57fd 100644
--- a/ambari-server/src/test/python/TestResourceFilesKeeper.py
+++ b/ambari-server/src/test/python/TestResourceFilesKeeper.py
@@ -49,7 +49,7 @@ class TestResourceFilesKeeper(TestCase):
   DUMMY_UNCHANGEABLE_PACKAGE=os.path.join(DUMMY_UNCHANGEABLE_STACK,
                                     ResourceFilesKeeper.PACKAGE_DIR)
 
-  DUMMY_UNCHANGEABLE_PACKAGE_HASH="5de50cd1b26c5ff9b6f1031b9d15fa14df1a3898"
+  DUMMY_UNCHANGEABLE_PACKAGE_HASH="3a3109ba7b01639f08e5f6e7efd0e2fe4612812c"
   DUMMY_HASH="dummy_hash"
   YA_HASH="yet_another_hash"
   SOME_PATH="some-path"

http://git-wip-us.apache.org/repos/asf/ambari/blob/e20f15b6/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_metastore.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_metastore.py b/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_metastore.py
index fc8392d..9df3120 100644
--- a/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_metastore.py
+++ b/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_metastore.py
@@ -72,7 +72,7 @@ class TestHiveMetastore(RMFTestCase):
                               user = 'hive'
     )
 
-    self.assertResourceCalled('Execute', '/usr/jdk64/jdk1.7.0_45/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/share/java/mysql-connector-java.jar org.apache.ambari.server.DBConnectionVerification jdbc:mysql://c6402.ambari.apache.org/hive?createDatabaseIfNotExist=true hive \'!`"\'"\'"\' 1\' com.mysql.jdbc.Driver',
+    self.assertResourceCalled('Execute', '/usr/jdk64/jdk1.7.0_45/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/share/java/mysql-connector-java.jar org.apache.ambari.server.DBConnectionVerification \'jdbc:mysql://c6402.ambari.apache.org/hive?createDatabaseIfNotExist=true\' hive \'!`"\'"\'"\' 1\' com.mysql.jdbc.Driver',
                               path=['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'], tries=5, try_sleep=10
     )
 
@@ -140,7 +140,7 @@ class TestHiveMetastore(RMFTestCase):
                               user = 'hive'
     )
 
-    self.assertResourceCalled('Execute', '/usr/jdk64/jdk1.7.0_45/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/share/java/mysql-connector-java.jar org.apache.ambari.server.DBConnectionVerification jdbc:mysql://c6402.ambari.apache.org/hive?createDatabaseIfNotExist=true hive \'!`"\'"\'"\' 1\' com.mysql.jdbc.Driver',
+    self.assertResourceCalled('Execute', '/usr/jdk64/jdk1.7.0_45/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/share/java/mysql-connector-java.jar org.apache.ambari.server.DBConnectionVerification \'jdbc:mysql://c6402.ambari.apache.org/hive?createDatabaseIfNotExist=true\' hive \'!`"\'"\'"\' 1\' com.mysql.jdbc.Driver',
                               path=['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'], tries=5, try_sleep=10
     )
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e20f15b6/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_server.py b/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_server.py
index a92df36..b8afa45 100644
--- a/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_server.py
+++ b/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_server.py
@@ -77,7 +77,7 @@ class TestHiveServer(RMFTestCase):
                               user = 'hive'
     )
 
-    self.assertResourceCalled('Execute', '/usr/jdk64/jdk1.7.0_45/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/share/java/mysql-connector-java.jar org.apache.ambari.server.DBConnectionVerification jdbc:mysql://c6402.ambari.apache.org/hive?createDatabaseIfNotExist=true hive \'!`"\'"\'"\' 1\' com.mysql.jdbc.Driver',
+    self.assertResourceCalled('Execute', '/usr/jdk64/jdk1.7.0_45/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/share/java/mysql-connector-java.jar org.apache.ambari.server.DBConnectionVerification \'jdbc:mysql://c6402.ambari.apache.org/hive?createDatabaseIfNotExist=true\' hive \'!`"\'"\'"\' 1\' com.mysql.jdbc.Driver',
                               path=['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'], tries=5, try_sleep=10
     )
 
@@ -153,7 +153,7 @@ class TestHiveServer(RMFTestCase):
                               user = 'hive'
     )
 
-    self.assertResourceCalled('Execute', '/usr/jdk64/jdk1.7.0_45/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/share/java/mysql-connector-java.jar org.apache.ambari.server.DBConnectionVerification jdbc:mysql://c6402.ambari.apache.org/hive?createDatabaseIfNotExist=true hive \'!`"\'"\'"\' 1\' com.mysql.jdbc.Driver',
+    self.assertResourceCalled('Execute', '/usr/jdk64/jdk1.7.0_45/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/share/java/mysql-connector-java.jar org.apache.ambari.server.DBConnectionVerification \'jdbc:mysql://c6402.ambari.apache.org/hive?createDatabaseIfNotExist=true\' hive \'!`"\'"\'"\' 1\' com.mysql.jdbc.Driver',
                               path=['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'], tries=5, try_sleep=10
     )
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e20f15b6/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py
index a56c26b..43f30f1 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py
@@ -57,7 +57,7 @@ class TestHiveMetastore(RMFTestCase):
                               user = 'hive'
     )
 
-    self.assertResourceCalled('Execute', '/usr/jdk64/jdk1.7.0_45/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/share/java/mysql-connector-java.jar org.apache.ambari.server.DBConnectionVerification jdbc:mysql://c6402.ambari.apache.org/hive?createDatabaseIfNotExist=true hive \'!`"\'"\'"\' 1\' com.mysql.jdbc.Driver',
+    self.assertResourceCalled('Execute', '/usr/jdk64/jdk1.7.0_45/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/share/java/mysql-connector-java.jar org.apache.ambari.server.DBConnectionVerification \'jdbc:mysql://c6402.ambari.apache.org/hive?createDatabaseIfNotExist=true\' hive \'!`"\'"\'"\' 1\' com.mysql.jdbc.Driver',
                               path=['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'], tries=5, try_sleep=10
     )
 
@@ -125,7 +125,7 @@ class TestHiveMetastore(RMFTestCase):
                               user = 'hive'
     )
 
-    self.assertResourceCalled('Execute', '/usr/jdk64/jdk1.7.0_45/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/share/java/mysql-connector-java.jar org.apache.ambari.server.DBConnectionVerification jdbc:mysql://c6402.ambari.apache.org/hive?createDatabaseIfNotExist=true hive \'!`"\'"\'"\' 1\' com.mysql.jdbc.Driver',
+    self.assertResourceCalled('Execute', '/usr/jdk64/jdk1.7.0_45/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/share/java/mysql-connector-java.jar org.apache.ambari.server.DBConnectionVerification \'jdbc:mysql://c6402.ambari.apache.org/hive?createDatabaseIfNotExist=true\' hive \'!`"\'"\'"\' 1\' com.mysql.jdbc.Driver',
                               path=['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'], tries=5, try_sleep=10
     )
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e20f15b6/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
index 0350589..a5b693b 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
@@ -125,7 +125,7 @@ class TestHiveServer(RMFTestCase):
                               user = 'hive'
     )
 
-    self.assertResourceCalled('Execute', '/usr/jdk64/jdk1.7.0_45/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/share/java/mysql-connector-java.jar org.apache.ambari.server.DBConnectionVerification jdbc:mysql://c6402.ambari.apache.org/hive?createDatabaseIfNotExist=true hive \'!`"\'"\'"\' 1\' com.mysql.jdbc.Driver',
+    self.assertResourceCalled('Execute', '/usr/jdk64/jdk1.7.0_45/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/share/java/mysql-connector-java.jar org.apache.ambari.server.DBConnectionVerification \'jdbc:mysql://c6402.ambari.apache.org/hive?createDatabaseIfNotExist=true\' hive \'!`"\'"\'"\' 1\' com.mysql.jdbc.Driver',
                               path=['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'], tries=5, try_sleep=10
     )
 
@@ -204,7 +204,7 @@ class TestHiveServer(RMFTestCase):
                               user = 'hive'
     )
 
-    self.assertResourceCalled('Execute', '/usr/jdk64/jdk1.7.0_45/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/share/java/mysql-connector-java.jar org.apache.ambari.server.DBConnectionVerification jdbc:mysql://c6402.ambari.apache.org/hive?createDatabaseIfNotExist=true hive \'!`"\'"\'"\' 1\' com.mysql.jdbc.Driver',
+    self.assertResourceCalled('Execute', '/usr/jdk64/jdk1.7.0_45/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/share/java/mysql-connector-java.jar org.apache.ambari.server.DBConnectionVerification \'jdbc:mysql://c6402.ambari.apache.org/hive?createDatabaseIfNotExist=true\' hive \'!`"\'"\'"\' 1\' com.mysql.jdbc.Driver',
                               path=['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'], tries=5, try_sleep=10
     )
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e20f15b6/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py b/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py
index aba747c..03a926e 100644
--- a/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py
+++ b/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py
@@ -43,7 +43,7 @@ class TestHiveMetastore(RMFTestCase):
                               user = 'hive'
     )
 
-    self.assertResourceCalled('Execute', '/usr/jdk64/jdk1.7.0_45/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/share/java/mysql-connector-java.jar org.apache.ambari.server.DBConnectionVerification jdbc:mysql://c6402.ambari.apache.org/hive?createDatabaseIfNotExist=true hive aaa com.mysql.jdbc.Driver',
+    self.assertResourceCalled('Execute', '/usr/jdk64/jdk1.7.0_45/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/share/java/mysql-connector-java.jar org.apache.ambari.server.DBConnectionVerification \'jdbc:mysql://c6402.ambari.apache.org/hive?createDatabaseIfNotExist=true\' hive aaa com.mysql.jdbc.Driver',
         path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
         tries = 5,
         try_sleep = 10,
@@ -85,7 +85,7 @@ class TestHiveMetastore(RMFTestCase):
                               user = 'hive'
     )
 
-    self.assertResourceCalled('Execute', '/usr/jdk64/jdk1.7.0_45/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/share/java/mysql-connector-java.jar org.apache.ambari.server.DBConnectionVerification jdbc:mysql://c6402.ambari.apache.org/hive?createDatabaseIfNotExist=true hive asd com.mysql.jdbc.Driver',
+    self.assertResourceCalled('Execute', '/usr/jdk64/jdk1.7.0_45/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/share/java/mysql-connector-java.jar org.apache.ambari.server.DBConnectionVerification \'jdbc:mysql://c6402.ambari.apache.org/hive?createDatabaseIfNotExist=true\' hive asd com.mysql.jdbc.Driver',
                               path=['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'], tries=5, try_sleep=10
     )
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e20f15b6/ambari-server/src/test/resources/TestAmbaryServer.samples/dummy_stack/HIVE/package/scripts/hive_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/TestAmbaryServer.samples/dummy_stack/HIVE/package/scripts/hive_service.py b/ambari-server/src/test/resources/TestAmbaryServer.samples/dummy_stack/HIVE/package/scripts/hive_service.py
index e8d4e5c..e869bc8 100644
--- a/ambari-server/src/test/resources/TestAmbaryServer.samples/dummy_stack/HIVE/package/scripts/hive_service.py
+++ b/ambari-server/src/test/resources/TestAmbaryServer.samples/dummy_stack/HIVE/package/scripts/hive_service.py
@@ -46,7 +46,7 @@ def hive_service(
 
     if params.hive_jdbc_driver == "com.mysql.jdbc.Driver" or params.hive_jdbc_driver == "oracle.jdbc.driver.OracleDriver":
       db_connection_check_command = format(
-        "{java64_home}/bin/java -cp {check_db_connection_jar}:/usr/share/java/{jdbc_jar_name} org.apache.ambari.server.DBConnectionVerification {hive_jdbc_connection_url} {hive_metastore_user_name} {hive_metastore_user_passwd} {hive_jdbc_driver}")
+        "{java64_home}/bin/java -cp {check_db_connection_jar}:/usr/share/java/{jdbc_jar_name} org.apache.ambari.server.DBConnectionVerification '{hive_jdbc_connection_url}' {hive_metastore_user_name} {hive_metastore_user_passwd} {hive_jdbc_driver}")
       Execute(db_connection_check_command,
               path='/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin')
 


[12/45] git commit: AMBARI-7043. BE: Move stack_advisor.py abstract class one folder up

Posted by jo...@apache.org.
AMBARI-7043. BE: Move stack_advisor.py abstract class one folder up


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

Branch: refs/heads/branch-alerts-dev
Commit: 40e3f0fc5d34b4d96a95e0e568e8754b042dc6f5
Parents: f6ee074
Author: Srimanth Gunturi <sg...@hortonworks.com>
Authored: Wed Aug 27 10:56:25 2014 -0700
Committer: Srimanth Gunturi <sg...@hortonworks.com>
Committed: Wed Aug 27 13:45:36 2014 -0700

----------------------------------------------------------------------
 .../src/main/resources/scripts/stack_advisor.py |  2 +-
 .../main/resources/stacks/HDP/stack_advisor.py  | 37 --------
 .../src/main/resources/stacks/stack_advisor.py  | 37 ++++++++
 .../server/api/services/AmbariMetaInfoTest.java |  4 +-
 .../AmbariManagementControllerTest.java         |  2 +-
 .../src/test/python/TestStackAdvisor.py         | 93 ++++++++++++++++++++
 .../stacks/2.0.6/common/test_stack_advisor.py   |  2 +-
 .../stacks/XYZ/1.0.0/services/stack_advisor.py  | 67 ++++++++++++++
 .../stacks/XYZ/1.0.1/services/stack_advisor.py  | 30 +++++++
 9 files changed, 233 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/40e3f0fc/ambari-server/src/main/resources/scripts/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/scripts/stack_advisor.py b/ambari-server/src/main/resources/scripts/stack_advisor.py
index 61d1e09..ed50866 100755
--- a/ambari-server/src/main/resources/scripts/stack_advisor.py
+++ b/ambari-server/src/main/resources/scripts/stack_advisor.py
@@ -33,7 +33,7 @@ ALL_ACTIONS = [ RECOMMEND_COMPONENT_LAYOUT_ACTION, VALIDATE_COMPONENT_LAYOUT_ACT
 USAGE = "Usage: <action> <hosts_file> <services_file>\nPossible actions are: {0}\n".format( str(ALL_ACTIONS) )
 
 SCRIPT_DIRECTORY = os.path.dirname(os.path.abspath(__file__))
-STACK_ADVISOR_PATH_TEMPLATE = os.path.join(SCRIPT_DIRECTORY, '../stacks/{0}/stack_advisor.py')
+STACK_ADVISOR_PATH_TEMPLATE = os.path.join(SCRIPT_DIRECTORY, '../stacks/stack_advisor.py')
 STACK_ADVISOR_IMPL_PATH_TEMPLATE = os.path.join(SCRIPT_DIRECTORY, './../stacks/{0}/{1}/services/stack_advisor.py')
 STACK_ADVISOR_IMPL_CLASS_TEMPLATE = '{0}{1}StackAdvisor'
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/40e3f0fc/ambari-server/src/main/resources/stacks/HDP/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/stack_advisor.py
deleted file mode 100644
index 5f66fff..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/stack_advisor.py
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/usr/bin/env ambari-python-wrap
-"""
-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.
-"""
-
-class StackAdvisor(object):
-
-  def recommendComponentLayout(self, services, hosts):
-    """Returns Services object with hostnames array populated for components"""
-    pass
-
-  def validateComponentLayout(self, services, hosts):
-    """Returns array of Validation objects about issues with hostnames components assigned to"""
-    pass
-
-  def recommendConfigurations(self, services, hosts):
-    """Returns Services object with configurations object populated"""
-    pass
-
-  def validateConfigurations(self, services, hosts):
-    """Returns array of Validation objects about issues with configuration values provided in services"""
-    pass
-

http://git-wip-us.apache.org/repos/asf/ambari/blob/40e3f0fc/ambari-server/src/main/resources/stacks/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/stack_advisor.py b/ambari-server/src/main/resources/stacks/stack_advisor.py
new file mode 100644
index 0000000..5f66fff
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/stack_advisor.py
@@ -0,0 +1,37 @@
+#!/usr/bin/env ambari-python-wrap
+"""
+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.
+"""
+
+class StackAdvisor(object):
+
+  def recommendComponentLayout(self, services, hosts):
+    """Returns Services object with hostnames array populated for components"""
+    pass
+
+  def validateComponentLayout(self, services, hosts):
+    """Returns array of Validation objects about issues with hostnames components assigned to"""
+    pass
+
+  def recommendConfigurations(self, services, hosts):
+    """Returns Services object with configurations object populated"""
+    pass
+
+  def validateConfigurations(self, services, hosts):
+    """Returns array of Validation objects about issues with configuration values provided in services"""
+    pass
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/40e3f0fc/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java
index 37d1af4..c08534c 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java
@@ -73,6 +73,7 @@ import com.google.inject.Injector;
 public class AmbariMetaInfoTest {
 
   private static final String STACK_NAME_HDP = "HDP";
+  private static final String STACK_NAME_XYZ = "XYZ";
   private static final String STACK_VERSION_HDP = "0.1";
   private static final String EXT_STACK_NAME = "2.0.6";
   private static final String STACK_VERSION_HDP_02 = "0.2";
@@ -88,7 +89,7 @@ public class AmbariMetaInfoTest {
   private static final String NON_EXT_VALUE = "XXX";
 
   private static final int REPOS_CNT = 3;
-  private static final int STACKS_NAMES_CNT = 1;
+  private static final int STACKS_NAMES_CNT = 2;
   private static final int PROPERTIES_CNT = 62;
   private static final int OS_CNT = 4;
 
@@ -408,6 +409,7 @@ public class AmbariMetaInfoTest {
     Set<Stack> stackNames = metaInfo.getStackNames();
     assertEquals(stackNames.size(), STACKS_NAMES_CNT);
     assertTrue(stackNames.contains(new Stack(STACK_NAME_HDP)));
+    assertTrue(stackNames.contains(new Stack(STACK_NAME_XYZ)));
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/ambari/blob/40e3f0fc/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
index 1bfc25a..5fdd619 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
@@ -156,7 +156,7 @@ public class AmbariManagementControllerTest {
   private static final String NAGIOS_SERVICE_NAME = "NAGIOS";
   private static final int STACK_VERSIONS_CNT = 12;
   private static final int REPOS_CNT = 3;
-  private static final int STACKS_CNT = 1;
+  private static final int STACKS_CNT = 2;
   private static final int STACK_PROPERTIES_CNT = 99;
   private static final int STACK_COMPONENTS_CNT = 4;
   private static final int OS_CNT = 2;

http://git-wip-us.apache.org/repos/asf/ambari/blob/40e3f0fc/ambari-server/src/test/python/TestStackAdvisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/TestStackAdvisor.py b/ambari-server/src/test/python/TestStackAdvisor.py
new file mode 100644
index 0000000..5a1a242
--- /dev/null
+++ b/ambari-server/src/test/python/TestStackAdvisor.py
@@ -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.
+'''
+
+from unittest import TestCase
+import os
+
+class TestStackAdvisorInitialization(TestCase):
+
+  def setUp(self):
+    import imp
+
+    self.test_directory = os.path.dirname(os.path.abspath(__file__))
+    stack_advisor_path = os.path.join(self.test_directory, '../../main/resources/scripts/stack_advisor.py')
+    with open(stack_advisor_path, 'rb') as fp:
+        self.stack_advisor = imp.load_module( 'stack_advisor', fp, stack_advisor_path, ('.py', 'rb', imp.PY_SOURCE) )
+
+  def test_stackAdvisorLoadedForNotHDPStack(self):
+    path_template = os.path.join(self.test_directory, '../resources/stacks/{0}/{1}/services/stack_advisor.py')
+    path_template_name = "STACK_ADVISOR_IMPL_PATH_TEMPLATE"
+    setattr(self.stack_advisor, path_template_name, path_template)
+    self.assertEquals(path_template, getattr(self.stack_advisor, path_template_name))
+    instantiate_stack_advisor_method_name = 'instantiateStackAdvisor'
+    instantiate_stack_advisor_method = getattr(self.stack_advisor, instantiate_stack_advisor_method_name)
+    stack_advisor = instantiate_stack_advisor_method("XYZ", "1.0.1", ["1.0.0"])
+    self.assertEquals("XYZ101StackAdvisor", stack_advisor.__class__.__name__)
+    services = {"Versions":
+                  {
+                    "stack_name":"XYZ",
+                    "stack_version":"1.0.1"
+                  },
+                "services":[
+                  {
+                    "StackServices":{
+                      "service_name":"YARN"
+                    },
+                    "components":[
+                      {
+                        "StackServiceComponents": {
+                          "component_name": "RESOURCEMANAGER"
+                        }
+                      },
+                      {
+                        "StackServiceComponents": {
+                          "component_name": "APP_TIMELINE_SERVER"
+                        }
+                      },
+                      {
+                        "StackServiceComponents": {
+                          "component_name":"YARN_CLIENT"
+                        }
+                      },
+                      {
+                        "StackServiceComponents": {
+                          "component_name": "NODEMANAGER"
+                        }
+                      }
+                    ]
+                  }
+                ]
+    }
+    hosts= {
+      "items": [
+        {"Hosts": {"host_name": "host1"}},
+        {"Hosts": {"host_name": "host2"}}
+      ]
+    }
+    config_recommendations = stack_advisor.recommendConfigurations(services, hosts)
+    yarn_configs = config_recommendations["recommendations"]["blueprint"]["configurations"]["yarn-site"]["properties"]
+    '''Check that value is populated from child class, not parent'''
+    self.assertEquals("-Xmx101m", yarn_configs["yarn.nodemanager.resource.memory-mb"])
+
+  def test_stackAdvisorSuperClassIsFoundAndReturnedAsDefaultImpl(self):
+    instantiate_stack_advisor_method_name = 'instantiateStackAdvisor'
+    instantiate_stack_advisor_method = getattr(self.stack_advisor, instantiate_stack_advisor_method_name)
+    '''Not existent stack - to return default implementation'''
+    default_stack_advisor = instantiate_stack_advisor_method("HDP1", "2.0.6", [])
+    self.assertEquals("StackAdvisor", default_stack_advisor.__class__.__name__)
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/40e3f0fc/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
index b5bdba6..d32fa56 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
@@ -26,7 +26,7 @@ class TestHDP206StackAdvisor(TestCase):
     import os
 
     testDirectory = os.path.dirname(os.path.abspath(__file__))
-    stackAdvisorPath = os.path.join(testDirectory, '../../../../../main/resources/stacks/HDP/stack_advisor.py')
+    stackAdvisorPath = os.path.join(testDirectory, '../../../../../main/resources/stacks/stack_advisor.py')
     hdp206StackAdvisorPath = os.path.join(testDirectory, '../../../../../main/resources/stacks/HDP/2.0.6/services/stack_advisor.py')
     hdp206StackAdvisorClassName = 'HDP206StackAdvisor'
     with open(stackAdvisorPath, 'rb') as fp:

http://git-wip-us.apache.org/repos/asf/ambari/blob/40e3f0fc/ambari-server/src/test/resources/stacks/XYZ/1.0.0/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/stacks/XYZ/1.0.0/services/stack_advisor.py b/ambari-server/src/test/resources/stacks/XYZ/1.0.0/services/stack_advisor.py
new file mode 100644
index 0000000..ba140bb
--- /dev/null
+++ b/ambari-server/src/test/resources/stacks/XYZ/1.0.0/services/stack_advisor.py
@@ -0,0 +1,67 @@
+#!/usr/bin/env ambari-python-wrap
+"""
+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.
+"""
+
+from stack_advisor import StackAdvisor
+
+class XYZ100StackAdvisor(StackAdvisor):
+
+  def recommendConfigurations(self, services, hosts):
+    stackName = services["Versions"]["stack_name"]
+    stackVersion = services["Versions"]["stack_version"]
+    hostsList = [host["Hosts"]["host_name"] for host in hosts["items"]]
+    servicesList = [service["StackServices"]["service_name"] for service in services["services"]]
+
+    recommendations = {
+      "Versions": {"stack_name": stackName, "stack_version": stackVersion},
+      "hosts": hostsList,
+      "services": servicesList,
+      "recommendations": {
+        "blueprint": {
+          "configurations": {},
+          "host_groups": []
+        },
+        "blueprint_cluster_binding": {
+          "host_groups": []
+        }
+      }
+    }
+
+    configurations = recommendations["recommendations"]["blueprint"]["configurations"]
+    for service in servicesList:
+      calculation = self.recommendServiceConfigurations(service)
+      if calculation is not None:
+        calculation(configurations)
+
+    return recommendations
+
+  def recommendServiceConfigurations(self, service):
+    return {
+      "YARN": self.recommendYARNConfigurations,
+    }.get(service, None)
+
+  def putProperty(self, config, configType):
+    config[configType] = {"properties": {}}
+    def appendProperty(key, value):
+      config[configType]["properties"][key] = str(value)
+    return appendProperty
+
+  def recommendYARNConfigurations(self, configurations):
+    putYarnProperty = self.putProperty(configurations, "yarn-site")
+    putYarnProperty('yarn.nodemanager.resource.memory-mb', "-Xmx100m")
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/40e3f0fc/ambari-server/src/test/resources/stacks/XYZ/1.0.1/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/stacks/XYZ/1.0.1/services/stack_advisor.py b/ambari-server/src/test/resources/stacks/XYZ/1.0.1/services/stack_advisor.py
new file mode 100644
index 0000000..74a4b31
--- /dev/null
+++ b/ambari-server/src/test/resources/stacks/XYZ/1.0.1/services/stack_advisor.py
@@ -0,0 +1,30 @@
+#!/usr/bin/env ambari-python-wrap
+"""
+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 re
+import socket
+import sys
+
+from stack_advisor import StackAdvisor
+
+class XYZ101StackAdvisor(XYZ100StackAdvisor):
+
+  def recommendYARNConfigurations(self, configurations):
+    putYarnProperty = self.putProperty(configurations, "yarn-site")
+    putYarnProperty('yarn.nodemanager.resource.memory-mb', "-Xmx101m")


[19/45] git commit: AMBARI-7045. Slider View: When creating slider app, update Ganglia server host value (alexantonenko)

Posted by jo...@apache.org.
AMBARI-7045. Slider View: When creating slider app, update Ganglia server host value (alexantonenko)


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

Branch: refs/heads/branch-alerts-dev
Commit: 9dcb434eab370bafc3410e9fd80d8bef33008cb6
Parents: 4c5ed4c
Author: Alex Antonenko <hi...@gmail.com>
Authored: Wed Aug 27 21:34:22 2014 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Thu Aug 28 01:49:20 2014 +0300

----------------------------------------------------------------------
 .../createAppWizard/step1_controller.js         | 30 ++++++++++++++++++++
 .../createAppWizard/step3_controller.js         |  9 ++++--
 .../src/main/resources/ui/app/helpers/ajax.js   | 27 ++++++++++++++++--
 .../src/main/resources/ui/app/initialize.js     |  2 ++
 .../ui/app/mappers/application_status.js        | 25 ++++++++++++++++
 5 files changed, 89 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9dcb434e/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step1_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step1_controller.js b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step1_controller.js
index 9bfe68c..42c0080 100644
--- a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step1_controller.js
+++ b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step1_controller.js
@@ -81,11 +81,41 @@ App.CreateAppWizardStep1Controller = Ember.Controller.extend({
    * @method loadStep
    */
   loadStep: function () {
+    this.loadGangliaHost();
     this.initializeNewApp();
     this.loadAvailableTypes();
   },
 
   /**
+   * Load ganglia server host
+   * @method loadGangliaHost
+   */
+  loadGangliaHost: function () {
+    return App.ajax.send({
+      name: 'components_hosts',
+      sender: this,
+      data: {
+        componentName: "GANGLIA_SERVER",
+        urlPrefix: '/api/v1/'
+      },
+      success: 'loadGangliaHostSuccessCallback'
+    });
+
+  },
+
+  /**
+   * Success callback for hosts-request
+   * Save host name to gangliaHost
+   * @param {Object} data
+   * @method loadGangliaHostSuccessCallback
+   */
+  loadGangliaHostSuccessCallback: function (data) {
+    if(data.items[0]){
+      App.set('gangliaHost', Em.get(data.items[0], 'Hosts.host_name'));
+    }
+  },
+
+  /**
    * Initialize new App and set it to <code>newApp</code>
    * @method initializeNewApp
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dcb434e/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js
index b98afb4..12dd699 100644
--- a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js
+++ b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js
@@ -65,19 +65,24 @@ App.CreateAppWizardStep3Controller = Ember.ObjectController.extend({
    */
   loadStep: function () {
     this.clearStep();
-    this.initConfigs();
+    this.initConfigs(true);
   },
 
   /**
    * Format init value for <code>configs</code> property
+   * @param {bool} setDefaults
    * @method initConfigs
    */
-  initConfigs: function() {
+  initConfigs: function(setDefaults) {
+    setDefaults = setDefaults === true ? setDefaults : false;
     var configs = this.get('newAppConfigs') || {},
         c = Em.A();
 
     Object.keys(configs).forEach(function (key) {
       var label = (!!key.match('^site.'))?key.substr(5):key;
+      if(key === "site.global.ganglia_server_host" && setDefaults) {
+        configs[key] = App.get('gangliaHost') ? App.get('gangliaHost') : configs[key];
+      }
       c.push({name:key,value:configs[key],label:label})
     });
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dcb434e/contrib/views/slider/src/main/resources/ui/app/helpers/ajax.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/helpers/ajax.js b/contrib/views/slider/src/main/resources/ui/app/helpers/ajax.js
index 64c8385..255668f 100644
--- a/contrib/views/slider/src/main/resources/ui/app/helpers/ajax.js
+++ b/contrib/views/slider/src/main/resources/ui/app/helpers/ajax.js
@@ -104,6 +104,22 @@ var urls = {
     }
   },
 
+  'components_hosts': {
+    real: 'clusters/{clusterName}/hosts?host_components/HostRoles/component_name={componentName}&minimal_response=true',
+    headers: {
+      Accept : "text/plain; charset=utf-8",
+      "Content-Type": "text/plain; charset=utf-8"
+    }
+  },
+
+  'cluster_name': {
+    real: 'clusters',
+    headers: {
+      Accept : "text/plain; charset=utf-8",
+      "Content-Type": "text/plain; charset=utf-8"
+    }
+  },
+
   'metrics': {
     real: 'apps/{id}/metrics/{metric}',
     mock: '/data/metrics/metric.json'
@@ -169,6 +185,9 @@ var formatRequest = function (data) {
   }
   else {
     var prefix = App.get('urlPrefix');
+    if(Em.get(data, 'urlPrefix')){
+      var prefix = Em.get(data, 'urlPrefix');
+    }
     opt.url = prefix + formatUrl(this.real, data);
   }
 
@@ -204,8 +223,12 @@ var ajax = Em.Object.extend({
     Ember.assert('Ajax sender should be defined!', config.sender);
     Ember.assert('Invalid config.name provided - ' + config.name, urls[config.name]);
 
-    var opt = {},
-      params = {};
+    var opt = {};
+
+    // default parameters
+    var params = {
+      clusterName: App.get('clusterName')
+    };
 
     if (config.data) {
       jQuery.extend(params, config.data);

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dcb434e/contrib/views/slider/src/main/resources/ui/app/initialize.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/initialize.js b/contrib/views/slider/src/main/resources/ui/app/initialize.js
index cc22ba2..e93550f 100755
--- a/contrib/views/slider/src/main/resources/ui/app/initialize.js
+++ b/contrib/views/slider/src/main/resources/ui/app/initialize.js
@@ -82,6 +82,8 @@ App.initializer({
       viewErrors: []
 
     });
+
+    application.ApplicationStatusMapper.getClusterName();
     application.ApplicationStatusMapper.loop('load');
     application.ApplicationTypeMapper.loop('load');
     application.SliderAppsMapper.loop('load');

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dcb434e/contrib/views/slider/src/main/resources/ui/app/mappers/application_status.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/mappers/application_status.js b/contrib/views/slider/src/main/resources/ui/app/mappers/application_status.js
index 40a6edf..93a3789 100644
--- a/contrib/views/slider/src/main/resources/ui/app/mappers/application_status.js
+++ b/contrib/views/slider/src/main/resources/ui/app/mappers/application_status.js
@@ -68,6 +68,31 @@ App.ApplicationStatusMapper = App.Mapper.createWithMixins(App.RunPeriodically, {
     Ember.keys(map).forEach(function(key) {
       App.set(key, Ember.getWithDefault(data, map[key], ''));
     });
+  },
+
+  /**
+   * Get cluster name from server
+   * @returns {$.ajax}
+   * @method getClusterName
+   */
+  getClusterName: function() {
+    return App.ajax.send({
+      name: 'cluster_name',
+      sender: this,
+      data: {
+        urlPrefix: '/api/v1/'
+      },
+      success: 'getClusterNameSuccessCallback'
+    });
+  },
+
+  /**
+   * Success callback for clusterName-request
+   * @param {object} data
+   * @method getClusterNameSuccessCallback
+   */
+  getClusterNameSuccessCallback: function(data) {
+    App.set('clusterName', Em.get(data.items[0], 'Clusters.cluster_name'));
   }
 
 });
\ No newline at end of file


[20/45] git commit: Revert "AMBARI-7048. Change component message from "cannot" to "should not""

Posted by jo...@apache.org.
Revert "AMBARI-7048. Change component message from "cannot" to "should not""

This reverts commit f23e09de6c9aad0523c3fa77e2eaf7bfda72a5cc.


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

Branch: refs/heads/branch-alerts-dev
Commit: fc626c99cf579a37b1e1c8aad4690ceffc02c1e2
Parents: 9dcb434
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Wed Aug 27 16:00:26 2014 -0700
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Wed Aug 27 16:00:26 2014 -0700

----------------------------------------------------------------------
 .../main/resources/stacks/HDP/1.3.2/services/stack_advisor.py    | 4 ++--
 .../main/resources/stacks/HDP/2.0.6/services/stack_advisor.py    | 4 ++--
 .../src/test/python/stacks/2.0.6/common/test_stack_advisor.py    | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/fc626c99/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/stack_advisor.py
index 17a26e2..f3c1e1d 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/stack_advisor.py
@@ -192,8 +192,8 @@ class HDP132StackAdvisor(StackAdvisor):
       secondaryNameNodeHosts = secondaryNameNodeHosts[0]
       commonHosts = list(set(nameNodeHosts).intersection(secondaryNameNodeHosts))
       for host in commonHosts:
-        items.append( { "type": 'host-component', "level": 'WARN', "message": 'NameNode and Secondary NameNode should not be hosted on same machine', "component-name": 'NAMENODE', "host": str(host) } )
-        items.append( { "type": 'host-component', "level": 'WARN', "message": 'NameNode and Secondary NameNode should not be hosted on same machine', "component-name": 'SECONDARY_NAMENODE', "host": str(host) } )
+        items.append( { "type": 'host-component', "level": 'WARN', "message": 'NameNode and Secondary NameNode cannot be hosted on same machine', "component-name": 'NAMENODE', "host": str(host) } )
+        items.append( { "type": 'host-component', "level": 'WARN', "message": 'NameNode and Secondary NameNode cannot be hosted on same machine', "component-name": 'SECONDARY_NAMENODE', "host": str(host) } )
 
     # Validating cardinality
     for component in componentsList:

http://git-wip-us.apache.org/repos/asf/ambari/blob/fc626c99/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
index 4eb8f02..083286e 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
@@ -192,8 +192,8 @@ class HDP206StackAdvisor(StackAdvisor):
       secondaryNameNodeHosts = secondaryNameNodeHosts[0]
       commonHosts = list(set(nameNodeHosts).intersection(secondaryNameNodeHosts))
       for host in commonHosts:
-        items.append( { "type": 'host-component', "level": 'WARN', "message": 'NameNode and Secondary NameNode should not be hosted on same machine', "component-name": 'NAMENODE', "host": str(host) } )
-        items.append( { "type": 'host-component', "level": 'WARN', "message": 'NameNode and Secondary NameNode should not be hosted on same machine', "component-name": 'SECONDARY_NAMENODE', "host": str(host) } )
+        items.append( { "type": 'host-component', "level": 'WARN', "message": 'NameNode and Secondary NameNode cannot be hosted on same machine', "component-name": 'NAMENODE', "host": str(host) } )
+        items.append( { "type": 'host-component', "level": 'WARN', "message": 'NameNode and Secondary NameNode cannot be hosted on same machine', "component-name": 'SECONDARY_NAMENODE', "host": str(host) } )
 
     # Validating cardinality
     for component in componentsList:

http://git-wip-us.apache.org/repos/asf/ambari/blob/fc626c99/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
index 71e329b..b8e0d58 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
@@ -99,8 +99,8 @@ class TestHDP206StackAdvisor(TestCase):
     result = self.stackAdvisor.validateComponentLayout(services, hosts)
 
     expectedItems = [
-      {"message": "NameNode and Secondary NameNode should not be hosted on same machine", "level": "WARN", "host": "host1"},
-      {"message": "NameNode and Secondary NameNode should not be hosted on same machine", "level": "WARN", "host": "host1"},
+      {"message": "NameNode and Secondary NameNode cannot be hosted on same machine", "level": "WARN", "host": "host1"},
+      {"message": "NameNode and Secondary NameNode cannot be hosted on same machine", "level": "WARN", "host": "host1"},
       {"message": "Host is not used", "level": "ERROR", "host": "host2"}
     ]
     self.assertValidationResult(expectedItems, result)


[34/45] git commit: AMBARI-7055. Slider View: Metric names and quick-links should be human readable. (onechiporenko)

Posted by jo...@apache.org.
AMBARI-7055. Slider View: Metric names and quick-links should be human readable. (onechiporenko)


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

Branch: refs/heads/branch-alerts-dev
Commit: ff27e56fe8a983c76c40951472575197117b5914
Parents: 0fb6e63
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Thu Aug 28 16:34:13 2014 +0300
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Thu Aug 28 16:34:13 2014 +0300

----------------------------------------------------------------------
 .../src/main/resources/ui/app/helpers/helper.js | 32 ++++++++++++++++++++
 .../ui/app/mappers/slider_apps_mapper.js        |  2 +-
 .../resources/ui/app/templates/slider_app.hbs   |  2 +-
 .../ui/app/templates/slider_app/summary.hbs     |  2 +-
 4 files changed, 35 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ff27e56f/contrib/views/slider/src/main/resources/ui/app/helpers/helper.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/helpers/helper.js b/contrib/views/slider/src/main/resources/ui/app/helpers/helper.js
index 664328c..88dfcb7 100644
--- a/contrib/views/slider/src/main/resources/ui/app/helpers/helper.js
+++ b/contrib/views/slider/src/main/resources/ui/app/helpers/helper.js
@@ -68,4 +68,36 @@ App.registerBoundHelper('formatWordBreak', Em.View.extend({
     var r = new RegExp('\\'+d,"g");
     return this.get('content') && this.get('content').replace(r, d+'<wbr />');
   }.property('content')
+}));
+
+/**
+ * Return formatted string with inserted spaces before upper case and replaced '_' to spaces
+ * Also capitalize first letter
+ *
+ * @param {String} content
+ *
+ * Examples:
+ *
+ * returns 'apple'
+ * {{humanize 'Apple'}}
+ *
+ * returns 'apple_banana'
+ * {{humanize 'Apple banana'}}
+ *
+ * returns 'apple_bananaUranium'
+ * {{humanize 'Apple banana Uranium'}}
+ */
+App.registerBoundHelper('humanize', Em.View.extend({
+
+  tagName: 'span',
+
+  template: Ember.Handlebars.compile('{{{view.result}}}'),
+
+  /**
+   * @type {string}
+   */
+  result: function() {
+    var content = this.get('content');
+    return content && (content[0].toUpperCase() + content.slice(1)).replace(/([A-Z])/g, ' $1').replace(/_/g, ' ');
+  }.property('content')
 }));
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/ff27e56f/contrib/views/slider/src/main/resources/ui/app/mappers/slider_apps_mapper.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/mappers/slider_apps_mapper.js b/contrib/views/slider/src/main/resources/ui/app/mappers/slider_apps_mapper.js
index dbe62bf..e5bcb49 100644
--- a/contrib/views/slider/src/main/resources/ui/app/mappers/slider_apps_mapper.js
+++ b/contrib/views/slider/src/main/resources/ui/app/mappers/slider_apps_mapper.js
@@ -141,7 +141,7 @@ App.SliderAppsMapper = App.Mapper.createWithMixins(App.RunPeriodically, {
         masterActiveTime.value = new Date(Date.now() - masterActiveTime.value).getHours() + "h:" + new Date(Date.now() - masterActiveTime.value).getMinutes() + "m";
       }
       if(masterStartTime){
-        masterStartTime.value = (new Date(masterStartTime.value).toUTCString());
+        masterStartTime.value = (new Date(parseInt(masterStartTime.value)).toUTCString());
       }
       apps.push(
         Ember.Object.create({

http://git-wip-us.apache.org/repos/asf/ambari/blob/ff27e56f/contrib/views/slider/src/main/resources/ui/app/templates/slider_app.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/templates/slider_app.hbs b/contrib/views/slider/src/main/resources/ui/app/templates/slider_app.hbs
index b8ab969..f435bdf 100644
--- a/contrib/views/slider/src/main/resources/ui/app/templates/slider_app.hbs
+++ b/contrib/views/slider/src/main/resources/ui/app/templates/slider_app.hbs
@@ -33,7 +33,7 @@
       <ul class="dropdown-menu">
         {{#each option in controller.availableActions}}
           <li>
-            <a {{action 'openModal' option target='controller'}}>{{option.title}}</a>
+            <a {{action 'openModal' option target='controller'}}>{{humanize option.title}}</a>
           </li>
         {{/each}}
       </ul>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ff27e56f/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/summary.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/summary.hbs b/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/summary.hbs
index 010bb9b..68ea262 100644
--- a/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/summary.hbs
+++ b/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/summary.hbs
@@ -44,7 +44,7 @@
             </tr>
             {{#each controller.model.jmx}}
               <tr>
-                <td>{{key}}</td>
+                <td>{{humanize key}}</td>
                 <td>{{formatWordBreak value}}</td>
               </tr>
             {{/each}}


[39/45] git commit: AMBARI-7059. FE: Adding Sqoop service right after install doesnt auto-select Client. (Max Shepel via akovalenko)

Posted by jo...@apache.org.
AMBARI-7059. FE: Adding Sqoop service right after install doesnt auto-select Client. (Max Shepel via akovalenko)


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

Branch: refs/heads/branch-alerts-dev
Commit: f2f5dff25143545c6ab542ab0d62c7fc61ea418a
Parents: 6bd0394
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Thu Aug 28 18:09:43 2014 +0300
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Thu Aug 28 18:09:43 2014 +0300

----------------------------------------------------------------------
 .../controllers/main/service/add_controller.js  | 24 +++++++++++---------
 .../app/controllers/wizard/step8_controller.js  | 12 ++++++----
 ambari-web/app/routes/add_host_routes.js        |  2 ++
 ambari-web/app/routes/add_service_routes.js     |  2 ++
 ambari-web/app/routes/installer.js              |  2 ++
 .../main/service/add_controller_test.js         | 10 ++++++++
 6 files changed, 36 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f2f5dff2/ambari-web/app/controllers/main/service/add_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/add_controller.js b/ambari-web/app/controllers/main/service/add_controller.js
index 52bd41b..cce1f5f 100644
--- a/ambari-web/app/controllers/main/service/add_controller.js
+++ b/ambari-web/app/controllers/main/service/add_controller.js
@@ -391,18 +391,20 @@ App.AddServiceController = App.WizardController.extend({
    */
   installAdditionalClients: function () {
     this.get('content.additionalClients').forEach(function (c) {
-      var queryStr = 'HostRoles/component_name='+ c.componentName + '&HostRoles/host_name.in(' + c.hostNames.join() + ')';
-      App.ajax.send({
-        name: 'common.host_component.update',
-        sender: this,
-        data: {
-          query: queryStr,
-          context: 'Install ' + App.format.role(c.componentName),
-          HostRoles: {
-            state: 'INSTALLED'
+      if (c.hostNames.length > 0) {
+        var queryStr = 'HostRoles/component_name='+ c.componentName + '&HostRoles/host_name.in(' + c.hostNames.join() + ')';
+        App.ajax.send({
+          name: 'common.host_component.update',
+          sender: this,
+          data: {
+            query: queryStr,
+            context: 'Install ' + App.format.role(c.componentName),
+            HostRoles: {
+              state: 'INSTALLED'
+            }
           }
-        }
-      });
+        });
+      }
     }, this);
   }
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/f2f5dff2/ambari-web/app/controllers/wizard/step8_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js
index 7eef55e..4396432 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -1285,11 +1285,13 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, {
           }, this);
         }, this);
         hostNames = hostNames.uniq();
-        this.get('content.additionalClients').pushObject({hostNames: hostNames, componentName: _clientName});
-        // If a dependency for being co-hosted is derived between existing client and selected new master but that
-        // dependency is already satisfied in the cluster then disregard the derived dependency
-        this.removeClientsFromList(_clientName, hostNames);
-        this.registerHostsToComponent(hostNames, _clientName);
+        if (hostNames.length > 0) {
+          this.get('content.additionalClients').pushObject({hostNames: hostNames, componentName: _clientName});
+          // If a dependency for being co-hosted is derived between existing client and selected new master but that
+          // dependency is already satisfied in the cluster then disregard the derived dependency
+          this.removeClientsFromList(_clientName, hostNames);
+          this.registerHostsToComponent(hostNames, _clientName);
+        }
       }
     }, this);
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/f2f5dff2/ambari-web/app/routes/add_host_routes.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/add_host_routes.js b/ambari-web/app/routes/add_host_routes.js
index e4ae41f..ff281a9 100644
--- a/ambari-web/app/routes/add_host_routes.js
+++ b/ambari-web/app/routes/add_host_routes.js
@@ -154,11 +154,13 @@ module.exports = App.WizardRoute.extend({
     next: function (router, context) {
       var addHostController = router.get('addHostController');
       var wizardStep3Controller = router.get('wizardStep3Controller');
+      var wizardStep6Controller = router.get('wizardStep6Controller');
       addHostController.saveConfirmedHosts(wizardStep3Controller);
       addHostController.saveClients();
 
       addHostController.setDBProperty('bootStatus', true);
       addHostController.setDBProperty('slaveComponentHosts', undefined);
+      wizardStep6Controller.set('isClientsSet', false);
       router.transitionTo('step3');
     },
     /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/f2f5dff2/ambari-web/app/routes/add_service_routes.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/add_service_routes.js b/ambari-web/app/routes/add_service_routes.js
index 45b28b7..4e4b83e 100644
--- a/ambari-web/app/routes/add_service_routes.js
+++ b/ambari-web/app/routes/add_service_routes.js
@@ -137,8 +137,10 @@ module.exports = App.WizardRoute.extend({
     next: function (router) {
       var addServiceController = router.get('addServiceController');
       var wizardStep5Controller = router.get('wizardStep5Controller');
+      var wizardStep6Controller = router.get('wizardStep6Controller');
       addServiceController.saveMasterComponentHosts(wizardStep5Controller);
       addServiceController.setDBProperty('slaveComponentHosts', undefined);
+      wizardStep6Controller.set('isClientsSet', false);
       router.transitionTo('step3');
     }
   }),

http://git-wip-us.apache.org/repos/asf/ambari/blob/f2f5dff2/ambari-web/app/routes/installer.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/installer.js b/ambari-web/app/routes/installer.js
index fa10e6b..0ca109a 100644
--- a/ambari-web/app/routes/installer.js
+++ b/ambari-web/app/routes/installer.js
@@ -272,9 +272,11 @@ module.exports = Em.Route.extend({
     next: function (router) {
       var controller = router.get('installerController');
       var wizardStep5Controller = router.get('wizardStep5Controller');
+      var wizardStep6Controller = router.get('wizardStep6Controller');
       controller.saveMasterComponentHosts(wizardStep5Controller);
       controller.setDBProperty('slaveComponentHosts', undefined);
       controller.setDBProperty('recommendations', wizardStep5Controller.get('content.recommendations'));
+      wizardStep6Controller.set('isClientsSet', false);
       router.transitionTo('step6');
     }
   }),

http://git-wip-us.apache.org/repos/asf/ambari/blob/f2f5dff2/ambari-web/test/controllers/main/service/add_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/service/add_controller_test.js b/ambari-web/test/controllers/main/service/add_controller_test.js
index 3e9b2cc..b56a875 100644
--- a/ambari-web/test/controllers/main/service/add_controller_test.js
+++ b/ambari-web/test/controllers/main/service/add_controller_test.js
@@ -34,6 +34,10 @@ describe('App.AddServiceController', function() {
         componentName: "TEZ_CLIENT",
         hostNames: ["hostName1", "hostName2"]
       },
+      additionalClientsWithoutHosts: {
+        componentName: "TEZ_CLIENT",
+        hostNames: []
+      },
       RequestInfo: {
         "context": Em.I18n.t('requestInfo.installHostComponent') + ' ' + App.format.role("TEZ_CLIENT"),
         "query": "HostRoles/component_name=TEZ_CLIENT&HostRoles/host_name.in(hostName1,hostName2)"
@@ -66,6 +70,12 @@ describe('App.AddServiceController', function() {
       expect(JSON.parse($.ajax.args[0][0].data).Body).to.deep.eql(t.Body);
       expect(JSON.parse($.ajax.args[0][0].data).RequestInfo).to.eql(t.RequestInfo);
     });
+
+    it('should not send request to install client', function () {
+      addServiceController.set("content.additionalClients", [t.additionalClientsWithoutHosts]);
+      expect($.ajax.called).to.be.false;
+    });
+
   });
 
 });


[44/45] git commit: AMBARI-7029. Configs: ui and general.(xiwang)

Posted by jo...@apache.org.
AMBARI-7029. Configs: ui and general.(xiwang)


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

Branch: refs/heads/branch-alerts-dev
Commit: 869b00c61c86037e2514946f288b311b78dbcee8
Parents: d1bdc81
Author: Xi Wang <xi...@apache.org>
Authored: Thu Aug 28 10:15:59 2014 -0700
Committer: Xi Wang <xi...@apache.org>
Committed: Thu Aug 28 10:41:36 2014 -0700

----------------------------------------------------------------------
 .../app/controllers/wizard/step8_controller.js    | 18 +++++++++++++-----
 ambari-web/app/messages.js                        |  8 ++++++--
 ambari-web/app/styles/application.less            | 11 +++++++----
 .../common/configs/config_history_flow.hbs        |  8 +++++---
 .../views/common/configs/config_history_flow.js   |  3 +++
 5 files changed, 34 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/869b00c6/ambari-web/app/controllers/wizard/step8_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js
index 4396432..2846e8c 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -839,7 +839,6 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, {
     var configurationController = App.router.get('mainServiceInfoConfigsController');
     var configs = this.get('configs').slice(0);
     var configsMap = [];
-
     fileNamesToUpdate.forEach(function (fileName) {
       if (!fileName || /^(core)/.test(fileName)) return;
       var tagName = 'version' + (new Date).getTime();
@@ -1434,17 +1433,25 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, {
     selectedServices.forEach(function (service) {
       Object.keys(service.get('configTypes')).forEach(function (type) {
         if (!this.get('serviceConfigTags').someProperty('type', type)) {
+          var serviceVersionNotes = Em.I18n.t('dashboard.configHistory.table.notes.default').format(service.get('serviceName'));
           if (!App.supports.capacitySchedulerUi && service.get('serviceName') === 'MAPREDUCE' && (type === 'capacity-scheduler' || type === 'mapred-queue-acls')) {
             return;
           } else if (type === 'core-site') {
+            coreSiteObject.service_config_version_note = serviceVersionNotes
             this.get('serviceConfigTags').pushObject(coreSiteObject);
           } else if (type === 'storm-site') {
-            this.get('serviceConfigTags').pushObject(this.createStormSiteObj(tag));
+            var obj = this.createStormSiteObj(tag);
+            obj.service_config_version_note = serviceVersionNotes;
+            this.get('serviceConfigTags').pushObject(obj);
           } else if (type === 'zoo.cfg') {
-            this.get('serviceConfigTags').pushObject(this.createZooCfgObj(tag));
+            var obj = this.createZooCfgObj(tag);
+            obj.service_config_version_note = serviceVersionNotes;
+            this.get('serviceConfigTags').pushObject(obj);
           } else {
             var isNonXmlFile = type.endsWith('log4j') || type.endsWith('env') || type.endsWith('properties') || type.endsWith('conf');
-            this.get('serviceConfigTags').pushObject(this.createSiteObj(type, isNonXmlFile, tag));
+            var obj = this.createSiteObj(type, isNonXmlFile, tag);
+            obj.service_config_version_note = serviceVersionNotes;
+            this.get('serviceConfigTags').pushObject(obj);
           }
         }
       }, this);
@@ -1465,7 +1472,8 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, {
             type: _serviceConfig.type,
             tag: _serviceConfig.tag,
             properties: _serviceConfig.properties,
-            properties_attributes: _serviceConfig.properties_attributes
+            properties_attributes: _serviceConfig.properties_attributes,
+            service_config_version_note: _serviceConfig.service_config_version_note
           }
         }
       });

http://git-wip-us.apache.org/repos/asf/ambari/blob/869b00c6/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 11c2015..4c9abd9 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1409,7 +1409,9 @@ Em.I18n.translations = {
     '<b>ambari-server setup --jdbc-db={0} --jdbc-driver=/path/to/{1}/driver.jar</b> ' +
     'on the Ambari Server host to make the JDBC driver available and to enable testing the database connection.',
 
-  'services.service.config.configHistory.configGroup': 'Group',
+  'services.service.config.configHistory.configGroup': 'Config Group',
+  'services.service.config.configHistory.leftArrow.tooltip': 'Show earlier versions',
+  'services.service.config.configHistory.rightArrow.tooltip': 'Show later versions',
   'services.service.config.configHistory.makeCurrent.message': 'Created from service config version {0}',
 
   'services.add.header':'Add Service Wizard',
@@ -1992,6 +1994,7 @@ Em.I18n.translations = {
   'dashboard.configHistory.table.configGroup.title' : 'Config Group',
   'dashboard.configHistory.table.created.title' : 'Created',
   'dashboard.configHistory.table.empty' : 'No history to display',
+  'dashboard.configHistory.table.notes.default': 'Initial configurations for {0}',
   'dashboard.configHistory.table.version.versionText' : 'V{0}',
   'dashboard.configHistory.table.version.prefix' : 'V',
   'dashboard.configHistory.table.current.tooltip' : 'Current config for {0}:{1}',
@@ -2003,12 +2006,13 @@ Em.I18n.translations = {
   'dashboard.configHistory.info-bar.save.popup.title': 'Save Configuration',
   'dashboard.configHistory.info-bar.makeCurrent.popup.title': 'Make Current Confirmation',
   'dashboard.configHistory.info-bar.save.popup.placeholder': 'What did you change?',
-  'dashboard.configHistory.info-bar.revert.button': 'Make current',
+  'dashboard.configHistory.info-bar.revert.button': 'Make Current',
   'dashboard.configHistory.info-bar.view.button.disabled': 'You are currently viewing this version.',
   'dashboard.configHistory.info-bar.compare.button.disabled': 'You cannot compare against the same version.',
   'dashboard.configHistory.info-bar.revert.button.disabled': 'This is the current version.',
 
 
+
   'timeRange.presets.1hour':'1h',
   'timeRange.presets.12hour':'12h',
   'timeRange.presets.1day':'1d',

http://git-wip-us.apache.org/repos/asf/ambari/blob/869b00c6/ambari-web/app/styles/application.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less
index a5843eb..37716c0 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -4973,19 +4973,20 @@ ul.inline li {
         height: 90%;
       }
       .version-box .box {
-        //position: relative;
         cursor: pointer;
         width: 72%;
         height: 100%;
         background-color: #ffffff;
         border: 1px solid #dddddd;
-        font-size: @default-font-size;
+        font-size: 13px;
         .top-label {
           min-width: 20px;
           padding: 5px;
+          padding-bottom: 1px;
         }
         .content {
           padding: 0 5px;
+          line-height: 19px;
           text-align: center;
           color: #555555;
         }
@@ -4997,7 +4998,7 @@ ul.inline li {
         left: -45px;
         z-index: 1000;
         float: left;
-        min-width: 290px;
+        min-width: 300px;
         padding: 8px;
         list-style: none;
         background-color: #ffffff;
@@ -5053,18 +5054,20 @@ ul.inline li {
       }
     }
     .first {
+      width: 13%;
+      margin-left: 15px;
       .arrow-box {
         display: none;
       }
       .version-box .box {
         width: 100%;
       }
-      width: 13%;
     }
 
     .icon-chevron-box {
       margin-top: 25px;
       width: 5%;
+      cursor: pointer;
       .icon-chevron-right,
       .icon-chevron-left{
        color: #c3c3c3;

http://git-wip-us.apache.org/repos/asf/ambari/blob/869b00c6/ambari-web/app/templates/common/configs/config_history_flow.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/config_history_flow.hbs b/ambari-web/app/templates/common/configs/config_history_flow.hbs
index 5dabe52..d52a8cc 100644
--- a/ambari-web/app/templates/common/configs/config_history_flow.hbs
+++ b/ambari-web/app/templates/common/configs/config_history_flow.hbs
@@ -19,7 +19,8 @@
 
 <div id="config_history_flow" {{bindAttr class="view.showCompareVersionBar:two-stories-bar:one-story-bar"}}>
   <div class="version-slider">
-    <div {{bindAttr class=":icon-chevron-box :pull-left view.showLeftArrow::hide"}} {{action shiftBack target="view"}}><i class="icon-chevron-left icon-3x"></i></div>
+    <div {{bindAttr class=":icon-chevron-box :pull-left view.showLeftArrow::hide"}} {{action shiftBack target="view"}} data-toggle="arrow-tooltip"
+      {{translateAttr data-original-title="services.service.config.configHistory.leftArrow.tooltip"}}><i class="icon-chevron-left icon-3x"></i></div>
     {{#each serviceVersion in view.visibleServiceVersion}}
       <div {{bindAttr class=":flow-element :pull-left serviceVersion.first:first"}}>
         <div class="arrow-box pull-left"><i class="icon-arrow-right icon-3x"></i></div>
@@ -35,7 +36,7 @@
               {{/if}}
             </div>
               <div class="content">{{serviceVersion.author}}</div>
-              <div class="content">{{serviceVersion.shortModifiedDate}}</div>
+              <div class="content">{{serviceVersion.modifiedDate}}</div>
           </div>
 
           <div class="version-popover">
@@ -52,7 +53,8 @@
         </div>
       </div>
     {{/each}}
-    <div {{bindAttr class=":icon-chevron-box :pull-right view.showRightArrow::hide"}} {{action shiftForward target="view"}}><i class="icon-chevron-right icon-3x"></i></div>
+    <div {{bindAttr class=":icon-chevron-box :pull-right view.showRightArrow::hide"}} {{action shiftForward target="view"}} data-toggle="arrow-tooltip"
+      {{translateAttr data-original-title="services.service.config.configHistory.rightArrow.tooltip"}}><i class="icon-chevron-right icon-3x"></i></div>
   </div>
   <div class="version-info-bar-wrapper">
       <div {{bindAttr class="view.showCompareVersionBar::hidden :version-info-bar"}}>

http://git-wip-us.apache.org/repos/asf/ambari/blob/869b00c6/ambari-web/app/views/common/configs/config_history_flow.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/config_history_flow.js b/ambari-web/app/views/common/configs/config_history_flow.js
index fc054c8..e9fab25 100644
--- a/ambari-web/app/views/common/configs/config_history_flow.js
+++ b/ambari-web/app/views/common/configs/config_history_flow.js
@@ -139,6 +139,9 @@ App.ConfigHistoryFlowView = Em.View.extend({
     App.tooltip(this.$('[data-toggle=tooltip]'),{
       placement: 'bottom'
     });
+    App.tooltip(this.$('[data-toggle=arrow-tooltip]'),{
+      placement: 'top'
+    });
   },
 
   willInsertElement: function () {


[30/45] git commit: AMBARI-6967. Admin View: default login behavior (route to Admin View, Cluster Dashboard, or Views Landing page). (yusaku)

Posted by jo...@apache.org.
AMBARI-6967. Admin View: default login behavior (route to Admin View, Cluster Dashboard, or Views Landing page). (yusaku)


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

Branch: refs/heads/branch-alerts-dev
Commit: cd0081c55f53f87076c191f21648f9f6477119e7
Parents: af67390
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Wed Aug 27 23:59:35 2014 -0700
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Wed Aug 27 23:59:35 2014 -0700

----------------------------------------------------------------------
 .../controllers/global/cluster_controller.js    | 44 --------------------
 1 file changed, 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/cd0081c5/ambari-web/app/controllers/global/cluster_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/cluster_controller.js b/ambari-web/app/controllers/global/cluster_controller.js
index 246ad8b..bc09b0a 100644
--- a/ambari-web/app/controllers/global/cluster_controller.js
+++ b/ambari-web/app/controllers/global/cluster_controller.js
@@ -347,50 +347,6 @@ App.ClusterController = Em.Controller.extend({
     }, callback)
   },
 
-  loadAmbariViews: function () {
-    App.ajax.send({
-      name: 'views.info',
-      sender: this,
-      success: 'loadAmbariViewsSuccess'
-    });
-  },
-
-  loadAmbariViewsSuccess: function (data) {
-    if (data.items.length) {
-      App.ajax.send({
-        name: 'views.instances',
-        sender: this,
-        success: 'loadViewInstancesSuccess'
-      });
-    } else {
-      this.set('ambariViews', []);
-    }
-  },
-
-  loadViewInstancesSuccess: function (data) {
-    this.set('ambariViews', []);
-    var self = this;
-    data.items.forEach(function (view) {
-      view.versions.forEach(function (version) {
-        version.instances.forEach(function (instance) {
-          var current_instance = Em.Object.create({
-            iconPath: instance.ViewInstanceInfo.icon_path || "/img/ambari-view-default.png",
-            label: instance.ViewInstanceInfo.label || version.ViewVersionInfo.label || instance.ViewInstanceInfo.view_name,
-            visible: instance.ViewInstanceInfo.visible || false,
-            version: instance.ViewInstanceInfo.version,
-            description: instance.ViewInstanceInfo.description || Em.I18n.t('views.main.instance.noDescription'),
-            viewName: instance.ViewInstanceInfo.view_name,
-            instanceName: instance.ViewInstanceInfo.instance_name,
-            href: instance.ViewInstanceInfo.context_path
-          });
-          if( current_instance.visible){
-            self.get('ambariViews').pushObject(current_instance);
-          }
-        }, this);
-      }, this);
-    }, this);
-  },
-
   /**
    *
    * @param callback


[15/45] git commit: AMBARI-7048. Change component message from "cannot" to "should not"

Posted by jo...@apache.org.
AMBARI-7048. Change component message from "cannot" to "should not"


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

Branch: refs/heads/branch-alerts-dev
Commit: f23e09de6c9aad0523c3fa77e2eaf7bfda72a5cc
Parents: 966fff4
Author: Srimanth Gunturi <sg...@hortonworks.com>
Authored: Wed Aug 27 14:38:06 2014 -0700
Committer: Srimanth Gunturi <sg...@hortonworks.com>
Committed: Wed Aug 27 14:38:06 2014 -0700

----------------------------------------------------------------------
 .../main/resources/stacks/HDP/1.3.2/services/stack_advisor.py    | 4 ++--
 .../main/resources/stacks/HDP/2.0.6/services/stack_advisor.py    | 4 ++--
 .../src/test/python/stacks/2.0.6/common/test_stack_advisor.py    | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f23e09de/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/stack_advisor.py
index f3c1e1d..17a26e2 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/stack_advisor.py
@@ -192,8 +192,8 @@ class HDP132StackAdvisor(StackAdvisor):
       secondaryNameNodeHosts = secondaryNameNodeHosts[0]
       commonHosts = list(set(nameNodeHosts).intersection(secondaryNameNodeHosts))
       for host in commonHosts:
-        items.append( { "type": 'host-component', "level": 'WARN', "message": 'NameNode and Secondary NameNode cannot be hosted on same machine', "component-name": 'NAMENODE', "host": str(host) } )
-        items.append( { "type": 'host-component', "level": 'WARN', "message": 'NameNode and Secondary NameNode cannot be hosted on same machine', "component-name": 'SECONDARY_NAMENODE', "host": str(host) } )
+        items.append( { "type": 'host-component', "level": 'WARN', "message": 'NameNode and Secondary NameNode should not be hosted on same machine', "component-name": 'NAMENODE', "host": str(host) } )
+        items.append( { "type": 'host-component', "level": 'WARN', "message": 'NameNode and Secondary NameNode should not be hosted on same machine', "component-name": 'SECONDARY_NAMENODE', "host": str(host) } )
 
     # Validating cardinality
     for component in componentsList:

http://git-wip-us.apache.org/repos/asf/ambari/blob/f23e09de/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
index 083286e..4eb8f02 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
@@ -192,8 +192,8 @@ class HDP206StackAdvisor(StackAdvisor):
       secondaryNameNodeHosts = secondaryNameNodeHosts[0]
       commonHosts = list(set(nameNodeHosts).intersection(secondaryNameNodeHosts))
       for host in commonHosts:
-        items.append( { "type": 'host-component', "level": 'WARN', "message": 'NameNode and Secondary NameNode cannot be hosted on same machine', "component-name": 'NAMENODE', "host": str(host) } )
-        items.append( { "type": 'host-component', "level": 'WARN', "message": 'NameNode and Secondary NameNode cannot be hosted on same machine', "component-name": 'SECONDARY_NAMENODE', "host": str(host) } )
+        items.append( { "type": 'host-component', "level": 'WARN', "message": 'NameNode and Secondary NameNode should not be hosted on same machine', "component-name": 'NAMENODE', "host": str(host) } )
+        items.append( { "type": 'host-component', "level": 'WARN', "message": 'NameNode and Secondary NameNode should not be hosted on same machine', "component-name": 'SECONDARY_NAMENODE', "host": str(host) } )
 
     # Validating cardinality
     for component in componentsList:

http://git-wip-us.apache.org/repos/asf/ambari/blob/f23e09de/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
index 898797a..b1b9f7a 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
@@ -99,8 +99,8 @@ class TestHDP206StackAdvisor(TestCase):
     result = self.stackAdvisor.validateComponentLayout(services, hosts)
 
     expectedItems = [
-      {"message": "NameNode and Secondary NameNode cannot be hosted on same machine", "level": "WARN", "host": "host1"},
-      {"message": "NameNode and Secondary NameNode cannot be hosted on same machine", "level": "WARN", "host": "host1"},
+      {"message": "NameNode and Secondary NameNode should not be hosted on same machine", "level": "WARN", "host": "host1"},
+      {"message": "NameNode and Secondary NameNode should not be hosted on same machine", "level": "WARN", "host": "host1"},
       {"message": "Host is not used", "level": "ERROR", "host": "host2"}
     ]
     self.assertValidationResult(expectedItems, result)


[29/45] git commit: Revert "AMBARI-6967. Admin View: default login behavior (route to Admin View, Cluster Dashboard, or Views Landing page). (yusaku)"

Posted by jo...@apache.org.
Revert "AMBARI-6967. Admin View: default login behavior (route to Admin View, Cluster Dashboard, or Views Landing page). (yusaku)"

This reverts commit e1634809f0c4c6a6acfe1b2672b4ddfcaf2d5e92.


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

Branch: refs/heads/branch-alerts-dev
Commit: af67390b9ca47bd6b34a54638c9f5cc8323017fd
Parents: e163480
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Wed Aug 27 23:56:32 2014 -0700
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Wed Aug 27 23:56:32 2014 -0700

----------------------------------------------------------------------
 .../controllers/global/cluster_controller.js    | 44 ++++++++++++++++++++
 1 file changed, 44 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/af67390b/ambari-web/app/controllers/global/cluster_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/cluster_controller.js b/ambari-web/app/controllers/global/cluster_controller.js
index bc09b0a..246ad8b 100644
--- a/ambari-web/app/controllers/global/cluster_controller.js
+++ b/ambari-web/app/controllers/global/cluster_controller.js
@@ -347,6 +347,50 @@ App.ClusterController = Em.Controller.extend({
     }, callback)
   },
 
+  loadAmbariViews: function () {
+    App.ajax.send({
+      name: 'views.info',
+      sender: this,
+      success: 'loadAmbariViewsSuccess'
+    });
+  },
+
+  loadAmbariViewsSuccess: function (data) {
+    if (data.items.length) {
+      App.ajax.send({
+        name: 'views.instances',
+        sender: this,
+        success: 'loadViewInstancesSuccess'
+      });
+    } else {
+      this.set('ambariViews', []);
+    }
+  },
+
+  loadViewInstancesSuccess: function (data) {
+    this.set('ambariViews', []);
+    var self = this;
+    data.items.forEach(function (view) {
+      view.versions.forEach(function (version) {
+        version.instances.forEach(function (instance) {
+          var current_instance = Em.Object.create({
+            iconPath: instance.ViewInstanceInfo.icon_path || "/img/ambari-view-default.png",
+            label: instance.ViewInstanceInfo.label || version.ViewVersionInfo.label || instance.ViewInstanceInfo.view_name,
+            visible: instance.ViewInstanceInfo.visible || false,
+            version: instance.ViewInstanceInfo.version,
+            description: instance.ViewInstanceInfo.description || Em.I18n.t('views.main.instance.noDescription'),
+            viewName: instance.ViewInstanceInfo.view_name,
+            instanceName: instance.ViewInstanceInfo.instance_name,
+            href: instance.ViewInstanceInfo.context_path
+          });
+          if( current_instance.visible){
+            self.get('ambariViews').pushObject(current_instance);
+          }
+        }, this);
+      }, this);
+    }, this);
+  },
+
   /**
    *
    * @param callback


[10/45] git commit: AMBARI-7026. Config History: FE change to integrate new name 'service_config_version' in api.(XIWANG)

Posted by jo...@apache.org.
AMBARI-7026. Config History: FE change to integrate new name 'service_config_version' in api.(XIWANG)


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

Branch: refs/heads/branch-alerts-dev
Commit: b267bd82817ede48b73c98274f0c4d19ee2a90a4
Parents: e20f15b
Author: Xi Wang <xi...@apache.org>
Authored: Tue Aug 26 15:32:02 2014 -0700
Committer: Xi Wang <xi...@apache.org>
Committed: Wed Aug 27 11:10:16 2014 -0700

----------------------------------------------------------------------
 .../controllers/main/dashboard/config_history_controller.js  | 6 +++---
 ambari-web/app/controllers/main/service/info/configs.js      | 6 +++---
 ambari-web/app/mappers/service_config_version_mapper.js      | 2 +-
 ambari-web/app/utils/ajax/ajax.js                            | 8 ++++----
 ambari-web/app/views/common/configs/config_history_flow.js   | 4 ++--
 5 files changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b267bd82/ambari-web/app/controllers/main/dashboard/config_history_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/dashboard/config_history_controller.js b/ambari-web/app/controllers/main/dashboard/config_history_controller.js
index 002504a..d8a4722 100644
--- a/ambari-web/app/controllers/main/dashboard/config_history_controller.js
+++ b/ambari-web/app/controllers/main/dashboard/config_history_controller.js
@@ -31,7 +31,7 @@ App.MainConfigHistoryController = Em.ArrayController.extend(App.TableServerMixin
   filteredCount: 0,
   mockUrl: '/data/configurations/service_versions.json',
   realUrl: function () {
-    return App.apiPrefix + '/clusters/' + App.get('clusterName') + '/configurations/serviceconfigversions?<parameters>fields=serviceconfigversion,user,group_id,group_name,createtime,service_name,service_config_version_note&minimal_response=true';
+    return App.apiPrefix + '/clusters/' + App.get('clusterName') + '/configurations/service_config_versions?<parameters>fields=service_config_version,user,group_id,group_name,createtime,service_name,service_config_version_note&minimal_response=true';
   }.property('App.clusterName'),
 
   /**
@@ -193,8 +193,8 @@ App.MainConfigHistoryController = Em.ArrayController.extend(App.TableServerMixin
   loadCurrentVersionsSuccess: function (data, opt, params) {
     var currentConfigVersions = {};
 
-    for (var service in data.Clusters.desired_serviceconfigversions) {
-      currentConfigVersions[service + '_' + data.Clusters.desired_serviceconfigversions[service].serviceconfigversion] = true;
+    for (var service in data.Clusters.desired_service_config_versions) {
+      currentConfigVersions[service + '_' + data.Clusters.desired_service_config_versions[service][0].service_config_version] = true;
     }
     App.cache['currentConfigVersions'] = currentConfigVersions;
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/b267bd82/ambari-web/app/controllers/main/service/info/configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/configs.js b/ambari-web/app/controllers/main/service/info/configs.js
index 8eee9cb..ab7afeb 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -296,10 +296,10 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM
   loadCurrentVersionsSuccess: function (data, opt, params) {
     var currentConfigVersions = {};
     var self = this;
-    for (var service in data.Clusters.desired_serviceconfigversions) {
-      currentConfigVersions[service + '_' + data.Clusters.desired_serviceconfigversions[service].serviceconfigversion] = true;
+    for (var service in data.Clusters.desired_service_config_versions) {
+      currentConfigVersions[service + '_' + data.Clusters.desired_service_config_versions[service][0].service_config_version] = true;
       if (self.get('content.serviceName') == service) {
-        self.set('currentVersion', data.Clusters.desired_serviceconfigversions[service].serviceconfigversion);
+        self.set('currentVersion', data.Clusters.desired_service_config_versions[service][0].service_config_version);
       }
     }
     App.cache['currentConfigVersions'] = currentConfigVersions;

http://git-wip-us.apache.org/repos/asf/ambari/blob/b267bd82/ambari-web/app/mappers/service_config_version_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/service_config_version_mapper.js b/ambari-web/app/mappers/service_config_version_mapper.js
index 25d5aba..f3cca6c 100644
--- a/ambari-web/app/mappers/service_config_version_mapper.js
+++ b/ambari-web/app/mappers/service_config_version_mapper.js
@@ -23,7 +23,7 @@ App.serviceConfigVersionsMapper = App.QuickDataMapper.create({
   config: {
     service_name: 'service_name',
     service_id: 'service_name',
-    version: "serviceconfigversion",
+    version: "service_config_version",
     create_time: 'createtime',
     group_id: 'group_id',
     group_name: 'group_name',

http://git-wip-us.apache.org/repos/asf/ambari/blob/b267bd82/ambari-web/app/utils/ajax/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js
index 3140595..7d0c23c 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -1894,19 +1894,19 @@ var urls = {
     }
   },
   'service.serviceConfigVersions.get': {
-    real: '/clusters/{clusterName}/configurations/serviceconfigversions?service_name={serviceName}&fields=serviceconfigversion,user,group_id,group_name,createtime,service_name,service_config_version_note&minimal_response=true',
+    real: '/clusters/{clusterName}/configurations/service_config_versions?service_name={serviceName}&fields=service_config_version,user,group_id,group_name,createtime,service_name,service_config_version_note&minimal_response=true',
     mock: '/data/configurations/service_versions.json'
   },
   'service.serviceConfigVersions.get.current': {
-    real: '/clusters/{clusterName}?fields=Clusters/desired_serviceconfigversions&minimal_response=true',
+    real: '/clusters/{clusterName}?fields=Clusters/desired_service_config_versions&minimal_response=true',
     mock: ''
   },
   'service.serviceConfigVersions.get.total': {
-    real: '/clusters/{clusterName}/configurations/serviceconfigversions?page_size=1&minimal_response=true',
+    real: '/clusters/{clusterName}/configurations/service_config_versions?page_size=1&minimal_response=true',
     mock: ''
   },
   'service.serviceConfigVersion.get': {
-    real: '/clusters/{clusterName}/configurations/serviceconfigversions?service_name={serviceName}&serviceconfigversion={serviceConfigVersion}',
+    real: '/clusters/{clusterName}/configurations/service_config_versions?service_name={serviceName}&service_config_version={serviceConfigVersion}',
     mock: '/data/configurations/service_version.json'
   },
   'service.serviceConfigVersion.revert': {

http://git-wip-us.apache.org/repos/asf/ambari/blob/b267bd82/ambari-web/app/views/common/configs/config_history_flow.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/config_history_flow.js b/ambari-web/app/views/common/configs/config_history_flow.js
index 0c0e686..280c674 100644
--- a/ambari-web/app/views/common/configs/config_history_flow.js
+++ b/ambari-web/app/views/common/configs/config_history_flow.js
@@ -285,8 +285,8 @@ App.ConfigHistoryFlowView = Em.View.extend({
       data: {
         data: {
           "Clusters": {
-            "desired_serviceconfigversions": {
-              "serviceconfigversion": serviceConfigVersion.get('version'),
+            "desired_service_config_versions": {
+              "service_config_version": serviceConfigVersion.get('version'),
               "service_name": serviceConfigVersion.get('serviceName'),
               "service_config_version_note": serviceConfigVersion.get('serviceConfigNote')
             }


[27/45] git commit: AMBARI-7048. Change component message from "cannot" to "should not"

Posted by jo...@apache.org.
AMBARI-7048. Change component message from "cannot" to "should not"


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

Branch: refs/heads/branch-alerts-dev
Commit: 2051c64e7eec7e5d941cf48d911cf2bbc515db7b
Parents: 94ca14a
Author: Srimanth Gunturi <sg...@hortonworks.com>
Authored: Wed Aug 27 14:38:06 2014 -0700
Committer: Srimanth Gunturi <sg...@hortonworks.com>
Committed: Wed Aug 27 18:41:44 2014 -0700

----------------------------------------------------------------------
 .../main/resources/stacks/HDP/1.3.2/services/stack_advisor.py    | 4 ++--
 .../main/resources/stacks/HDP/2.0.6/services/stack_advisor.py    | 4 ++--
 .../src/test/python/stacks/2.0.6/common/test_stack_advisor.py    | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2051c64e/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/stack_advisor.py
index f3c1e1d..17a26e2 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/stack_advisor.py
@@ -192,8 +192,8 @@ class HDP132StackAdvisor(StackAdvisor):
       secondaryNameNodeHosts = secondaryNameNodeHosts[0]
       commonHosts = list(set(nameNodeHosts).intersection(secondaryNameNodeHosts))
       for host in commonHosts:
-        items.append( { "type": 'host-component', "level": 'WARN', "message": 'NameNode and Secondary NameNode cannot be hosted on same machine', "component-name": 'NAMENODE', "host": str(host) } )
-        items.append( { "type": 'host-component', "level": 'WARN', "message": 'NameNode and Secondary NameNode cannot be hosted on same machine', "component-name": 'SECONDARY_NAMENODE', "host": str(host) } )
+        items.append( { "type": 'host-component', "level": 'WARN', "message": 'NameNode and Secondary NameNode should not be hosted on same machine', "component-name": 'NAMENODE', "host": str(host) } )
+        items.append( { "type": 'host-component', "level": 'WARN', "message": 'NameNode and Secondary NameNode should not be hosted on same machine', "component-name": 'SECONDARY_NAMENODE', "host": str(host) } )
 
     # Validating cardinality
     for component in componentsList:

http://git-wip-us.apache.org/repos/asf/ambari/blob/2051c64e/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
index 083286e..4eb8f02 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
@@ -192,8 +192,8 @@ class HDP206StackAdvisor(StackAdvisor):
       secondaryNameNodeHosts = secondaryNameNodeHosts[0]
       commonHosts = list(set(nameNodeHosts).intersection(secondaryNameNodeHosts))
       for host in commonHosts:
-        items.append( { "type": 'host-component', "level": 'WARN', "message": 'NameNode and Secondary NameNode cannot be hosted on same machine', "component-name": 'NAMENODE', "host": str(host) } )
-        items.append( { "type": 'host-component', "level": 'WARN', "message": 'NameNode and Secondary NameNode cannot be hosted on same machine', "component-name": 'SECONDARY_NAMENODE', "host": str(host) } )
+        items.append( { "type": 'host-component', "level": 'WARN', "message": 'NameNode and Secondary NameNode should not be hosted on same machine', "component-name": 'NAMENODE', "host": str(host) } )
+        items.append( { "type": 'host-component', "level": 'WARN', "message": 'NameNode and Secondary NameNode should not be hosted on same machine', "component-name": 'SECONDARY_NAMENODE', "host": str(host) } )
 
     # Validating cardinality
     for component in componentsList:

http://git-wip-us.apache.org/repos/asf/ambari/blob/2051c64e/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
index 898797a..b1b9f7a 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
@@ -99,8 +99,8 @@ class TestHDP206StackAdvisor(TestCase):
     result = self.stackAdvisor.validateComponentLayout(services, hosts)
 
     expectedItems = [
-      {"message": "NameNode and Secondary NameNode cannot be hosted on same machine", "level": "WARN", "host": "host1"},
-      {"message": "NameNode and Secondary NameNode cannot be hosted on same machine", "level": "WARN", "host": "host1"},
+      {"message": "NameNode and Secondary NameNode should not be hosted on same machine", "level": "WARN", "host": "host1"},
+      {"message": "NameNode and Secondary NameNode should not be hosted on same machine", "level": "WARN", "host": "host1"},
       {"message": "Host is not used", "level": "ERROR", "host": "host2"}
     ]
     self.assertValidationResult(expectedItems, result)


[32/45] git commit: AMBARI-7053 Config History: Compare UI tweaks. (atkach)

Posted by jo...@apache.org.
AMBARI-7053 Config History: Compare UI tweaks. (atkach)


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

Branch: refs/heads/branch-alerts-dev
Commit: 6bcd6d55c980f13e56ae9ddc8d4ab15371893d98
Parents: b35b87d
Author: atkach <at...@hortonworks.com>
Authored: Thu Aug 28 14:17:32 2014 +0300
Committer: atkach <at...@hortonworks.com>
Committed: Thu Aug 28 14:17:32 2014 +0300

----------------------------------------------------------------------
 .../controllers/main/service/info/configs.js    |   7 +
 ambari-web/app/messages.js                      |   1 +
 ambari-web/app/styles/application.less          |  14 +-
 .../common/configs/compare_property.hbs         |   8 ++
 .../common/configs/config_history_flow.hbs      | 128 +++++++++++--------
 .../common/configs/service_config_category.hbs  |  30 +++--
 .../views/common/configs/config_history_flow.js |   9 +-
 7 files changed, 131 insertions(+), 66 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6bcd6d55/ambari-web/app/controllers/main/service/info/configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/configs.js b/ambari-web/app/controllers/main/service/info/configs.js
index 78c9b53..22e3aac 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -572,6 +572,11 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM
           allConfigs.push(this.getMockConfig(prop, serviceName, App.config.getOriginalFileName(configuration.type)));
         }
       }
+      if (configuration.properties_attributes && configuration.properties_attributes.final) {
+        for (var final in configuration.properties_attributes.final) {
+          serviceVersionMap[final].isFinal = (configuration.properties_attributes.final[final] === 'true');
+        }
+      }
     }, this);
 
     allConfigs.forEach(function (serviceConfig) {
@@ -587,6 +592,8 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM
           compareObject.isMock = false;
         }
         serviceConfig.compareConfig = App.ServiceConfigProperty.create(compareObject);
+        this.setSupportsFinal(serviceConfig.compareConfig);
+        serviceConfig.compareConfig.set('isFinal', compareConfig.isFinal);
         serviceConfig.compareConfig.set('value', App.config.formatOverrideValue(serviceConfig, compareConfig.value));
         serviceConfig.isComparison = true;
       } else if (serviceConfig.isUserProperty) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bcd6d55/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 9579b04..36bfa10 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1993,6 +1993,7 @@ Em.I18n.translations = {
   'dashboard.configHistory.table.created.title' : 'Created',
   'dashboard.configHistory.table.empty' : 'No history to display',
   'dashboard.configHistory.table.version.versionText' : 'V{0}',
+  'dashboard.configHistory.table.version.prefix' : 'V',
   'dashboard.configHistory.table.current.tooltip' : 'Current config for {0}:{1}',
   'dashboard.configHistory.table.restart.tooltip' : 'Restart required',
   'dashboard.configHistory.table.filteredHostsInfo': '{0} of {1} versions showing',

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bcd6d55/ambari-web/app/styles/application.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less
index dd0adb9..0570220 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -4953,8 +4953,14 @@ ul.inline li {
   }
 }
 
-#config_history_flow {
+.one-story-bar {
   margin-bottom: 80px;
+}
+.two-stories-bar {
+  margin-bottom: 120px;
+}
+
+#config_history_flow {
   .version-slider {
     width: 100%;
     height: 100px;
@@ -5069,6 +5075,10 @@ ul.inline li {
       }
     }
   }
+  .version-info-bar-wrapper {
+    position: fixed;
+    z-index: 2;
+  }
   .version-info-bar {
     background-image: -moz-linear-gradient(top, @top-nav-bg-color-from, @top-nav-bg-color-to);
     background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@top-nav-bg-color-from), to(@top-nav-bg-color-to));
@@ -5081,8 +5091,6 @@ ul.inline li {
     box-shadow: inset 0 0 0 rgba(0, 0, 0, 0.1), 0 1px 10px rgba(0, 0, 0, 0.1);
     margin: 5px 0;
     padding: 5px;
-    position: fixed;
-    z-index: 2;
     width: 747px;
 
     .label-wrapper {

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bcd6d55/ambari-web/app/templates/common/configs/compare_property.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/compare_property.hbs b/ambari-web/app/templates/common/configs/compare_property.hbs
index f2b2a45..2d0137f 100644
--- a/ambari-web/app/templates/common/configs/compare_property.hbs
+++ b/ambari-web/app/templates/common/configs/compare_property.hbs
@@ -20,5 +20,13 @@
   {{view view.serviceConfigProperty.compareConfig.viewClass serviceConfigBinding="view.serviceConfigProperty.compareConfig"}}
   {{#unless view.serviceConfigProperty.compareConfig.isMock}}
     <span class="label label-info">{{view.serviceConfigProperty.compareConfig.serviceVersion.versionText}}</span>
+    {{#if view.serviceConfigProperty.compareConfig.serviceVersion.isCurrent}}
+        <span class="label label-success">{{t common.current}}</span>
+    {{/if}}
+    {{#if view.serviceConfigProperty.compareConfig.supportsFinal}}
+        <a disabled="disabled" {{bindAttr class=":btn :btn-small :btn-final view.serviceConfigProperty.compareConfig.isFinal:active" }}>
+            <i class="icon-lock"></i>
+        </a>
+    {{/if}}
   {{/unless}}
 </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bcd6d55/ambari-web/app/templates/common/configs/config_history_flow.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/config_history_flow.hbs b/ambari-web/app/templates/common/configs/config_history_flow.hbs
index 8fe54c8..55e622f 100644
--- a/ambari-web/app/templates/common/configs/config_history_flow.hbs
+++ b/ambari-web/app/templates/common/configs/config_history_flow.hbs
@@ -17,7 +17,7 @@
 }}
 
 
-<div id="config_history_flow">
+<div id="config_history_flow" {{bindAttr class="view.showCompareVersionBar:two-stories-bar:one-story-bar"}}>
   <div class="version-slider">
     <div {{bindAttr class=":icon-chevron-box :pull-left view.showLeftArrow::hide"}} {{action shiftBack target="view"}}><i class="icon-chevron-left icon-3x"></i></div>
     {{#each serviceVersion in view.visibleServiceVersion}}
@@ -54,59 +54,83 @@
     {{/each}}
     <div {{bindAttr class=":icon-chevron-box :pull-right view.showRightArrow::hide"}} {{action shiftForward target="view"}}><i class="icon-chevron-right icon-3x"></i></div>
   </div>
-  <div class="version-info-bar">
-    <div class="row-fluid">
-      <div class="btn-group pull-left">
-        <button class="btn dropdown-toggle" data-toggle="dropdown" href="#" {{action hideFullList target="view"}} {{bindAttr disabled="view.versionActionsDisabled"}}>
-          <i class="icon-random"></i>
-          <span class="caret"></span>
-        </button>
-        <ul class="dropdown-menu">
-          {{#each serviceVersion in view.dropDownList}}
-            <li class="pointer dropdown-submenu">
-              <div class="row-fluid" {{action switchVersion serviceVersion target="view"}}>
-                <div class="span2">{{serviceVersion.versionText}}</div>
-                <div class="span6">{{serviceVersion.modifiedDate}}</div>
-                <div class="span3">{{serviceVersion.author}}</div>
-                <div class="pull-right"><i class="icon-caret-right"></i></div>
+  <div class="version-info-bar-wrapper">
+      <div {{bindAttr class="view.showCompareVersionBar::hidden :version-info-bar"}}>
+          <div class="row-fluid">
+              <div class="span1">
               </div>
-              <ul class="dropdown-menu">
-                <div class="content"> <strong>{{serviceVersion.serviceName}}</strong> <span class="label label-info">{{serviceVersion.versionText}}</span> &nbsp;
-                    <strong>{{t services.service.config.configHistory.configGroup}}:{{serviceVersion.configGroupName}}</strong>
-                    <div class="notes">{{serviceVersion.briefNotes}}</div>
-                </div>
-                <div>
-                  <button class="btn" {{action switchVersion serviceVersion target="view"}}><i class="icon-search"></i>&nbsp;{{t common.view}}</button>
-                  <button class="btn" {{bindAttr disabled="serviceVersion.isDisabled"}} {{action compare serviceVersion target="view"}}><i class="icon-copy"></i>&nbsp;{{t common.compare}}</button>
-                  <button class="btn" {{bindAttr disabled="serviceVersion.isDisabled"}} {{action revert serviceVersion target="view"}}>{{t dashboard.configHistory.info-bar.revert.button}}</button>
-                </div>
-              </ul>
-            </li>
-          {{/each}}
-          {{#unless view.showFullList}}
-            <li class="align-center pointer" id="show_more">
-              <a {{action openFullList target="view"}}>
-                {{t dashboard.configHistory.info-bar.showMore}}&nbsp;{{view.serviceName}}
-                  &nbsp;<span class="lowercase ellipsis">{{t dashboard.configHistory.title}}</span>
-              </a>
-            </li>
-          {{/unless}}
-        </ul>
+              <div class="label-wrapper span9"
+                   data-toggle="tooltip" {{bindAttr data-original-title="view.compareServiceVersion.briefNotes"}}>
+                  <span class="label label-info">{{view.compareServiceVersion.versionText}}</span>
+                {{#if view.compareServiceVersion.isCurrent}}
+                    <span class="label label-success">{{t common.current}}</span>
+                {{/if}}
+                  <strong>{{view.compareServiceVersion.author}}</strong>&nbsp;{{t dashboard.configHistory.info-bar.authoredOn}}
+                  &nbsp;<strong>{{view.compareServiceVersion.modifiedDate}}</strong>
+              </div>
+              <div class="pull-right">
+                  <div {{bindAttr class="view.compareServiceVersion.isCurrent::hidden"}}>
+                      <button class="btn" {{action doCancel target="controller"}} {{bindAttr disabled="view.versionActionsDisabled"}}>{{t common.cancel}}</button>
+                      <button class="btn btn-success" {{action save target="view"}} {{bindAttr disabled="view.isSaveDisabled"}}>{{t common.save}}</button>
+                  </div>
+                  <button class="btn btn-success"  {{action revert target="view"}} {{bindAttr disabled="view.versionActionsDisabled" class="view.compareServiceVersion.isCurrent:hidden"}}>{{t dashboard.configHistory.info-bar.revert.button}}</button>
+              </div>
+          </div>
       </div>
-        <div class="label-wrapper span9" data-toggle="tooltip" {{bindAttr data-original-title="view.displayedServiceVersion.briefNotes"}}>
-          <span class="label label-info">{{view.displayedServiceVersion.versionText}}</span>
-          {{#if view.displayedServiceVersion.isCurrent}}
-            <span class="label label-success">{{t common.current}}</span>
-          {{/if}}
-          <strong>{{view.displayedServiceVersion.author}}</strong>&nbsp;{{t dashboard.configHistory.info-bar.authoredOn}}&nbsp;<strong>{{view.displayedServiceVersion.modifiedDate}}</strong>
-        </div>
-        <div class="pull-right">
-          <div {{bindAttr class="view.displayedServiceVersion.isCurrent::hidden"}}>
-            <button class="btn" {{action doCancel target="controller"}} {{bindAttr disabled="view.versionActionsDisabled"}}>{{t common.cancel}}</button>
-            <button class="btn btn-success" {{action save target="view"}} {{bindAttr disabled="view.isSaveDisabled"}}>{{t common.save}}</button>
+      <div class="version-info-bar">
+          <div class="row-fluid">
+              <div class="btn-group pull-left">
+                  <button class="btn dropdown-toggle" data-toggle="dropdown" href="#" {{action hideFullList target="view"}} {{bindAttr disabled="view.versionActionsDisabled"}}>
+                      <i class="icon-random"></i>
+                      <span class="caret"></span>
+                  </button>
+                  <ul class="dropdown-menu">
+                    {{#each serviceVersion in view.dropDownList}}
+                        <li class="pointer dropdown-submenu">
+                            <div class="row-fluid" {{action switchVersion serviceVersion target="view"}}>
+                                <div class="span2">{{serviceVersion.versionText}}</div>
+                                <div class="span6">{{serviceVersion.modifiedDate}}</div>
+                                <div class="span3">{{serviceVersion.author}}</div>
+                                <div class="pull-right"><i class="icon-caret-right"></i></div>
+                            </div>
+                            <ul class="dropdown-menu">
+                                <div class="content"> <strong>{{serviceVersion.serviceName}}</strong> <span class="label label-info">{{serviceVersion.versionText}}</span> &nbsp;
+                                    <strong>{{t services.service.config.configHistory.configGroup}}:{{serviceVersion.configGroupName}}</strong>
+                                    <div class="notes">{{serviceVersion.briefNotes}}</div>
+                                </div>
+                                <div>
+                                    <button class="btn" {{action switchVersion serviceVersion target="view"}}><i class="icon-search"></i>&nbsp;{{t common.view}}</button>
+                                    <button class="btn" {{bindAttr disabled="serviceVersion.isDisabled"}} {{action compare serviceVersion target="view"}}><i class="icon-copy"></i>&nbsp;{{t common.compare}}</button>
+                                    <button class="btn" {{bindAttr disabled="serviceVersion.isDisabled"}} {{action revert serviceVersion target="view"}}>{{t dashboard.configHistory.info-bar.revert.button}}</button>
+                                </div>
+                            </ul>
+                        </li>
+                    {{/each}}
+                    {{#unless view.showFullList}}
+                        <li class="align-center pointer" id="show_more">
+                            <a {{action openFullList target="view"}}>
+                              {{t dashboard.configHistory.info-bar.showMore}}&nbsp;{{view.serviceName}}
+                                &nbsp;<span class="lowercase ellipsis">{{t dashboard.configHistory.title}}</span>
+                            </a>
+                        </li>
+                    {{/unless}}
+                  </ul>
+              </div>
+              <div class="label-wrapper span9" data-toggle="tooltip" {{bindAttr data-original-title="view.displayedServiceVersion.briefNotes"}}>
+                  <span class="label label-info">{{view.displayedServiceVersion.versionText}}</span>
+                {{#if view.displayedServiceVersion.isCurrent}}
+                    <span class="label label-success">{{t common.current}}</span>
+                {{/if}}
+                  <strong>{{view.displayedServiceVersion.author}}</strong>&nbsp;{{t dashboard.configHistory.info-bar.authoredOn}}&nbsp;<strong>{{view.displayedServiceVersion.modifiedDate}}</strong>
+              </div>
+              <div class="pull-right">
+                  <div {{bindAttr class="view.displayedServiceVersion.isCurrent::hidden"}}>
+                      <button class="btn" {{action doCancel target="controller"}} {{bindAttr disabled="view.versionActionsDisabled"}}>{{t common.cancel}}</button>
+                      <button class="btn btn-success" {{action save target="view"}} {{bindAttr disabled="view.isSaveDisabled"}}>{{t common.save}}</button>
+                  </div>
+                  <button class="btn btn-success"  {{action revert target="view"}} {{bindAttr disabled="view.versionActionsDisabled" class="view.displayedServiceVersion.isCurrent:hidden"}}>{{t dashboard.configHistory.info-bar.revert.button}}</button>
+              </div>
           </div>
-          <button class="btn btn-success"  {{action revert target="view"}} {{bindAttr disabled="view.versionActionsDisabled" class="view.displayedServiceVersion.isCurrent:hidden"}}>{{t dashboard.configHistory.info-bar.revert.button}}</button>
-        </div>
-    </div>
+      </div>
   </div>
 </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bcd6d55/ambari-web/app/templates/common/configs/service_config_category.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/service_config_category.hbs b/ambari-web/app/templates/common/configs/service_config_category.hbs
index faab9a3..dcbdba6 100644
--- a/ambari-web/app/templates/common/configs/service_config_category.hbs
+++ b/ambari-web/app/templates/common/configs/service_config_category.hbs
@@ -48,6 +48,12 @@
             {{! Here serviceConfigBinding should ideally be serviceConfigPropertyBinding }}
             <div {{bindAttr class="errorMessage:error: warnMessage:warning: :control-group"}}>
               {{view viewClass serviceConfigBinding="this" categoryConfigsAllBinding="view.categoryConfigsAll" }}
+              {{#if this.isComparison}}
+                  <span class="label label-info">{{t dashboard.configHistory.table.version.prefix}}{{controller.selectedVersion}}</span>
+                {{#if controller.isCurrentSelected}}
+                    <span class="label label-success">{{t common.current}}</span>
+                {{/if}}
+              {{/if}}
               {{#if supportsFinal}}
                 <a href="#" data-toggle="tooltip"
                   {{bindAttr class=":btn :btn-small :btn-final isFinal:active" disabled="isNotEditable"}}
@@ -60,11 +66,13 @@
                 {{#if isPropertyOverridable}}
                   {{#if view.supportsHostOverrides}}
                     {{#if App.isAdmin}}
-                      <a class="btn btn-small" href="#" data-toggle="tooltip"
-                        {{action "createOverrideProperty" this target="view"}}
-                        {{translateAttr data-original-title="common.override"}}>
-                        <i class="icon-plus-sign"></i>
-                      </a>
+                      {{#unless this.isComparison}}
+                          <a class="btn btn-small" href="#" data-toggle="tooltip"
+                            {{action "createOverrideProperty" this target="view"}}
+                            {{translateAttr data-original-title="common.override"}}>
+                              <i class="icon-plus-sign"></i>
+                          </a>
+                      {{/unless}}
                     {{/if}}
                   {{/if}}
                 {{/if}}
@@ -79,11 +87,13 @@
                 {{/unless}}
                 {{#if isRemovable}}
                   {{#if App.isAdmin}}
-                    <a class="btn btn-small" href="#" data-toggle="tooltip"
-                      {{action "removeProperty" this target="view"}}
-                      {{translateAttr data-original-title="common.remove"}}>
-                      <i class="icon-minus-sign"></i>
-                    </a>
+                    {{#unless this.isComparison}}
+                        <a class="btn btn-small" href="#" data-toggle="tooltip"
+                          {{action "removeProperty" this target="view"}}
+                          {{translateAttr data-original-title="common.remove"}}>
+                            <i class="icon-minus-sign"></i>
+                        </a>
+                    {{/unless}}
                   {{/if}}
                 {{/if}}
                 {{#unless isEditable}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bcd6d55/ambari-web/app/views/common/configs/config_history_flow.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/config_history_flow.js b/ambari-web/app/views/common/configs/config_history_flow.js
index 8c81f42..fc054c8 100644
--- a/ambari-web/app/views/common/configs/config_history_flow.js
+++ b/ambari-web/app/views/common/configs/config_history_flow.js
@@ -33,6 +33,11 @@ App.ConfigHistoryFlowView = Em.View.extend({
    * flag identify whether to show all versions or short list of them
    */
   showFullList: false,
+  compareServiceVersion: null,
+
+  showCompareVersionBar: function() {
+    return !Em.isNone(this.get('compareServiceVersion'));
+  }.property('compareServiceVersion'),
 
   isSaveDisabled: function () {
     return (this.get('controller.isSubmitDisabled') || !this.get('controller.versionLoaded'));
@@ -172,7 +177,7 @@ App.ConfigHistoryFlowView = Em.View.extend({
     $(window).unbind('scroll');
 
     $(window).on('scroll', function (event) {
-      var infoBar = $('#config_history_flow>.version-info-bar');
+      var infoBar = $('#config_history_flow>.version-info-bar-wrapper');
       var scrollTop = $(window).scrollTop();
 
       if (infoBar.length === 0) {
@@ -220,6 +225,7 @@ App.ConfigHistoryFlowView = Em.View.extend({
     var version = event.context.get('version');
     var versionIndex = 0;
 
+    this.set('compareServiceVersion', null);
     this.get('serviceVersions').forEach(function (serviceVersion, index) {
       if (serviceVersion.get('version') === version) {
         serviceVersion.set('isDisplayed', true);
@@ -241,6 +247,7 @@ App.ConfigHistoryFlowView = Em.View.extend({
     var isDisabled = event.context ? event.context.get('isDisabled') : false;
     if (isDisabled) return;
     this.set('controller.compareServiceVersion', event.context);
+    this.set('compareServiceVersion', event.context);
     this.get('controller').onConfigGroupChange();
   },
   /**


[14/45] git commit: AMBARI-7031. FE: Next button not enabled when only /validation ERRORs are there. (ababiichuk via srimanth)

Posted by jo...@apache.org.
AMBARI-7031. FE: Next button not enabled when only /validation ERRORs are there. (ababiichuk via srimanth)


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

Branch: refs/heads/branch-alerts-dev
Commit: 966fff415353beff39a4c4cc72ae38b5974ffaa5
Parents: e007d7f
Author: Srimanth Gunturi <sg...@hortonworks.com>
Authored: Wed Aug 27 14:14:53 2014 -0700
Committer: Srimanth Gunturi <sg...@hortonworks.com>
Committed: Wed Aug 27 14:14:53 2014 -0700

----------------------------------------------------------------------
 ambari-web/app/mixins/common/serverValidator.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/966fff41/ambari-web/app/mixins/common/serverValidator.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/serverValidator.js b/ambari-web/app/mixins/common/serverValidator.js
index 3a1dbed..71169c5 100644
--- a/ambari-web/app/mixins/common/serverValidator.js
+++ b/ambari-web/app/mixins/common/serverValidator.js
@@ -236,8 +236,8 @@ App.ServerValidatorMixin = Em.Mixin.create({
               if ((property.get('filename') == item['config-type'] + '.xml') && (property.get('name') == item['config-name'])) {
                 if (item.level == "ERROR") {
                   self.set('configValidationError', true);
-                  property.set('warnMessage', item.message);
-                  property.set('warn', true);
+                  property.set('errorMessage', item.message);
+                  property.set('error', true);
                 } else if (item.level == "WARN") {
                   self.set('configValidationWarning', true);
                   property.set('warnMessage', item.message);


[11/45] git commit: AMBARI-7041. Select Services page: service dependencies should be derived from stack API. (jaimin)

Posted by jo...@apache.org.
AMBARI-7041. Select Services page: service dependencies should be derived from stack API. (jaimin)


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

Branch: refs/heads/branch-alerts-dev
Commit: f6ee0747c1fa2750f0eb5c6822d5023e489d8b91
Parents: b267bd8
Author: Jaimin Jetly <ja...@hortonworks.com>
Authored: Wed Aug 27 13:37:18 2014 -0700
Committer: Jaimin Jetly <ja...@hortonworks.com>
Committed: Wed Aug 27 13:37:18 2014 -0700

----------------------------------------------------------------------
 .../app/controllers/wizard/step4_controller.js  | 35 +++++++-----
 ambari-web/app/mappers/stack_service_mapper.js  |  1 +
 ambari-web/app/models/stack_service.js          | 44 +--------------
 .../test/controllers/wizard/step4_test.js       | 38 ++++++++++++-
 ambari-web/test/service_components.js           | 58 +++++++++++++++++++-
 5 files changed, 115 insertions(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f6ee0747/ambari-web/app/controllers/wizard/step4_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step4_controller.js b/ambari-web/app/controllers/wizard/step4_controller.js
index 22774d2..92dbed4 100644
--- a/ambari-web/app/controllers/wizard/step4_controller.js
+++ b/ambari-web/app/controllers/wizard/step4_controller.js
@@ -254,27 +254,34 @@ App.WizardStep4Controller = Em.ArrayController.extend({
    * @method serviceDependencyValidation
    */
   serviceDependencyValidation: function() {
-    var notSelectedServices = this.filterProperty('isSelected',false);
-    notSelectedServices.forEach(function(service){
-      var showWarningPopup;
-      var dependentServices =  service.get('dependentServices');
+    var selectedServices = this.filterProperty('isSelected',true);
+    var missingDependencies = [];
+    var missingDependenciesDisplayName = [];
+    selectedServices.forEach(function(service){
+    
+      var dependentServices =  service.get('requiredServices');
       if (!!dependentServices) {
-        showWarningPopup = false;
         dependentServices.forEach(function(_dependentService){
           var dependentService = this.findProperty('serviceName', _dependentService);
-          if (dependentService && dependentService.get('isSelected') === true) {
-            showWarningPopup = true;
+          if (dependentService && dependentService.get('isSelected') === false) {
+            if(missingDependencies.indexOf(_dependentService) == -1 ) {
+              missingDependencies.push(_dependentService);
+              missingDependenciesDisplayName.push(dependentService.get('displayNameOnSelectServicePage'));
+            }
           }
         },this);
-        if (showWarningPopup) {
-          this.addValidationError({
-            id: 'serviceCheck_' + service.get('serviceName'),
-            callback: this.needToAddServicePopup,
-            callbackParams: [{serviceName: service.get('serviceName'), selected: true}, 'serviceCheck', service.get('displayNameOnSelectServicePage')]
-          });
-        }
       }
     },this);
+    
+    if (missingDependencies.length > 0) {
+      for(var i = 0; i < missingDependencies.length; i++) {
+        this.addValidationError({
+          id: 'serviceCheck_' + missingDependencies[i],
+          callback: this.needToAddServicePopup,
+          callbackParams: [{serviceName: missingDependencies[i], selected: true}, 'serviceCheck', missingDependenciesDisplayName[i]]
+        });
+      }
+    }
   },
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/f6ee0747/ambari-web/app/mappers/stack_service_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/stack_service_mapper.js b/ambari-web/app/mappers/stack_service_mapper.js
index 7609d9d..1f3d0c2 100644
--- a/ambari-web/app/mappers/stack_service_mapper.js
+++ b/ambari-web/app/mappers/stack_service_mapper.js
@@ -32,6 +32,7 @@ App.stackServiceMapper = App.QuickDataMapper.create({
     stack_version: 'stack_version',
     is_selected: 'is_selected',
     is_installed: 'is_installed',
+    required_services: 'required_services',
     service_check_supported: 'service_check_supported',
     service_components_key: 'service_components',
     service_components_type: 'array',

http://git-wip-us.apache.org/repos/asf/ambari/blob/f6ee0747/ambari-web/app/models/stack_service.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/stack_service.js b/ambari-web/app/models/stack_service.js
index 7c69804..a711936 100644
--- a/ambari-web/app/models/stack_service.js
+++ b/ambari-web/app/models/stack_service.js
@@ -49,6 +49,7 @@ App.StackService = DS.Model.extend({
   isInstalled: DS.attr('boolean', {defaultValue: false}),
   serviceComponents: DS.hasMany('App.StackServiceComponent'),
   configs: DS.attr('array'),
+  requiredServices: DS.attr('array'),
 
   // Is the service a distributed filesystem
   isDFS: function () {
@@ -90,34 +91,6 @@ App.StackService = DS.Model.extend({
     return hiddenServices.contains(this.get('serviceName'));
   }.property('serviceName'),
 
-  dependentServices: function () {
-    var serviceName = this.get('serviceName');
-    var dependentServices = [];
-    if (App.get('isHadoop2Stack')) {
-      dependentServices = App.StackService.dependency['HDP-2'][serviceName];
-    } else {
-      dependentServices = App.StackService.dependency['HDP-1'][serviceName];
-    }
-    return dependentServices;
-  }.property('serviceName'),
-
-  /**
-   * other services on which the service is dependent
-   */
-  serviceDependency: function () {
-    var serviceName = this.get('serviceName');
-    var serviceDependencyMap, key, serviceDependencies = [];
-    if (App.get('isHadoop2Stack')) {
-      serviceDependencyMap = App.StackService.dependency['HDP-2'];
-    } else {
-      serviceDependencyMap = App.StackService.dependency['HDP-1'];
-    }
-    for (key in serviceDependencyMap) {
-      if (serviceDependencyMap[key].contains(serviceName)) serviceDependencies.push(key);
-    }
-    return  serviceDependencies;
-  }.property('serviceName'),
-
   // Is the service required for monitoring of other hadoop ecosystem services
   isMonitoringService: function () {
     var services = ['NAGIOS', 'GANGLIA'];
@@ -223,21 +196,6 @@ App.StackService.displayOrder = [
   'FLUME'
 ];
 
-App.StackService.dependency = {
-  'HDP-1': {
-    'HDFS': ['MAPREDUCE', 'HBASE', 'SQOOP'],
-    'MAPREDUCE': ['PIG', 'OOZIE', 'HIVE'],
-    'ZOOKEEPER': ['HBASE', 'HIVE', 'WEBHCAT']
-  },
-  'HDP-2': {
-    'ZOOKEEPER': ['HDFS', 'HBASE', 'HIVE', 'WEBHCAT', 'STORM'],
-    'HDFS': ['YARN', 'HBASE', 'FLUME', 'SQOOP'],
-    'YARN': ['PIG', 'OOZIE', 'HIVE', 'TEZ'],
-    'TEZ': ['YARN'],
-    'OOZIE': ['FALCON']
-  }
-};
-
 //@TODO: Write unit test for no two keys in the object should have any intersecting elements in their values
 App.StackService.coSelected = {
   'YARN': ['MAPREDUCE2'],

http://git-wip-us.apache.org/repos/asf/ambari/blob/f6ee0747/ambari-web/test/controllers/wizard/step4_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step4_test.js b/ambari-web/test/controllers/wizard/step4_test.js
index ca693e4..7344853 100644
--- a/ambari-web/test/controllers/wizard/step4_test.js
+++ b/ambari-web/test/controllers/wizard/step4_test.js
@@ -32,6 +32,7 @@ describe('App.WizardStep4Controller', function () {
 
   var generateSelectedServicesContent = function(selectedServiceNames) {
     var allServices = services.slice(0);
+    modelSetup.setupStackServiceComponent();
     if (selectedServiceNames.contains('GLUSTERFS')) allServices.push('GLUSTERFS');
     allServices = allServices.map(function(serviceName) {
       return [Ember.Object.create({
@@ -42,7 +43,7 @@ describe('App.WizardStep4Controller', function () {
         isPrimaryDFS: serviceName == 'HDFS',
         isDFS: ['HDFS','GLUSTERFS'].contains(serviceName),
         isMonitoringService: ['NAGIOS','GANGLIA'].contains(serviceName),
-        dependentServices: App.StackService.dependency['HDP-2'][serviceName],
+        requiredServices: App.StackService.find(serviceName).get('requiredServices'),
         displayNameOnSelectServicePage: App.format.role(serviceName),
         coSelectedServices: function() {
           return App.StackService.coSelected[this.get('serviceName')] || [];
@@ -471,4 +472,39 @@ describe('App.WizardStep4Controller', function () {
     })
   });
 
+  describe('#dependencies', function() {
+    var tests = [
+      {
+        services: ['HDFS'],
+        dependencies: ['ZOOKEEPER'] 
+      },
+      {
+        services: ['STORM'],
+        dependencies: ['ZOOKEEPER'] 
+      }
+    ];
+    tests.forEach(function(test) {
+      var message = '{0} dependency should be {1}'.format(test.services.join(','), test.dependencies.join(','));
+      it(message, function() {
+        
+        controller.clear();
+        controller.set('content', generateSelectedServicesContent(test.services));
+        
+        var dependentServicesTest = [];
+        
+        test.services.forEach(function(serviceName) {
+          var service = controller.filterProperty('serviceName', serviceName);
+          service.forEach(function(item) {
+            var dependencies = item.get('requiredServices');
+            if(!!dependencies) {
+              dependentServicesTest = dependentServicesTest.concat(dependencies);
+            }
+          });
+        });
+
+        expect(dependentServicesTest).to.be.eql(test.dependencies);
+      });
+    })
+  });
+
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/f6ee0747/ambari-web/test/service_components.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/service_components.js b/ambari-web/test/service_components.js
index 8b89ab3..091048c 100644
--- a/ambari-web/test/service_components.js
+++ b/ambari-web/test/service_components.js
@@ -25,7 +25,10 @@ module.exports = {
         "display_name" : "MapReduce",
         "service_version" : "1.2.0.1.3.3.0",
         "stack_name" : "HDP",
-        "stack_version" : "1.3.2"
+        "stack_version" : "1.3.2",
+        "required_services" : [
+          "YARN"
+        ]
       },
       "serviceComponents" : [
         {
@@ -115,7 +118,10 @@ module.exports = {
               "final" : "true"
             }
           }
-        }
+        },
+        "required_services" : [
+          "OOZIE"
+        ]
       },
       "serviceComponents" : [
         {
@@ -201,7 +207,10 @@ module.exports = {
               "final" : "false"
             }
           }
-        }
+        },
+        "required_services" : [
+          "HDFS"
+        ]
       },
       "serviceComponents" : [
         {
@@ -234,6 +243,7 @@ module.exports = {
         "stack_name" : "HDP",
         "stack_version" : "2.1",
         "user_name" : null,
+        "required_services" : null,
         "config_types" : {
           "ganglia-env" : {
             "supports" : {
@@ -292,6 +302,10 @@ module.exports = {
         "stack_name" : "HDP",
         "stack_version" : "2.1",
         "user_name" : null,
+        "required_services" : [
+          "ZOOKEEPER",
+          "HDFS"
+        ],
         "config_types" : {
           "hbase-env" : {
             "supports" : {
@@ -401,6 +415,9 @@ module.exports = {
         "stack_name" : "HDP",
         "stack_version" : "2.1",
         "user_name" : null,
+        "required_services" : [
+          "HIVE"
+        ],
         "config_types" : {
           "hive-env" : {
             "supports" : {
@@ -445,6 +462,9 @@ module.exports = {
         "stack_name" : "HDP",
         "stack_version" : "2.1",
         "user_name" : null,
+        "required_services" : [
+          "ZOOKEEPER"
+        ],
         "config_types" : {
           "core-site" : {
             "supports" : {
@@ -586,6 +606,10 @@ module.exports = {
         "stack_name" : "HDP",
         "stack_version" : "2.1",
         "user_name" : null,
+        "required_services" : [
+          "ZOOKEEPER",
+          "YARN"
+        ],
         "config_types" : {
           "hive-env" : {
             "supports" : {
@@ -738,6 +762,9 @@ module.exports = {
         "stack_name" : "HDP",
         "stack_version" : "2.1",
         "user_name" : null,
+        "required_services" : [
+          "YARN"
+        ],
         "config_types" : {
           "core-site" : {
             "supports" : {
@@ -823,6 +850,7 @@ module.exports = {
         "stack_name" : "HDP",
         "stack_version" : "2.1",
         "user_name" : null,
+        "required_services" : [ ],
         "config_types" : {
           "nagios-env" : {
             "supports" : {
@@ -923,6 +951,9 @@ module.exports = {
         "stack_name" : "HDP",
         "stack_version" : "2.1",
         "user_name" : null,
+        "required_services" : [
+          "YARN"
+        ],
         "config_types" : {
           "oozie-env" : {
             "supports" : {
@@ -1045,6 +1076,9 @@ module.exports = {
         "stack_name" : "HDP",
         "stack_version" : "2.1",
         "user_name" : null,
+        "required_services" : [
+          "YARN"
+        ],
         "config_types" : {
           "pig-env" : {
             "supports" : {
@@ -1094,6 +1128,9 @@ module.exports = {
         "stack_name" : "HDP",
         "stack_version" : "2.1",
         "user_name" : null,
+        "required_services" : [
+          "HDFS"
+        ],
         "config_types" : {
           "sqoop-env" : {
             "supports" : {
@@ -1154,6 +1191,9 @@ module.exports = {
         "stack_name" : "HDP",
         "stack_version" : "2.1",
         "user_name" : null,
+        "required_services" : [
+          "ZOOKEEPER"
+        ],
         "config_types" : {
           "storm-env" : {
             "supports" : {
@@ -1273,6 +1313,9 @@ module.exports = {
         "stack_name" : "HDP",
         "stack_version" : "2.1",
         "user_name" : null,
+        "required_services" : [
+          "YARN"
+        ],
         "config_types" : {
           "tez-env" : {
             "supports" : {
@@ -1317,6 +1360,10 @@ module.exports = {
         "stack_name" : "HDP",
         "stack_version" : "2.1",
         "user_name" : null,
+        "required_services" : [
+          "HIVE",
+          "ZOOKEEPER"
+        ],
         "config_types" : {
           "webhcat-env" : {
             "supports" : {
@@ -1412,6 +1459,10 @@ module.exports = {
         "stack_name" : "HDP",
         "stack_version" : "2.1",
         "user_name" : null,
+        "required_services" : [
+          "HDFS",
+          "TEZ"
+        ],
         "config_types" : {
           "capacity-scheduler" : {
             "supports" : {
@@ -1522,6 +1573,7 @@ module.exports = {
         "stack_name" : "HDP",
         "stack_version" : "2.1",
         "user_name" : null,
+        "required_services" : [ ],
         "config_types" : {
           "zoo.cfg" : {
             "supports" : {


[07/45] git commit: AMBARI-7017. Jobs aren't displayed in Ambari UI (aonishuk)

Posted by jo...@apache.org.
AMBARI-7017. Jobs aren't displayed in Ambari UI (aonishuk)


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

Branch: refs/heads/branch-alerts-dev
Commit: af1db65118e91792b44eee882fc8eea0fef887a9
Parents: 9385d47
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Wed Aug 27 19:33:07 2014 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Wed Aug 27 19:33:07 2014 +0300

----------------------------------------------------------------------
 .../stacks/HDP/1.3.2/hooks/before-START/scripts/params.py        | 4 ++--
 .../python/stacks/1.3.2/hooks/before-START/test_before_start.py  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/af1db651/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-START/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-START/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-START/scripts/params.py
index 4e58939..97f32d5 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-START/scripts/params.py
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-START/scripts/params.py
@@ -93,8 +93,8 @@ ambari_db_rca_driver = config['hostLevelParams']['ambari_db_rca_driver']
 ambari_db_rca_username = config['hostLevelParams']['ambari_db_rca_username']
 ambari_db_rca_password = config['hostLevelParams']['ambari_db_rca_password']
 
-if 'rca_enabled' in config['configurations']['hadoop-env']:
-  rca_enabled =  config['configurations']['hadoop-env']['rca_enabled']
+if 'rca_enabled' in config['configurations']['mapred-env']:
+  rca_enabled =  config['configurations']['mapred-env']['rca_enabled']
 else:
   rca_enabled = False
 rca_disabled_prefix = "###"

http://git-wip-us.apache.org/repos/asf/ambari/blob/af1db651/ambari-server/src/test/python/stacks/1.3.2/hooks/before-START/test_before_start.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/1.3.2/hooks/before-START/test_before_start.py b/ambari-server/src/test/python/stacks/1.3.2/hooks/before-START/test_before_start.py
index 15d25a7..c559048 100644
--- a/ambari-server/src/test/python/stacks/1.3.2/hooks/before-START/test_before_start.py
+++ b/ambari-server/src/test/python/stacks/1.3.2/hooks/before-START/test_before_start.py
@@ -57,7 +57,7 @@ class TestHookBeforeStart(RMFTestCase):
                               owner = 'hdfs',
                               )
     self.assertResourceCalled('File', '/etc/hadoop/conf/log4j.properties',
-                              content = 'log4jproperties\nline2log4jproperties\nline2',
+                              content = 'log4jproperties\nline2log4jproperties\nline2\n\nlog4j.appender.JHA=org.apache.ambari.log4j.hadoop.mapreduce.jobhistory.JobHistoryAppender\nlog4j.appender.JHA.database=jdbc:postgresql://c6401.ambari.apache.org/ambarirca\nlog4j.appender.JHA.driver=org.postgresql.Driver\nlog4j.appender.JHA.user=mapred\nlog4j.appender.JHA.password=mapred\n\nlog4j.logger.org.apache.hadoop.mapred.JobHistory$JobHistoryLogger=DEBUG,JHA\nlog4j.additivity.org.apache.hadoop.mapred.JobHistory$JobHistoryLogger=true\n\n',
                               owner = 'hdfs',
                               group = 'hadoop',
                               mode = 0644,


[13/45] git commit: AMBARI-7047. BE: Config validation type of values less than recommended should be WARNs

Posted by jo...@apache.org.
AMBARI-7047. BE: Config validation type of values less than recommended should be WARNs


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

Branch: refs/heads/branch-alerts-dev
Commit: e007d7f4fac0bbef2e753e7004e368a0f6329212
Parents: 40e3f0f
Author: Srimanth Gunturi <sg...@hortonworks.com>
Authored: Wed Aug 27 13:51:39 2014 -0700
Committer: Srimanth Gunturi <sg...@hortonworks.com>
Committed: Wed Aug 27 13:51:39 2014 -0700

----------------------------------------------------------------------
 .../stacks/HDP/2.0.6/services/stack_advisor.py  | 56 +++++++++++---------
 .../stacks/2.0.6/common/test_stack_advisor.py   | 36 ++++++++++---
 2 files changed, 60 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e007d7f4/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
index ad0dcc0..083286e 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
@@ -415,58 +415,66 @@ class HDP206StackAdvisor(StackAdvisor):
       "YARN": ["yarn-site", self.validateYARNConfigurations]
     }.get(serviceName, None)
 
-  def toConfigurationValidationErrors(self, items, siteName):
+  def toConfigurationValidationProblems(self, validationProblems, siteName):
     result = []
-    for item in items:
-      if item["message"] is not None:
-        error = { "type": 'configuration', "level": 'ERROR', "message": item["message"], "config-type": siteName, "config-name": item["config-name"] }
-        result.append(error)
+    for validationProblem in validationProblems:
+      validationItem = validationProblem.get("item", None)
+      if validationItem is not None:
+        problem = { "type": 'configuration', "level": validationItem["level"], "message": validationItem["message"],
+                  "config-type": siteName, "config-name": validationProblem["config-name"] }
+        result.append(problem)
     return result
 
+  def getWarnItem(self, message):
+    return {"level": "WARN", "message": message}
+
+  def getErrorItem(self, message):
+    return {"level": "ERROR", "message": message}
+
   def validatorLessThenDefaultValue(self, properties, recommendedDefaults, propertyName):
     if not propertyName in properties:
-      return "Value should be set"
+      return self.getErrorItem("Value should be set")
     value = to_number(properties[propertyName])
     if value is None:
-      return "Value should be integer"
+      return self.getErrorItem("Value should be integer")
     defaultValue = to_number(recommendedDefaults[propertyName])
     if defaultValue is None:
       return None
     if value < defaultValue:
-      return "Value is less than the recommended default of {0}".format(defaultValue)
+      return self.getWarnItem("Value is less than the recommended default of {0}".format(defaultValue))
     return None
 
   def validateXmxValue(self, properties, recommendedDefaults, propertyName):
     if not propertyName in properties:
-      return "Value should be set"
+      return self.getErrorItem("Value should be set")
     value = properties[propertyName]
     defaultValue = recommendedDefaults[propertyName]
     if defaultValue is None:
-      return "Config's default value can't be null or undefined"
+      return self.getErrorItem("Config's default value can't be null or undefined")
     if not checkXmxValueFormat(value):
-      return 'Invalid value format'
+      return self.getErrorItem('Invalid value format')
     valueInt = formatXmxSizeToBytes(getXmxSize(value))
     defaultValueXmx = getXmxSize(defaultValue)
     defaultValueInt = formatXmxSizeToBytes(defaultValueXmx)
     if valueInt < defaultValueInt:
-      return "Value is less than the recommended default of -Xmx" + defaultValueXmx
+      return self.getWarnItem("Value is less than the recommended default of -Xmx" + defaultValueXmx)
     return None
 
   def validateMapReduce2Configurations(self, properties, recommendedDefaults):
-    validationItems = [ {"config-name": 'mapreduce.map.java.opts', "message": self.validateXmxValue(properties, recommendedDefaults, 'mapreduce.map.java.opts')},
-                        {"config-name": 'mapreduce.reduce.java.opts', "message": self.validateXmxValue(properties, recommendedDefaults, 'mapreduce.reduce.java.opts')},
-                        {"config-name": 'mapreduce.task.io.sort.mb', "message": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'mapreduce.task.io.sort.mb')},
-                        {"config-name": 'mapreduce.map.memory.mb', "message": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'mapreduce.map.memory.mb')},
-                        {"config-name": 'mapreduce.reduce.memory.mb', "message": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'mapreduce.reduce.memory.mb')},
-                        {"config-name": 'yarn.app.mapreduce.am.resource.mb', "message": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'yarn.app.mapreduce.am.resource.mb')},
-                        {"config-name": 'yarn.app.mapreduce.am.command-opts', "message": self.validateXmxValue(properties, recommendedDefaults, 'yarn.app.mapreduce.am.command-opts')} ]
-    return self.toConfigurationValidationErrors(validationItems, "mapred-site")
+    validationItems = [ {"config-name": 'mapreduce.map.java.opts', "item": self.validateXmxValue(properties, recommendedDefaults, 'mapreduce.map.java.opts')},
+                        {"config-name": 'mapreduce.reduce.java.opts', "item": self.validateXmxValue(properties, recommendedDefaults, 'mapreduce.reduce.java.opts')},
+                        {"config-name": 'mapreduce.task.io.sort.mb', "item": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'mapreduce.task.io.sort.mb')},
+                        {"config-name": 'mapreduce.map.memory.mb', "item": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'mapreduce.map.memory.mb')},
+                        {"config-name": 'mapreduce.reduce.memory.mb', "item": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'mapreduce.reduce.memory.mb')},
+                        {"config-name": 'yarn.app.mapreduce.am.resource.mb', "item": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'yarn.app.mapreduce.am.resource.mb')},
+                        {"config-name": 'yarn.app.mapreduce.am.command-opts', "item": self.validateXmxValue(properties, recommendedDefaults, 'yarn.app.mapreduce.am.command-opts')} ]
+    return self.toConfigurationValidationProblems(validationItems, "mapred-site")
 
   def validateYARNConfigurations(self, properties, recommendedDefaults):
-    validationItems = [ {"config-name": 'yarn.nodemanager.resource.memory-mb', "message": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'yarn.nodemanager.resource.memory-mb')},
-                        {"config-name": 'yarn.scheduler.minimum-allocation-mb', "message": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'yarn.scheduler.minimum-allocation-mb')},
-                        {"config-name": 'yarn.scheduler.maximum-allocation-mb', "message": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'yarn.scheduler.maximum-allocation-mb')} ]
-    return self.toConfigurationValidationErrors(validationItems, "yarn-site")
+    validationItems = [ {"config-name": 'yarn.nodemanager.resource.memory-mb', "item": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'yarn.nodemanager.resource.memory-mb')},
+                        {"config-name": 'yarn.scheduler.minimum-allocation-mb', "item": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'yarn.scheduler.minimum-allocation-mb')},
+                        {"config-name": 'yarn.scheduler.maximum-allocation-mb', "item": self.validatorLessThenDefaultValue(properties, recommendedDefaults, 'yarn.scheduler.maximum-allocation-mb')} ]
+    return self.toConfigurationValidationProblems(validationItems, "yarn-site")
 
 
 # Validation helper methods

http://git-wip-us.apache.org/repos/asf/ambari/blob/e007d7f4/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
index d32fa56..898797a 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
@@ -99,9 +99,9 @@ class TestHDP206StackAdvisor(TestCase):
     result = self.stackAdvisor.validateComponentLayout(services, hosts)
 
     expectedItems = [
-      {"message": "NameNode and Secondary NameNode cannot be hosted on same machine", "host": "host1"},
-      {"message": "NameNode and Secondary NameNode cannot be hosted on same machine", "host": "host1"},
-      {"message": "Host is not used", "host": "host2"}
+      {"message": "NameNode and Secondary NameNode cannot be hosted on same machine", "level": "WARN", "host": "host1"},
+      {"message": "NameNode and Secondary NameNode cannot be hosted on same machine", "level": "WARN", "host": "host1"},
+      {"message": "Host is not used", "level": "ERROR", "host": "host2"}
     ]
     self.assertValidationResult(expectedItems, result)
 
@@ -120,7 +120,27 @@ class TestHDP206StackAdvisor(TestCase):
     result = self.stackAdvisor.validateComponentLayout(services, hosts)
 
     expectedItems = [
-      {"message": "Cardinality violation, cardinality=ALL, hosts count=1"}
+      {"message": "Cardinality violation, cardinality=ALL, hosts count=1", "level": "ERROR"}
+    ]
+    self.assertValidationResult(expectedItems, result)
+
+  def test_validationWarnMessagesIfLessThanDefault(self):
+    servicesInfo = [
+      {
+        "name": "YARN",
+        "components": []
+      }
+    ]
+    services = self.prepareServices(servicesInfo)
+    services["configurations"] = {"yarn-site":{"properties":{"yarn.nodemanager.resource.memory-mb": "0",
+                                                             "yarn.scheduler.minimum-allocation-mb": "str"}}}
+    hosts = self.prepareHosts([])
+    result = self.stackAdvisor.validateConfigurations(services, hosts)
+
+    expectedItems = [
+      {"message": "Value is less than the recommended default of 2046", "level": "WARN"},
+      {"message": "Value should be integer", "level": "ERROR"},
+      {"message": "Value should be set", "level": "ERROR"}
     ]
     self.assertValidationResult(expectedItems, result)
 
@@ -139,7 +159,7 @@ class TestHDP206StackAdvisor(TestCase):
     result = self.stackAdvisor.validateComponentLayout(services, hosts)
 
     expectedItems = [
-      {"message": "Host is not used", "host": "host1"}
+      {"message": "Host is not used", "host": "host1", "level": "ERROR"}
     ]
     self.assertValidationResult(expectedItems, result)
 
@@ -157,7 +177,7 @@ class TestHDP206StackAdvisor(TestCase):
     result = self.stackAdvisor.validateComponentLayout(services, hosts)
 
     expectedItems = [
-      {"message": "Cardinality violation, cardinality=0-1, hosts count=2"}
+      {"message": "Cardinality violation, cardinality=0-1, hosts count=2", "level": "ERROR"}
     ]
     self.assertValidationResult(expectedItems, result)
 
@@ -175,7 +195,7 @@ class TestHDP206StackAdvisor(TestCase):
     result = self.stackAdvisor.validateComponentLayout(services, hosts)
 
     expectedItems = [
-      {"message": "Host is not used", "host": "host2"}
+      {"message": "Host is not used", "host": "host2", "level": "ERROR"}
     ]
     self.assertValidationResult(expectedItems, result)
 
@@ -244,7 +264,7 @@ class TestHDP206StackAdvisor(TestCase):
   def assertValidationResult(self, expectedItems, result):
     actualItems = []
     for item in result["items"]:
-      next = { "message": item["message"] }
+      next = {"message": item["message"], "level": item["level"]}
       try:
         next["host"] = item["host"]
       except KeyError, err:


[35/45] git commit: AMBARI-7046. Missing metainfo.xml - displayName in 2.1.GlusterFS stack(Scott Creeley via subin)

Posted by jo...@apache.org.
AMBARI-7046. Missing metainfo.xml - displayName in 2.1.GlusterFS stack(Scott Creeley via subin)


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

Branch: refs/heads/branch-alerts-dev
Commit: fb8367080acd88d311ced9de903bbb1ba9452254
Parents: ff27e56
Author: Subin <su...@apache.org>
Authored: Thu Aug 28 13:33:48 2014 +0000
Committer: Subin <su...@apache.org>
Committed: Thu Aug 28 13:36:24 2014 +0000

----------------------------------------------------------------------
 .../services/FALCON/configuration/global.xml    |  63 -------
 .../2.1.GlusterFS/services/FALCON/metainfo.xml  |  19 ++-
 .../GLUSTERFS/configuration/core-site.xml       | 169 -------------------
 .../services/GLUSTERFS/configuration/global.xml |  59 -------
 .../services/GLUSTERFS/metainfo.xml             |   1 +
 .../services/STORM/configuration/global.xml     |  39 -----
 .../2.1.GlusterFS/services/STORM/metainfo.xml   |   1 +
 .../services/TEZ/configuration/global.xml       |  29 ----
 .../HDP/2.1.GlusterFS/services/TEZ/metainfo.xml |  22 ++-
 ambari-web/app/models/stack_service.js          |   4 +-
 10 files changed, 41 insertions(+), 365 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/fb836708/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/FALCON/configuration/global.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/FALCON/configuration/global.xml b/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/FALCON/configuration/global.xml
deleted file mode 100644
index fadc02d..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/FALCON/configuration/global.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
-<!--
-/**
- * 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.
- */
--->
-<configuration supports_final="false">
-  <property>
-    <name>falcon_user</name>
-    <value>falcon</value>
-    <description>Falcon user.</description>
-  </property>
-  <property>
-    <name>falcon_port</name>
-    <value>15000</value>
-    <description>Port the Falcon Server listens on.</description>
-  </property>
-  <property>
-    <name>falcon_log_dir</name>
-    <value>/var/log/falcon</value>
-    <description>Falcon log directory.</description>
-  </property>
-  <property>
-    <name>falcon_pid_dir</name>
-    <value>/var/run/falcon</value>
-    <description>Falcon pid-file directory.</description>
-  </property>
-  <property>
-    <name>falcon_local_dir</name>
-    <value>/hadoop/falcon</value>
-    <description>Directory where Falcon data, such as activemq data, is stored.</description>
-  </property>
-  <!--embeddedmq properties-->
-  <property>
-    <name>falcon.embeddedmq.data</name>
-    <value>/hadoop/falcon/embeddedmq/data</value>
-    <description>Directory in which embeddedmq data is stored.</description>
-  </property>
-  <property>
-    <name>falcon.embeddedmq</name>
-    <value>true</value>
-    <description>Whether embeddedmq is enabled or not.</description>
-  </property>
-  <property>
-    <name>falcon.emeddedmq.port</name>
-    <value>61616</value>
-    <description>Port that embeddedmq will listen on.</description>
-  </property>
-</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fb836708/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/FALCON/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/FALCON/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/FALCON/metainfo.xml
index f66d99f..2e444b1 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/FALCON/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/FALCON/metainfo.xml
@@ -20,21 +20,31 @@
   <services>
     <service>
       <name>FALCON</name>
+      <displayName>Falcon</displayName>
       <comment>Data management and processing platform</comment>
       <version>0.5.0.2.1</version>
       <components>
         <component>
           <name>FALCON_CLIENT</name>
+          <displayName>Falcon Client</displayName>
           <category>CLIENT</category>
-          <cardinality>0+</cardinality>
+          <cardinality>1+</cardinality>
           <commandScript>
             <script>scripts/falcon_client.py</script>
             <scriptType>PYTHON</scriptType>
             <timeout>600</timeout>
           </commandScript>
+          <configFiles>
+            <configFile>
+              <type>env</type>
+              <fileName>falcon-env.sh</fileName>
+              <dictionaryName>falcon-env</dictionaryName>
+            </configFile>
+          </configFiles>
         </component>
         <component>
           <name>FALCON_SERVER</name>
+          <displayName>Falcon Server</displayName>
           <category>MASTER</category>
           <cardinality>1</cardinality>
           <dependencies>
@@ -78,8 +88,11 @@
         <timeout>300</timeout>
       </commandScript>
 
+      <requiredServices>
+        <service>OOZIE</service>
+      </requiredServices>
+
       <configuration-dependencies>
-        <config-type>oozie-site</config-type>
         <config-type>falcon-env</config-type>
         <config-type>falcon-startup.properties</config-type>
         <config-type>falcon-runtime.properties</config-type>
@@ -87,4 +100,4 @@
 
     </service>
   </services>
-</metainfo>
+</metainfo>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/fb836708/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/GLUSTERFS/configuration/core-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/GLUSTERFS/configuration/core-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/GLUSTERFS/configuration/core-site.xml
index b1529f2..553b48d 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/GLUSTERFS/configuration/core-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/GLUSTERFS/configuration/core-site.xml
@@ -46,173 +46,4 @@
     <value>/mnt/gv0</value>
   </property>
 
-
-<!-- Properties that I am removing to get rid of service errors -->
-<!--  I/O Properties -->
-<!--
-
- <property>
-    <name>io.file.buffer.size</name>
-    <value>131072</value>
-    <description>The size of buffer for use in sequence files.
-  The size of this buffer should probably be a multiple of hardware
-  page size (4096 on Intel x86), and it determines how much data is
-  buffered during read and write operations.</description>
-  </property>
-  <property>
-    <name>io.serializations</name>
-    <value>org.apache.hadoop.io.serializer.WritableSerialization</value>
-  </property>
-
-  <property>
-    <name>io.compression.codecs</name>
-    <value></value>
-    <description>A list of the compression codec classes that can be used
-                 for compression/decompression.</description>
-  </property>
-
-  <property>
-    <name>io.compression.codec.lzo.class</name>
-    <value>com.hadoop.compression.lzo.LzoCodec</value>
-    <description>The implementation for lzo codec.</description>
-  </property>
--->
-<!-- something -->
-<!--
-  <property>
-    <name>fs.trash.interval</name>
-    <value>360</value>
-    <description>Number of minutes between trash checkpoints.
-  If zero, the trash feature is disabled.
-  </description>
-  </property>
-
-  <property>
-    <name>fs.checkpoint.dir</name>
-    <value></value>
-    <description>Determines where on the local filesystem the DFS secondary
-        name node should store the temporary images to merge.
-        If this is a comma-delimited list of directories then the image is
-        replicated in all of the directories for redundancy.
-    </description>
-  </property>
-
-  <property>
-    <name>fs.checkpoint.edits.dir</name>
-    <value>${fs.checkpoint.dir}</value>
-    <description>Determines where on the local filesystem the DFS secondary
-        name node should store the temporary edits to merge.
-        If this is a comma-delimited list of directoires then teh edits is
-        replicated in all of the directoires for redundancy.
-        Default value is same as fs.checkpoint.dir
-    </description>
-  </property>
-
-  <property>
-    <name>fs.checkpoint.period</name>
-    <value>21600</value>
-    <description>The number of seconds between two periodic checkpoints.
-  </description>
-  </property>
-
-  <property>
-    <name>fs.checkpoint.size</name>
-    <value>536870912</value>
-    <description>The size of the current edit log (in bytes) that triggers
-       a periodic checkpoint even if the fs.checkpoint.period hasn't expired.
-  </description>
-  </property>
-
-  <property>
-    <name>ipc.client.idlethreshold</name>
-    <value>8000</value>
-    <description>Defines the threshold number of connections after which
-               connections will be inspected for idleness.
-  </description>
-  </property>
-
-  <property>
-    <name>ipc.client.connection.maxidletime</name>
-    <value>30000</value>
-    <description>The maximum time after which a client will bring down the
-               connection to the server.
-  </description>
-  </property>
-
-  <property>
-    <name>ipc.client.connect.max.retries</name>
-    <value>50</value>
-    <description>Defines the maximum number of retries for IPC connections.</description>
-  </property>
-
-  <property>
-    <name>webinterface.private.actions</name>
-    <value>false</value>
-    <description> If set to true, the web interfaces of JT and NN may contain
-                actions, such as kill job, delete file, etc., that should
-                not be exposed to public. Enable this option if the interfaces
-                are only reachable by those who have the right authorization.
-  </description>
-  </property>
-
- <property>
-   <name>hadoop.security.authentication</name>
-   <value></value>
-   <description>
-   Set the authentication for the cluster. Valid values are: simple or
-   kerberos.
-   </description>
- </property>
-<property>
-  <name>hadoop.security.authorization</name>
-  <value></value>
-  <description>
-     Enable authorization for different protocols.
-  </description>
-</property>
-
-  <property>
-    <name>hadoop.security.auth_to_local</name>
-    <value></value>
-<description>The mapping from kerberos principal names to local OS user names.
-  So the default rule is just "DEFAULT" which takes all principals in your default domain to their first component.
-  "omalley@APACHE.ORG" and "omalley/admin@APACHE.ORG" to "omalley", if your default domain is APACHE.ORG.
-The translations rules have 3 sections:
-      base     filter    substitution
-The base consists of a number that represents the number of components in the principal name excluding the realm and the pattern for building the name from the sections of the principal name. The base uses $0 to mean the realm, $1 to mean the first component and $2 to mean the second component.
-
-[1:$1@$0] translates "omalley@APACHE.ORG" to "omalley@APACHE.ORG"
-[2:$1] translates "omalley/admin@APACHE.ORG" to "omalley"
-[2:$1%$2] translates "omalley/admin@APACHE.ORG" to "omalley%admin"
-
-The filter is a regex in parens that must the generated string for the rule to apply.
-
-"(.*%admin)" will take any string that ends in "%admin"
-"(.*@ACME.COM)" will take any string that ends in "@ACME.COM"
-
-Finally, the substitution is a sed rule to translate a regex into a fixed string.
-
-"s/@ACME\.COM//" removes the first instance of "@ACME.COM".
-"s/@[A-Z]*\.COM//" removes the first instance of "@" followed by a name followed by ".COM".
-"s/X/Y/g" replaces all of the "X" in the name with "Y"
-
-So, if your default realm was APACHE.ORG, but you also wanted to take all principals from ACME.COM that had a single component "joe@ACME.COM", you'd do:
-
-RULE:[1:$1@$0](.@ACME.ORG)s/@.//
-DEFAULT
-
-To also translate the names with a second component, you'd make the rules:
-
-RULE:[1:$1@$0](.@ACME.ORG)s/@.//
-RULE:[2:$1@$0](.@ACME.ORG)s/@.//
-DEFAULT
-
-If you want to treat all principals from APACHE.ORG with /admin as "admin", your rules would look like:
-
-RULE[2:$1%$2@$0](.%admin@APACHE.ORG)s/./admin/
-DEFAULT
-    </description>
-  </property>
--->
-
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fb836708/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/GLUSTERFS/configuration/global.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/GLUSTERFS/configuration/global.xml b/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/GLUSTERFS/configuration/global.xml
deleted file mode 100644
index d4cd50b..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/GLUSTERFS/configuration/global.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
-<!--
-/**
- * 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.
- */
--->
-
-<configuration supports_final="false">
-  <property>
-    <name>hadoop_pid_dir_prefix</name>
-    <value>/var/run/hadoop</value>
-    <description>Hadoop PID Dir Prefix</description>
-  </property>
- <property>
-    <name>hadoop_heapsize</name>
-    <value>1024</value>
-    <description>Hadoop maximum Java heap size</description>
-  </property>
-  <property>
-    <name>glusterfs_user</name>
-    <value>root</value>
-    <description></description>
-  </property>
-  <property>
-    <name>hdfs_log_dir_prefix</name>
-    <value>/var/log/hadoop</value>
-    <description>Hadoop Log Dir Prefix</description>
-  </property>
-  <property>
-    <name>namenode_heapsize</name>
-    <value>1024</value>
-    <description>NameNode Java heap size</description>
-  </property>
-  <property>
-    <name>namenode_host</name>
-    <value></value>
-    <description>NameNode Host.</description>
-  </property>
-  <property>
-    <name>snamenode_host</name>
-    <value></value>
-    <description>Secondary NameNode.</description>
-  </property>
-</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fb836708/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/GLUSTERFS/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/GLUSTERFS/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/GLUSTERFS/metainfo.xml
index 6b01ed0..9e66b78 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/GLUSTERFS/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/GLUSTERFS/metainfo.xml
@@ -20,6 +20,7 @@
   <services>
     <service>
       <name>GLUSTERFS</name>
+      <displayName>GLUSTERFS</displayName>
       <comment>An Hadoop Compatible File System</comment>
       <version>2.1.3.0</version>
       <components>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fb836708/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/STORM/configuration/global.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/STORM/configuration/global.xml b/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/STORM/configuration/global.xml
deleted file mode 100644
index fc65cfa..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/STORM/configuration/global.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
-<!--
-/**
- * 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.
- */
--->
-
-<configuration supports_final="false">
-  <property>
-    <name>storm_user</name>
-    <value>storm</value>
-    <description></description>
-  </property>
-  <property>
-    <name>storm_log_dir</name>
-    <value>/var/log/storm</value>
-    <description></description>
-  </property>
-  <property>
-    <name>storm_pid_dir</name>
-    <value>/var/run/storm</value>
-    <description></description>
-  </property>
-</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fb836708/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/STORM/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/STORM/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/STORM/metainfo.xml
index 14d8b56..5145c02 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/STORM/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/STORM/metainfo.xml
@@ -21,6 +21,7 @@
   <services>
     <service>
       <name>STORM</name>
+      <displayName>Storm</displayName>
       <comment>Apache Hadoop Stream processing framework</comment>
       <version>0.9.1.2.1</version>
       <components>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fb836708/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/TEZ/configuration/global.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/TEZ/configuration/global.xml b/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/TEZ/configuration/global.xml
deleted file mode 100644
index 5ae9df1..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/TEZ/configuration/global.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
-<!--
-/**
- * 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.
- */
--->
-
-<configuration supports_final="false">
-  <property>
-    <name>tez_user</name>
-    <value>tez</value>
-    <description></description>
-  </property>
-</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fb836708/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/TEZ/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/TEZ/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/TEZ/metainfo.xml
index 410266e..c5a9dff 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/TEZ/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/TEZ/metainfo.xml
@@ -20,18 +20,32 @@
   <services>
     <service>
       <name>TEZ</name>
+      <displayName>Tez</displayName>
       <comment>Tez is the next generation Hadoop Query Processing framework written on top of YARN.</comment>
       <version>0.4.0.2.1</version>
       <components>
         <component>
           <name>TEZ_CLIENT</name>
-          <cardinality>0+</cardinality>
+          <displayName>Tez Client</displayName>
+          <cardinality>1+</cardinality>
           <category>CLIENT</category>
           <commandScript>
             <script>scripts/tez_client.py</script>
             <scriptType>PYTHON</scriptType>
             <timeout>600</timeout>
           </commandScript>
+          <configFiles>
+            <configFile>
+              <type>xml</type>
+              <fileName>tez-site.xml</fileName>
+              <dictionaryName>tez-site</dictionaryName>
+            </configFile>
+            <configFile>
+              <type>env</type>
+              <fileName>tez-env.sh</fileName>
+              <dictionaryName>tez-env</dictionaryName>
+            </configFile>
+          </configFiles>
         </component>
       </components>
       <osSpecifics>
@@ -45,9 +59,13 @@
         </osSpecific>
       </osSpecifics>
 
+      <requiredServices>
+        <service>YARN</service>
+      </requiredServices>
+
       <configuration-dependencies>
-        <config-type>tez-env</config-type>
         <config-type>tez-site</config-type>
+        <config-type>tez-env</config-type>
       </configuration-dependencies>
 
     </service>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fb836708/ambari-web/app/models/stack_service.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/stack_service.js b/ambari-web/app/models/stack_service.js
index 89b2b81..80dfc4f 100644
--- a/ambari-web/app/models/stack_service.js
+++ b/ambari-web/app/models/stack_service.js
@@ -65,7 +65,8 @@ App.StackService = DS.Model.extend({
 
   configTypesRendered: function () {
     var configTypes = this.get('configTypes');
-    if (this.get('serviceName') == 'HDFS' || this.get('serviceName') == 'GLUSTERFS') return configTypes;
+    // if (this.get('serviceName') == 'HDFS' || this.get('serviceName') == 'GLUSTERFS') return configTypes;
+    if (this.get('serviceName') == 'HDFS') return configTypes;
     else {
       var renderedConfigTypes = $.extend(true, {}, configTypes);
       delete renderedConfigTypes['core-site'];
@@ -75,6 +76,7 @@ App.StackService = DS.Model.extend({
 
   displayNameOnSelectServicePage: function () {
     var displayName = this.get('displayName');
+    console.info("displayName = " + displayName);
     var services = this.get('coSelectedServices').slice();
     var serviceDisplayNames = services.map(function (item) {
       return App.format.role(item);


[03/45] git commit: AMBARI-7037. Slider View: Create Slider app wizard should show configs in sections (alexantonenko)

Posted by jo...@apache.org.
AMBARI-7037. Slider View: Create Slider app wizard should show configs in sections (alexantonenko)


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

Branch: refs/heads/branch-alerts-dev
Commit: eb08925ca4290ad26e90a5f353d97f1aed298422
Parents: c79fad2
Author: Alex Antonenko <hi...@gmail.com>
Authored: Wed Aug 27 17:39:02 2014 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Wed Aug 27 17:39:02 2014 +0300

----------------------------------------------------------------------
 .../ui/app/components/configSection.js          | 48 ++++++++++++++++++++
 .../createAppWizard/step3_controller.js         | 45 ++++++++++++++----
 .../src/main/resources/ui/app/helpers/helper.js |  5 +-
 .../app/templates/components/configSection.hbs  | 30 ++++++++++++
 .../ui/app/templates/createAppWizard/step3.hbs  |  4 +-
 5 files changed, 122 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/eb08925c/contrib/views/slider/src/main/resources/ui/app/components/configSection.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/components/configSection.js b/contrib/views/slider/src/main/resources/ui/app/components/configSection.js
new file mode 100644
index 0000000..7b2481d
--- /dev/null
+++ b/contrib/views/slider/src/main/resources/ui/app/components/configSection.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.
+ */
+
+App.ConfigSectionComponent = Em.Component.extend({
+  layoutName:'components/configSection',
+  config:null,
+  section:'',
+
+  /**
+   * label for current section
+   * @return {String}
+   */
+  sectionLabel: function () {
+    return this.get('section').classify();
+  }.property(),
+
+  /**
+   * Return True is section name equals 'general'
+   * @type {Boolean}
+   */
+  isGeneral:Ember.computed.equal('section', 'general'),
+
+  /**
+   * Filtered configs for current section
+   */
+  sectionConfigs: Ember.computed.filter('config', function(item) {
+    if (this.get('isGeneral')) {
+      return !item.name.match('^site.');
+    } else {
+      return !!item.name.match('^site.'+this.get('section')) ;
+    }
+  })
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb08925c/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js
index 2c34592..b98afb4 100644
--- a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js
+++ b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js
@@ -22,11 +22,30 @@ App.CreateAppWizardStep3Controller = Ember.ObjectController.extend({
 
   appWizardController: Ember.computed.alias("controllers.createAppWizard"),
 
+  newAppConfigs: Ember.computed.alias("appWizardController.newApp.configs"),
+
   /**
-   * Configs entered in TextArea
-   * @type {String}
+   * Configs entered in TextFields
+   * @type Array
    */
-  configs: '',
+  configs: Em.A(),
+
+  /**
+   * Convert configs to array of uniq section names
+   * @return {Array}
+   */
+  sectionKeys:function () {
+    var configs = this.get('newAppConfigs') || {},
+        k = ["general"];
+
+    Object.keys(configs).forEach(function (key) {
+      if (key.split('.')[0] == "site") {
+        k.push(key.split('.')[1])
+      }
+    });
+
+    return k.uniq();
+  }.property('newAppConfigs'),
 
   /**
    * Defines if <code>configs</code> are properly key-value formatted
@@ -54,10 +73,16 @@ App.CreateAppWizardStep3Controller = Ember.ObjectController.extend({
    * @method initConfigs
    */
   initConfigs: function() {
-    var c = JSON.stringify(this.get('appWizardController.newApp.configs')).replace(/",/g, '",\n');
-    c = c.substr(1, c.length - 2);
+    var configs = this.get('newAppConfigs') || {},
+        c = Em.A();
+
+    Object.keys(configs).forEach(function (key) {
+      var label = (!!key.match('^site.'))?key.substr(5):key;
+      c.push({name:key,value:configs[key],label:label})
+    });
+
     this.set('configs', c);
-  },
+  }.observes('newAppConfigs'),
 
   /**
    * Clear all initial data
@@ -76,8 +101,12 @@ App.CreateAppWizardStep3Controller = Ember.ObjectController.extend({
     var self = this;
     var result = true;
     var configs = this.get('configs');
+    var configsObject = {};
+
     try {
-      var configsObject = JSON.parse('{' + configs + '}');
+      configs.forEach(function (item) {
+        configsObject[item.name] = item.value;
+      })
       self.set('configsObject', configsObject);
     } catch (e) {
       self.set('isError', true);
@@ -91,7 +120,7 @@ App.CreateAppWizardStep3Controller = Ember.ObjectController.extend({
    * @method saveConfigs
    */
   saveConfigs: function () {
-    this.set('appWizardController.newApp.configs', this.get('configsObject'));
+    this.set('newAppConfigs', this.get('configsObject'));
   },
 
   actions: {

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb08925c/contrib/views/slider/src/main/resources/ui/app/helpers/helper.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/helpers/helper.js b/contrib/views/slider/src/main/resources/ui/app/helpers/helper.js
index bfa0a68..664328c 100644
--- a/contrib/views/slider/src/main/resources/ui/app/helpers/helper.js
+++ b/contrib/views/slider/src/main/resources/ui/app/helpers/helper.js
@@ -58,11 +58,14 @@ App.registerBoundHelper = function(name, view) {
 App.registerBoundHelper('formatWordBreak', Em.View.extend({
   tagName: 'span',
   template: Ember.Handlebars.compile('{{{view.result}}}'),
+  devider:'/',
 
   /**
    * @type {string}
    */
   result: function() {
-    return this.get('content') && this.get('content').replace(/\//g, '/<wbr />');
+    var d = this.get('devider');
+    var r = new RegExp('\\'+d,"g");
+    return this.get('content') && this.get('content').replace(r, d+'<wbr />');
   }.property('content')
 }));
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb08925c/contrib/views/slider/src/main/resources/ui/app/templates/components/configSection.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/templates/components/configSection.hbs b/contrib/views/slider/src/main/resources/ui/app/templates/components/configSection.hbs
new file mode 100644
index 0000000..9b47650
--- /dev/null
+++ b/contrib/views/slider/src/main/resources/ui/app/templates/components/configSection.hbs
@@ -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.
+}}
+
+{{#bs-panel heading=sectionLabel collapsible=true dismiss=false open=isGeneral }}
+  <form class="form-horizontal" role="form">
+    {{#each sectionConfigs}}
+    <div class="form-group">
+      <label class="col-sm-4 control-label">{{formatWordBreak label devider='.'}}</label>
+      <div class="col-sm-6">
+        {{input value=value class="form-control"}}
+      </div>
+    </div>
+    {{/each}}
+  </form>
+{{/bs-panel}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb08925c/contrib/views/slider/src/main/resources/ui/app/templates/createAppWizard/step3.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/templates/createAppWizard/step3.hbs b/contrib/views/slider/src/main/resources/ui/app/templates/createAppWizard/step3.hbs
index 6b81a1e..181e93e 100644
--- a/contrib/views/slider/src/main/resources/ui/app/templates/createAppWizard/step3.hbs
+++ b/contrib/views/slider/src/main/resources/ui/app/templates/createAppWizard/step3.hbs
@@ -20,7 +20,9 @@
   {{t wizard.step3.header}}
 </p>
 <div {{bind-attr class="controller.isError:has-error :form-group"}}>
-  {{view Ember.TextArea id="configs-text-area" valueBinding="controller.configs" classNames="form-control"}}
+  {{#each controller.sectionKeys}}
+    {{config-section section=this config=controller.configs}}
+  {{/each}}
   {{#if controller.isError}}
     <div class="alert alert-danger">{{t wizard.step3.error}}</div>
   {{/if}}