ambari git commit: AMBARI-14873. Capacity Scheduler View: Cannot delete 'root.default' queue when it should be. (Akhil PB via dipayanb)

2016-02-25 Thread dbhowmick
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 95ce453bd -> 6eb9e78d4


AMBARI-14873. Capacity Scheduler View: Cannot delete 'root.default' queue when 
it should be. (Akhil PB via dipayanb)


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

Branch: refs/heads/branch-2.2
Commit: 6eb9e78d438383df2ba38867f664a1c7a90785f6
Parents: 95ce453
Author: Dipayan Bhowmick 
Authored: Fri Feb 26 13:09:30 2016 +0530
Committer: Dipayan Bhowmick 
Committed: Fri Feb 26 13:10:18 2016 +0530

--
 .../src/main/resources/ui/app/components/confirmDelete.js| 7 ++-
 .../src/main/resources/ui/app/controllers/queue.js   | 8 +++-
 .../src/main/resources/ui/app/styles/application.less| 7 +++
 .../src/main/resources/ui/app/templates/queue.hbs| 2 +-
 4 files changed, 21 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/6eb9e78d/contrib/views/capacity-scheduler/src/main/resources/ui/app/components/confirmDelete.js
--
diff --git 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/components/confirmDelete.js
 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/components/confirmDelete.js
index 5ada051..d90d349 100644
--- 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/components/confirmDelete.js
+++ 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/components/confirmDelete.js
@@ -36,11 +36,16 @@ App.ConfirmDeleteComponent = 
Em.Component.extend(App.ClickElsewhereMixin,{
   tagName:'a',
   tooltip:function () {
 var element = this.$();
+var tooltipMsg = 'Click again to confirm';
+
+if (this.get('param.id') === 'root.default') {
+  tooltipMsg = "If default queue is removed, applications need to specify 
the queue name on submission. Click again to confirm.";
+}
 
 if (this.get('confirm')) {
   element.tooltip({
 placement:'left',
-title:'Click again to confirm'
+title:tooltipMsg
   }).tooltip('show');
 } else {
   element.tooltip('destroy');

http://git-wip-us.apache.org/repos/asf/ambari/blob/6eb9e78d/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queue.js
--
diff --git 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queue.js
 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queue.js
index 6d58e6d..589dcd0 100644
--- 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queue.js
+++ 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queue.js
@@ -200,7 +200,13 @@ App.QueueController = Ember.ObjectController.extend({
* Returns true if queue is root.
* @type {Boolean}
*/
-  isRoot:Ember.computed.match('content.id', /^(root|root.default)$/),
+   isRoot:Ember.computed.match('content.id', /^(root)$/),
+
+   /**
+* Returns true if queue is default.
+* @type {Boolean}
+*/
+   isDefaultQ:Ember.computed.match('content.id', /^(root.default)$/),
 
   /**
* Represents queue run state. Returns true if state is null.

http://git-wip-us.apache.org/repos/asf/ambari/blob/6eb9e78d/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less
--
diff --git 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less
 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less
index cd7de10..be79229 100644
--- 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less
+++ 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less
@@ -262,6 +262,13 @@
   text-shadow: 0px -1px 3px #111;
 }
   }
+  .del-default-q {
+.tooltip {
+  .tooltip-inner {
+max-width: 350px;
+  }
+}
+  }
 
 }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/6eb9e78d/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/queue.hbs
--
diff --git 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/queue.hbs
 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/queue.hbs
index bff1e4e..87f00d9 100644
--- 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/queue.hbs
+++ 

ambari git commit: AMBARI-14873. Capacity Scheduler View: Cannot delete 'root.default' queue when it should be. (Akhil PB via dipayanb)

2016-02-25 Thread dbhowmick
Repository: ambari
Updated Branches:
  refs/heads/trunk 7af320663 -> 0ea54c830


AMBARI-14873. Capacity Scheduler View: Cannot delete 'root.default' queue when 
it should be. (Akhil PB via dipayanb)


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

Branch: refs/heads/trunk
Commit: 0ea54c830fdc553d150fe2805e4cd88b843141fa
Parents: 7af3206
Author: Dipayan Bhowmick 
Authored: Fri Feb 26 13:09:30 2016 +0530
Committer: Dipayan Bhowmick 
Committed: Fri Feb 26 13:09:30 2016 +0530

--
 .../src/main/resources/ui/app/components/confirmDelete.js| 7 ++-
 .../src/main/resources/ui/app/controllers/queue.js   | 8 +++-
 .../src/main/resources/ui/app/styles/application.less| 7 +++
 .../src/main/resources/ui/app/templates/queue.hbs| 2 +-
 4 files changed, 21 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/0ea54c83/contrib/views/capacity-scheduler/src/main/resources/ui/app/components/confirmDelete.js
--
diff --git 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/components/confirmDelete.js
 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/components/confirmDelete.js
index 5ada051..d90d349 100644
--- 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/components/confirmDelete.js
+++ 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/components/confirmDelete.js
@@ -36,11 +36,16 @@ App.ConfirmDeleteComponent = 
Em.Component.extend(App.ClickElsewhereMixin,{
   tagName:'a',
   tooltip:function () {
 var element = this.$();
+var tooltipMsg = 'Click again to confirm';
+
+if (this.get('param.id') === 'root.default') {
+  tooltipMsg = "If default queue is removed, applications need to specify 
the queue name on submission. Click again to confirm.";
+}
 
 if (this.get('confirm')) {
   element.tooltip({
 placement:'left',
-title:'Click again to confirm'
+title:tooltipMsg
   }).tooltip('show');
 } else {
   element.tooltip('destroy');

http://git-wip-us.apache.org/repos/asf/ambari/blob/0ea54c83/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queue.js
--
diff --git 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queue.js
 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queue.js
index 6d58e6d..589dcd0 100644
--- 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queue.js
+++ 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queue.js
@@ -200,7 +200,13 @@ App.QueueController = Ember.ObjectController.extend({
* Returns true if queue is root.
* @type {Boolean}
*/
-  isRoot:Ember.computed.match('content.id', /^(root|root.default)$/),
+   isRoot:Ember.computed.match('content.id', /^(root)$/),
+
+   /**
+* Returns true if queue is default.
+* @type {Boolean}
+*/
+   isDefaultQ:Ember.computed.match('content.id', /^(root.default)$/),
 
   /**
* Represents queue run state. Returns true if state is null.

http://git-wip-us.apache.org/repos/asf/ambari/blob/0ea54c83/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less
--
diff --git 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less
 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less
index cd7de10..be79229 100644
--- 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less
+++ 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less
@@ -262,6 +262,13 @@
   text-shadow: 0px -1px 3px #111;
 }
   }
+  .del-default-q {
+.tooltip {
+  .tooltip-inner {
+max-width: 350px;
+  }
+}
+  }
 
 }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/0ea54c83/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/queue.hbs
--
diff --git 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/queue.hbs
 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/queue.hbs
index bff1e4e..87f00d9 100644
--- 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/queue.hbs
+++ 

ambari git commit: AMBARI-14852. Capacity Scheduler View - Provide dropdown for scheduling calculator. (Akhil PB via dipayanb)

2016-02-25 Thread dbhowmick
Repository: ambari
Updated Branches:
  refs/heads/trunk 1485e3f04 -> 7af320663


AMBARI-14852. Capacity Scheduler View - Provide dropdown for scheduling 
calculator. (Akhil PB via dipayanb)


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

Branch: refs/heads/trunk
Commit: 7af320663005f1c07d8f3973be501a704bac0e17
Parents: 1485e3f
Author: Dipayan Bhowmick 
Authored: Fri Feb 26 13:04:55 2016 +0530
Committer: Dipayan Bhowmick 
Committed: Fri Feb 26 13:05:47 2016 +0530

--
 .../src/main/resources/ui/app/controllers/queues.js   | 14 +-
 .../src/main/resources/ui/app/styles/application.less |  4 
 .../resources/ui/app/templates/schedulerPanel.hbs | 10 --
 3 files changed, 25 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7af32066/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queues.js
--
diff --git 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queues.js
 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queues.js
index 416ff43..4aeb442 100644
--- 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queues.js
+++ 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queues.js
@@ -416,5 +416,17 @@ App.QueuesController = Ember.ArrayController.extend({
 })
 
 return hasInvalidMapping;
-  
}.property('scheduler.queue_mappings','content.length','content.@each.capacity')
+  
}.property('scheduler.queue_mappings','content.length','content.@each.capacity'),
+
+  /**
+   * Resource calculator dropdown options
+   */
+  resourceCalculatorValues: [{
+label: 'Default Resource Calculator',
+value: 'org.apache.hadoop.yarn.util.resource.DefaultResourceCalculator'
+  }, {
+label: 'Dominant Resource Calculator',
+value: 'org.apache.hadoop.yarn.util.resource.DominantResourceCalculator'
+  }]
+
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/7af32066/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less
--
diff --git 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less
 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less
index 69fb96f..cd7de10 100644
--- 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less
+++ 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less
@@ -204,6 +204,10 @@
 }
   }
 }
+.input-resource-calc {
+   width: 85%;
+   display: inline-block;
+}
   }
 }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/7af32066/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/schedulerPanel.hbs
--
diff --git 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/schedulerPanel.hbs
 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/schedulerPanel.hbs
index 4419aa0..22bff46 100644
--- 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/schedulerPanel.hbs
+++ 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/schedulerPanel.hbs
@@ -106,10 +106,16 @@
 {{tooltip-label
   label='Calculator'
   class="col-xs-5 control-label"
-  message='The method by which the scheduler calculates resource 
capacity across resource types.'
+  message='The method by which the scheduler calculates resource 
capacity across resource types.  Default Resource Calculator allocates 
resources based on memory alone.  Dominant Resource Calculator allocates 
resources based on memory, cpu etc.'
 }}
 
-  {{expandable-input value=scheduler.resource_calculator 
class="input-sm form-control input-expand"}}
+  {{view Ember.Select
+class="form-control input-sm input-resource-calc"
+content=resourceCalculatorValues
+optionLabelPath="content.label"
+optionValuePath="content.value"
+value=scheduler.resource_calculator
+  }}
   {{#if schedulerDirtyFilelds.resource_calculator}}
 
 



ambari git commit: AMBARI-14852. Capacity Scheduler View - Provide dropdown for scheduling calculator. (Akhil PB via dipayanb)

2016-02-25 Thread dbhowmick
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 2588ab393 -> 95ce453bd


AMBARI-14852. Capacity Scheduler View - Provide dropdown for scheduling 
calculator. (Akhil PB via dipayanb)


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

Branch: refs/heads/branch-2.2
Commit: 95ce453bd67588e41a17459cd48e4a9c913a8315
Parents: 2588ab3
Author: Dipayan Bhowmick 
Authored: Fri Feb 26 13:04:55 2016 +0530
Committer: Dipayan Bhowmick 
Committed: Fri Feb 26 13:04:55 2016 +0530

--
 .../src/main/resources/ui/app/controllers/queues.js   | 14 +-
 .../src/main/resources/ui/app/styles/application.less |  4 
 .../resources/ui/app/templates/schedulerPanel.hbs | 10 --
 3 files changed, 25 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/95ce453b/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queues.js
--
diff --git 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queues.js
 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queues.js
index 416ff43..4aeb442 100644
--- 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queues.js
+++ 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queues.js
@@ -416,5 +416,17 @@ App.QueuesController = Ember.ArrayController.extend({
 })
 
 return hasInvalidMapping;
-  
}.property('scheduler.queue_mappings','content.length','content.@each.capacity')
+  
}.property('scheduler.queue_mappings','content.length','content.@each.capacity'),
+
+  /**
+   * Resource calculator dropdown options
+   */
+  resourceCalculatorValues: [{
+label: 'Default Resource Calculator',
+value: 'org.apache.hadoop.yarn.util.resource.DefaultResourceCalculator'
+  }, {
+label: 'Dominant Resource Calculator',
+value: 'org.apache.hadoop.yarn.util.resource.DominantResourceCalculator'
+  }]
+
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/95ce453b/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less
--
diff --git 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less
 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less
index 69fb96f..cd7de10 100644
--- 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less
+++ 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less
@@ -204,6 +204,10 @@
 }
   }
 }
+.input-resource-calc {
+   width: 85%;
+   display: inline-block;
+}
   }
 }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/95ce453b/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/schedulerPanel.hbs
--
diff --git 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/schedulerPanel.hbs
 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/schedulerPanel.hbs
index 4419aa0..22bff46 100644
--- 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/schedulerPanel.hbs
+++ 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/schedulerPanel.hbs
@@ -106,10 +106,16 @@
 {{tooltip-label
   label='Calculator'
   class="col-xs-5 control-label"
-  message='The method by which the scheduler calculates resource 
capacity across resource types.'
+  message='The method by which the scheduler calculates resource 
capacity across resource types.  Default Resource Calculator allocates 
resources based on memory alone.  Dominant Resource Calculator allocates 
resources based on memory, cpu etc.'
 }}
 
-  {{expandable-input value=scheduler.resource_calculator 
class="input-sm form-control input-expand"}}
+  {{view Ember.Select
+class="form-control input-sm input-resource-calc"
+content=resourceCalculatorValues
+optionLabelPath="content.label"
+optionValuePath="content.value"
+value=scheduler.resource_calculator
+  }}
   {{#if schedulerDirtyFilelds.resource_calculator}}
 
 



ambari git commit: AMBARI-14753. Capsched view: The view does not show the effective permissions of a queue. (Akhil PB via dipayanb)

2016-02-25 Thread dbhowmick
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 7e61c66f4 -> 2588ab393


AMBARI-14753. Capsched view: The view does not show the effective permissions 
of a queue. (Akhil PB via dipayanb)


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

Branch: refs/heads/branch-2.2
Commit: 2588ab3931d7f5b3e455dbd1f66fa541d6e12698
Parents: 7e61c66
Author: Dipayan Bhowmick 
Authored: Fri Feb 26 12:59:17 2016 +0530
Committer: Dipayan Bhowmick 
Committed: Fri Feb 26 13:00:10 2016 +0530

--
 .../main/resources/ui/app/controllers/queue.js  | 72 
 .../resources/ui/app/styles/application.less|  6 +-
 .../main/resources/ui/app/templates/queue.hbs   | 62 -
 3 files changed, 137 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/2588ab39/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queue.js
--
diff --git 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queue.js
 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queue.js
index 521b473..6d58e6d 100644
--- 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queue.js
+++ 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queue.js
@@ -244,6 +244,78 @@ App.QueueController = Ember.ObjectController.extend({
*/
   asa_anyone:Ember.computed.equal('acl_submit_applications', '*'),
 
+ /**
+  * Returns effective permission of the current queue to perform 
administrative functions on this queue.
+  */
+  aaq_effective_permission: function(key, value){
+return this.getEffectivePermission('acl_administer_queue');
+  }.property('content.acl_administer_queue'),
+
+  /**
+   * Returns effective permission of the current queue to submit application.
+   */
+  asa_effective_permission: function(key, value){
+return this.getEffectivePermission('acl_submit_applications');
+  }.property('content.acl_submit_applications'),
+
+  /**
+   * Returns effective permission of the current queue.
+   */
+  getEffectivePermission: function(permissionType){
+var effectivePermission,
+users = [],
+groups = [],
+currentPermissions = this.getPermissions(permissionType);
+for(var i = 0; i < currentPermissions.length; i++){
+  var permission = currentPermissions[i];
+  if (permission === '*') {
+return '*';
+  } else if (permission.trim() === '') {
+effectivePermission = '';
+  } else {
+var usersAndGroups = permission.split(' ');
+this.fillUsersAndGroups(users, usersAndGroups[0]);
+if (usersAndGroups.length === 2) {
+  this.fillUsersAndGroups(groups, usersAndGroups[1]);
+}
+  }
+}
+if(users.length > 0 || groups.length > 0){
+  effectivePermission = users.join(',') + ' ' + groups.join(',');
+}
+return effectivePermission;
+  },
+
+  /**
+   * Removes duplicate users or groups.
+   */
+  fillUsersAndGroups: function(usersOrGroups, list){
+var splitted = list.split(',');
+splitted.forEach(function(item){
+  if(usersOrGroups.indexOf(item) === -1){
+usersOrGroups.push(item);
+  }
+});
+  },
+
+  /**
+   * Returns array of permissions from root to leaf.
+   */
+  getPermissions: function(permissionType){
+var currentQ = this.get('content'),
+permissions = [];
+while (currentQ != null) {
+  if (currentQ.get(permissionType) !== null) {
+permissions.push(currentQ.get(permissionType));
+  } else {
+permissions.push('*');
+  }
+  currentQ = this.store.getById('queue', 
currentQ.get('parentPath').toLowerCase());
+}
+permissions.reverse();//root permission at the 0th position.
+return permissions;
+  },
+
   /**
* Error messages for queue path.
* @type {Array}

http://git-wip-us.apache.org/repos/asf/ambari/blob/2588ab39/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less
--
diff --git 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less
 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less
index c0acf4f..69fb96f 100644
--- 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less
+++ 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less
@@ -707,6 +707,10 @@
   opacity: 0.4;
 }
   }
+  

ambari git commit: AMBARI-14753. Capsched view: The view does not show the effective permissions of a queue. (Akhil PB via dipayanb)

2016-02-25 Thread dbhowmick
Repository: ambari
Updated Branches:
  refs/heads/trunk d1cec98c9 -> 1485e3f04


AMBARI-14753. Capsched view: The view does not show the effective permissions 
of a queue. (Akhil PB via dipayanb)


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

Branch: refs/heads/trunk
Commit: 1485e3f04730daa4e425fc72e7d577a5b646b068
Parents: d1cec98
Author: Dipayan Bhowmick 
Authored: Fri Feb 26 12:59:17 2016 +0530
Committer: Dipayan Bhowmick 
Committed: Fri Feb 26 12:59:17 2016 +0530

--
 .../main/resources/ui/app/controllers/queue.js  | 72 
 .../resources/ui/app/styles/application.less|  6 +-
 .../main/resources/ui/app/templates/queue.hbs   | 62 -
 3 files changed, 137 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/1485e3f0/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queue.js
--
diff --git 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queue.js
 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queue.js
index 521b473..6d58e6d 100644
--- 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queue.js
+++ 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queue.js
@@ -244,6 +244,78 @@ App.QueueController = Ember.ObjectController.extend({
*/
   asa_anyone:Ember.computed.equal('acl_submit_applications', '*'),
 
+ /**
+  * Returns effective permission of the current queue to perform 
administrative functions on this queue.
+  */
+  aaq_effective_permission: function(key, value){
+return this.getEffectivePermission('acl_administer_queue');
+  }.property('content.acl_administer_queue'),
+
+  /**
+   * Returns effective permission of the current queue to submit application.
+   */
+  asa_effective_permission: function(key, value){
+return this.getEffectivePermission('acl_submit_applications');
+  }.property('content.acl_submit_applications'),
+
+  /**
+   * Returns effective permission of the current queue.
+   */
+  getEffectivePermission: function(permissionType){
+var effectivePermission,
+users = [],
+groups = [],
+currentPermissions = this.getPermissions(permissionType);
+for(var i = 0; i < currentPermissions.length; i++){
+  var permission = currentPermissions[i];
+  if (permission === '*') {
+return '*';
+  } else if (permission.trim() === '') {
+effectivePermission = '';
+  } else {
+var usersAndGroups = permission.split(' ');
+this.fillUsersAndGroups(users, usersAndGroups[0]);
+if (usersAndGroups.length === 2) {
+  this.fillUsersAndGroups(groups, usersAndGroups[1]);
+}
+  }
+}
+if(users.length > 0 || groups.length > 0){
+  effectivePermission = users.join(',') + ' ' + groups.join(',');
+}
+return effectivePermission;
+  },
+
+  /**
+   * Removes duplicate users or groups.
+   */
+  fillUsersAndGroups: function(usersOrGroups, list){
+var splitted = list.split(',');
+splitted.forEach(function(item){
+  if(usersOrGroups.indexOf(item) === -1){
+usersOrGroups.push(item);
+  }
+});
+  },
+
+  /**
+   * Returns array of permissions from root to leaf.
+   */
+  getPermissions: function(permissionType){
+var currentQ = this.get('content'),
+permissions = [];
+while (currentQ != null) {
+  if (currentQ.get(permissionType) !== null) {
+permissions.push(currentQ.get(permissionType));
+  } else {
+permissions.push('*');
+  }
+  currentQ = this.store.getById('queue', 
currentQ.get('parentPath').toLowerCase());
+}
+permissions.reverse();//root permission at the 0th position.
+return permissions;
+  },
+
   /**
* Error messages for queue path.
* @type {Array}

http://git-wip-us.apache.org/repos/asf/ambari/blob/1485e3f0/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less
--
diff --git 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less
 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less
index c0acf4f..69fb96f 100644
--- 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less
+++ 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less
@@ -707,6 +707,10 @@
   opacity: 0.4;
 }
   }
+  .hz-divider 

ambari git commit: AMBARI-15100 OOM on TimelineMetricCache in Nodemanager (dsen)

2016-02-25 Thread dsen
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 27e510b82 -> 7e61c66f4


AMBARI-15100 OOM on TimelineMetricCache in Nodemanager (dsen)


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

Branch: refs/heads/branch-2.2
Commit: 7e61c66f4fc57e4f5a914fcc20407c787544f80d
Parents: 27e510b
Author: Dmytro Sen 
Authored: Fri Feb 26 09:25:43 2016 +0200
Committer: Dmytro Sen 
Committed: Fri Feb 26 09:27:57 2016 +0200

--
 .../timeline/cache/TimelineMetricsCache.java| 44 --
 .../cache/TimelineMetricsCacheTest.java | 64 +++-
 2 files changed, 87 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7e61c66f/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/cache/TimelineMetricsCache.java
--
diff --git 
a/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/cache/TimelineMetricsCache.java
 
b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/cache/TimelineMetricsCache.java
index 15bd5f4..3316a54 100644
--- 
a/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/cache/TimelineMetricsCache.java
+++ 
b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/cache/TimelineMetricsCache.java
@@ -24,9 +24,9 @@ import org.apache.hadoop.classification.InterfaceStability;
 import org.apache.hadoop.metrics2.sink.timeline.TimelineMetric;
 
 import java.util.HashMap;
-import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.TreeMap;
+import java.util.concurrent.ConcurrentSkipListMap;
 
 @InterfaceAudience.Public
 @InterfaceStability.Evolving
@@ -70,38 +70,46 @@ public class TimelineMetricsCache {
   }
 }
 
-public void putMetric(TimelineMetric metric) {
+public synchronized void putMetric(TimelineMetric metric) {
+  TreeMap metricValues = 
this.timelineMetric.getMetricValues();
+  if (metricValues.size() > maxRecsPerName) {
+// remove values for eldest maxEvictionTimeInMillis
+long newEldestTimestamp = oldestTimestamp + maxEvictionTimeInMillis;
+TreeMap metricsSubSet =
+  new TreeMap<>(metricValues.tailMap(newEldestTimestamp));
+if (metricsSubSet.isEmpty()) {
+  oldestTimestamp = metric.getStartTime();
+  this.timelineMetric.setStartTime(metric.getStartTime());
+} else {
+  Long newStartTime = metricsSubSet.firstKey();
+  oldestTimestamp = newStartTime;
+  this.timelineMetric.setStartTime(newStartTime);
+}
+this.timelineMetric.setMetricValues(metricsSubSet);
+LOG.warn("Metrics cache overflow. Values for metric " +
+  metric.getMetricName() + " older than " + newEldestTimestamp +
+  " were removed to clean up the cache.");
+  }
   this.timelineMetric.addMetricValues(metric.getMetricValues());
   updateTimeDiff(metric.getStartTime());
 }
 
-public long getTimeDiff() {
+public synchronized long getTimeDiff() {
   return timeDiff;
 }
 
-public TimelineMetric getTimelineMetric() {
+public synchronized TimelineMetric getTimelineMetric() {
   return timelineMetric;
 }
   }
 
-  // TODO: Change to ConcurentHashMap with weighted eviction
-  class TimelineMetricHolder extends LinkedHashMap {//
-private static final long serialVersionUID = 1L;
-private boolean gotOverflow = false;
+  // TODO: Add weighted eviction
+  class TimelineMetricHolder extends ConcurrentSkipListMap {
+private static final long serialVersionUID = 2L;
 // To avoid duplication at the end of the buffer and beginning of the next
 // segment of values
 private Map endOfBufferTimestamps = new HashMap();
 
-@Override
-protected boolean removeEldestEntry(Map.Entry eldest) {
-  boolean overflow = size() > maxRecsPerName;
-  if (overflow && !gotOverflow) {
-LOG.warn("Metrics cache overflow at "+ size() +" for "+ eldest);
-gotOverflow = true;
-  }
-  return overflow;
-}
-
 public TimelineMetric evict(String metricName) {
   TimelineMetricWrapper metricWrapper = this.get(metricName);
 


ambari git commit: AMBARI-15100 OOM on TimelineMetricCache in Nodemanager (dsen)

2016-02-25 Thread dsen
Repository: ambari
Updated Branches:
  refs/heads/trunk 29115e81e -> d1cec98c9


AMBARI-15100 OOM on TimelineMetricCache in Nodemanager (dsen)


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

Branch: refs/heads/trunk
Commit: d1cec98c9a98d8e183e13ceeb06e11ebd02a0701
Parents: 29115e8
Author: Dmytro Sen 
Authored: Fri Feb 26 09:25:43 2016 +0200
Committer: Dmytro Sen 
Committed: Fri Feb 26 09:25:43 2016 +0200

--
 .../timeline/cache/TimelineMetricsCache.java| 44 --
 .../cache/TimelineMetricsCacheTest.java | 64 +++-
 2 files changed, 87 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d1cec98c/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/cache/TimelineMetricsCache.java
--
diff --git 
a/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/cache/TimelineMetricsCache.java
 
b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/cache/TimelineMetricsCache.java
index 15bd5f4..3316a54 100644
--- 
a/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/cache/TimelineMetricsCache.java
+++ 
b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/cache/TimelineMetricsCache.java
@@ -24,9 +24,9 @@ import org.apache.hadoop.classification.InterfaceStability;
 import org.apache.hadoop.metrics2.sink.timeline.TimelineMetric;
 
 import java.util.HashMap;
-import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.TreeMap;
+import java.util.concurrent.ConcurrentSkipListMap;
 
 @InterfaceAudience.Public
 @InterfaceStability.Evolving
@@ -70,38 +70,46 @@ public class TimelineMetricsCache {
   }
 }
 
-public void putMetric(TimelineMetric metric) {
+public synchronized void putMetric(TimelineMetric metric) {
+  TreeMap metricValues = 
this.timelineMetric.getMetricValues();
+  if (metricValues.size() > maxRecsPerName) {
+// remove values for eldest maxEvictionTimeInMillis
+long newEldestTimestamp = oldestTimestamp + maxEvictionTimeInMillis;
+TreeMap metricsSubSet =
+  new TreeMap<>(metricValues.tailMap(newEldestTimestamp));
+if (metricsSubSet.isEmpty()) {
+  oldestTimestamp = metric.getStartTime();
+  this.timelineMetric.setStartTime(metric.getStartTime());
+} else {
+  Long newStartTime = metricsSubSet.firstKey();
+  oldestTimestamp = newStartTime;
+  this.timelineMetric.setStartTime(newStartTime);
+}
+this.timelineMetric.setMetricValues(metricsSubSet);
+LOG.warn("Metrics cache overflow. Values for metric " +
+  metric.getMetricName() + " older than " + newEldestTimestamp +
+  " were removed to clean up the cache.");
+  }
   this.timelineMetric.addMetricValues(metric.getMetricValues());
   updateTimeDiff(metric.getStartTime());
 }
 
-public long getTimeDiff() {
+public synchronized long getTimeDiff() {
   return timeDiff;
 }
 
-public TimelineMetric getTimelineMetric() {
+public synchronized TimelineMetric getTimelineMetric() {
   return timelineMetric;
 }
   }
 
-  // TODO: Change to ConcurentHashMap with weighted eviction
-  class TimelineMetricHolder extends LinkedHashMap {//
-private static final long serialVersionUID = 1L;
-private boolean gotOverflow = false;
+  // TODO: Add weighted eviction
+  class TimelineMetricHolder extends ConcurrentSkipListMap {
+private static final long serialVersionUID = 2L;
 // To avoid duplication at the end of the buffer and beginning of the next
 // segment of values
 private Map endOfBufferTimestamps = new HashMap();
 
-@Override
-protected boolean removeEldestEntry(Map.Entry eldest) {
-  boolean overflow = size() > maxRecsPerName;
-  if (overflow && !gotOverflow) {
-LOG.warn("Metrics cache overflow at "+ size() +" for "+ eldest);
-gotOverflow = true;
-  }
-  return overflow;
-}
-
 public TimelineMetric evict(String metricName) {
   TimelineMetricWrapper metricWrapper = this.get(metricName);
 


ambari git commit: AMBARI-15105: Add alerts for HAWQ components status (bhuvnesh2703 via jaoki)

2016-02-25 Thread jaoki
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 15933088c -> 27e510b82


AMBARI-15105: Add alerts for HAWQ components status (bhuvnesh2703 via jaoki)


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

Branch: refs/heads/branch-2.2
Commit: 27e510b82aefd61b31d3da4f420b455689516603
Parents: 1593308
Author: Jun Aoki 
Authored: Thu Feb 25 15:46:52 2016 -0800
Committer: Jun Aoki 
Committed: Thu Feb 25 15:46:52 2016 -0800

--
 .../common-services/HAWQ/2.0.0/alerts.json  |  93 +++-
 .../package/alerts/alert_component_status.py|  76 ++
 .../2.3/HAWQ/test_alert_component_status.py | 141 +++
 ambari-web/app/views/main/dashboard/widgets.js  |   2 +-
 4 files changed, 310 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/27e510b8/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/alerts.json
--
diff --git 
a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/alerts.json 
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/alerts.json
index 3119a0c..14ad6d7 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/alerts.json
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/alerts.json
@@ -1,5 +1,32 @@
 {
   "HAWQ": {
+"service": [
+  {
+"name": "hawq_segment_process_percent",
+"label": "Percent HAWQ Segments Available",
+"description": "This alert is triggered if the number of down HAWQ 
Segments in the cluster is greater than the configured critical threshold.",
+"interval": 1,
+"scope": "SERVICE",
+"enabled": true,
+"source": {
+  "type": "AGGREGATE",
+  "alert_name": "hawq_segment_process",
+  "reporting": {
+"ok": {
+  "text": "affected: [{1}], total: [{0}]"
+},
+"warning": {
+  "text": "affected: [{1}], total: [{0}]",
+  "value": 0.1
+},
+"critical": {
+  "text": "affected: [{1}], total: [{0}]",
+  "value": 0.3
+}
+  }
+}
+  }
+],
 "HAWQMASTER": [
   {
 "name": "hawqstandby_sync_status",
@@ -13,7 +40,71 @@
   "path": "HAWQ/2.0.0/package/alerts/alert_sync_status.py",
   "parameters": []
 }
+  },
+  {
+"name": "hawq_master_process",
+"label": "HAWQ Master Process",
+"description": "This alert is triggered if the HAWQ Master process 
cannot be confirmed to be up and listening on the network.",
+"interval": 1,
+"scope": "ANY",
+"source": {
+  "type": "SCRIPT",
+  "path": "HAWQ/2.0.0/package/alerts/alert_component_status.py",
+  "parameters": [
+{
+  "name": "component_name",
+  "display_name": "Component Name",
+  "value": "master",
+  "type": "STRING",
+  "description": "This text string indicates if it is a Master, 
Standby or Segment"
+}
+  ]
+}
+  }
+],
+"HAWQSEGMENT": [
+  {
+"name": "hawq_segment_process",
+"label": "HAWQ Segment Process",
+"description": "This host-level alert is triggered if the HAWQ Segment 
process cannot be confirmed to be up and listening on the network.",
+"interval": 1,
+"scope": "HOST",
+"source": {
+  "type": "SCRIPT",
+  "path": "HAWQ/2.0.0/package/alerts/alert_component_status.py",
+  "parameters": [
+{
+  "name": "component_name",
+  "display_name": "Component Name",
+  "value": "segment",
+  "type": "STRING",
+  "description": "This text string indicates if it is a Master, 
Standby or Segment"
+}
+  ]
+}
+  }
+],
+"HAWQSTANDBY": [
+  {
+"name": "hawq_standby_process",
+"label": "HAWQ Standby Process",
+"description": "This alert is triggered if the HAWQ Standby process 
cannot be confirmed to be up and listening on the network.",
+"interval": 1,
+"scope": "ANY",
+"source": {
+  "type": "SCRIPT",
+  "path": "HAWQ/2.0.0/package/alerts/alert_component_status.py",
+  "parameters": [
+{
+  "name": "component_name",
+  "display_name": "Component Name",
+  "value": "standby",
+  "type": "STRING",
+   

ambari git commit: AMBARI-15105: Add alerts for HAWQ components status (bhuvnesh2703 via jaoki)

2016-02-25 Thread jaoki
Repository: ambari
Updated Branches:
  refs/heads/trunk 8fb17ab09 -> 29115e81e


AMBARI-15105: Add alerts for HAWQ components status (bhuvnesh2703 via jaoki)


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

Branch: refs/heads/trunk
Commit: 29115e81ee2ba6643c7725903300f070c4ba2ea5
Parents: 8fb17ab
Author: Jun Aoki 
Authored: Thu Feb 25 15:45:58 2016 -0800
Committer: Jun Aoki 
Committed: Thu Feb 25 15:45:58 2016 -0800

--
 .../common-services/HAWQ/2.0.0/alerts.json  |  93 +++-
 .../package/alerts/alert_component_status.py|  76 ++
 .../2.3/HAWQ/test_alert_component_status.py | 141 +++
 ambari-web/app/views/main/dashboard/widgets.js  |   2 +-
 4 files changed, 310 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/29115e81/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/alerts.json
--
diff --git 
a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/alerts.json 
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/alerts.json
index 3119a0c..14ad6d7 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/alerts.json
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/alerts.json
@@ -1,5 +1,32 @@
 {
   "HAWQ": {
+"service": [
+  {
+"name": "hawq_segment_process_percent",
+"label": "Percent HAWQ Segments Available",
+"description": "This alert is triggered if the number of down HAWQ 
Segments in the cluster is greater than the configured critical threshold.",
+"interval": 1,
+"scope": "SERVICE",
+"enabled": true,
+"source": {
+  "type": "AGGREGATE",
+  "alert_name": "hawq_segment_process",
+  "reporting": {
+"ok": {
+  "text": "affected: [{1}], total: [{0}]"
+},
+"warning": {
+  "text": "affected: [{1}], total: [{0}]",
+  "value": 0.1
+},
+"critical": {
+  "text": "affected: [{1}], total: [{0}]",
+  "value": 0.3
+}
+  }
+}
+  }
+],
 "HAWQMASTER": [
   {
 "name": "hawqstandby_sync_status",
@@ -13,7 +40,71 @@
   "path": "HAWQ/2.0.0/package/alerts/alert_sync_status.py",
   "parameters": []
 }
+  },
+  {
+"name": "hawq_master_process",
+"label": "HAWQ Master Process",
+"description": "This alert is triggered if the HAWQ Master process 
cannot be confirmed to be up and listening on the network.",
+"interval": 1,
+"scope": "ANY",
+"source": {
+  "type": "SCRIPT",
+  "path": "HAWQ/2.0.0/package/alerts/alert_component_status.py",
+  "parameters": [
+{
+  "name": "component_name",
+  "display_name": "Component Name",
+  "value": "master",
+  "type": "STRING",
+  "description": "This text string indicates if it is a Master, 
Standby or Segment"
+}
+  ]
+}
+  }
+],
+"HAWQSEGMENT": [
+  {
+"name": "hawq_segment_process",
+"label": "HAWQ Segment Process",
+"description": "This host-level alert is triggered if the HAWQ Segment 
process cannot be confirmed to be up and listening on the network.",
+"interval": 1,
+"scope": "HOST",
+"source": {
+  "type": "SCRIPT",
+  "path": "HAWQ/2.0.0/package/alerts/alert_component_status.py",
+  "parameters": [
+{
+  "name": "component_name",
+  "display_name": "Component Name",
+  "value": "segment",
+  "type": "STRING",
+  "description": "This text string indicates if it is a Master, 
Standby or Segment"
+}
+  ]
+}
+  }
+],
+"HAWQSTANDBY": [
+  {
+"name": "hawq_standby_process",
+"label": "HAWQ Standby Process",
+"description": "This alert is triggered if the HAWQ Standby process 
cannot be confirmed to be up and listening on the network.",
+"interval": 1,
+"scope": "ANY",
+"source": {
+  "type": "SCRIPT",
+  "path": "HAWQ/2.0.0/package/alerts/alert_component_status.py",
+  "parameters": [
+{
+  "name": "component_name",
+  "display_name": "Component Name",
+  "value": "standby",
+  "type": "STRING",
+  

[3/3] ambari git commit: AMBARI-15168: HBASE_OPTS resets during Ambari 2.2 upgrade (Ajit Kumar via jluniya)

2016-02-25 Thread jluniya
AMBARI-15168: HBASE_OPTS resets during Ambari 2.2 upgrade (Ajit Kumar via 
jluniya)


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

Branch: refs/heads/branch-2.2
Commit: 15933088c5981c08600a176514282a7283ed14df
Parents: 82a914f
Author: Jayush Luniya 
Authored: Thu Feb 25 15:03:18 2016 -0800
Committer: Jayush Luniya 
Committed: Thu Feb 25 15:05:08 2016 -0800

--
 .../java/org/apache/ambari/server/upgrade/UpgradeCatalog220.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/15933088/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog220.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog220.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog220.java
index a434429..2330a21 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog220.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog220.java
@@ -1017,7 +1017,7 @@ public class UpgradeCatalog220 extends 
AbstractUpgradeCatalog {
 String content = hbaseEnvConfig.getProperties().get(CONTENT_PROPERTY);
 if (content != null) {
   if (!content.contains("-Djava.io.tmpdir")) {
-content += "\n\nexport 
HBASE_OPTS=\"-Djava.io.tmpdir={{java_io_tmpdir}}\"";
+content += "\n\nexport HBASE_OPTS=\"${HBASE_OPTS} 
-Djava.io.tmpdir={{java_io_tmpdir}}\"";
 updateConfig = true;
   }
   if (stackId != null && stackId.getStackName().equals("HDP") &&



[2/3] ambari git commit: AMBARI-15167: Host API fails with multi-value filter (Ajit Kumar via jluniya)

2016-02-25 Thread jluniya
AMBARI-15167: Host API fails with multi-value filter (Ajit Kumar via jluniya)


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

Branch: refs/heads/branch-2.2
Commit: 82a914f5580c2bf4cd5a36714237041fa240fbb8
Parents: 060babc
Author: Jayush Luniya 
Authored: Thu Feb 25 15:01:32 2016 -0800
Committer: Jayush Luniya 
Committed: Thu Feb 25 15:04:59 2016 -0800

--
 .../HostStackVersionResourceProvider.java   |  89 ++--
 .../HostStackVersionResourceProviderTest.java   | 135 +++
 2 files changed, 119 insertions(+), 105 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/82a914f5/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java
index c7e3ca9..1cd9c0a 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java
@@ -28,6 +28,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import com.google.common.collect.Sets;
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.StaticallyInject;
 import org.apache.ambari.server.actionmanager.ActionManager;
@@ -68,6 +69,7 @@ import org.apache.ambari.server.utils.StageUtils;
 import com.google.gson.Gson;
 import com.google.inject.Inject;
 import com.google.inject.Provider;
+import org.apache.commons.lang.Validate;
 
 /**
  * Resource provider for host stack versions resources.
@@ -90,33 +92,24 @@ public class HostStackVersionResourceProvider extends 
AbstractControllerResource
   protected static final String INSTALL_PACKAGES_FULL_NAME = "Install version";
 
 
-  @SuppressWarnings("serial")
-  private static Set pkPropertyIds = new HashSet() {
-{
-  add(HOST_STACK_VERSION_CLUSTER_NAME_PROPERTY_ID);
-  add(HOST_STACK_VERSION_HOST_NAME_PROPERTY_ID);
-  add(HOST_STACK_VERSION_ID_PROPERTY_ID);
-  add(HOST_STACK_VERSION_STACK_PROPERTY_ID);
-  add(HOST_STACK_VERSION_VERSION_PROPERTY_ID);
-  add(HOST_STACK_VERSION_REPO_VERSION_PROPERTY_ID);
-}
-  };
-
-  @SuppressWarnings("serial")
-  private static Set propertyIds = new HashSet() {
-{
-  add(HOST_STACK_VERSION_ID_PROPERTY_ID);
-  add(HOST_STACK_VERSION_CLUSTER_NAME_PROPERTY_ID);
-  add(HOST_STACK_VERSION_HOST_NAME_PROPERTY_ID);
-  add(HOST_STACK_VERSION_STACK_PROPERTY_ID);
-  add(HOST_STACK_VERSION_VERSION_PROPERTY_ID);
-  add(HOST_STACK_VERSION_STATE_PROPERTY_ID);
-  add(HOST_STACK_VERSION_REPOSITORIES_PROPERTY_ID);
-  add(HOST_STACK_VERSION_REPO_VERSION_PROPERTY_ID);
-}
-  };
+  private static Set pkPropertyIds = Sets.newHashSet(
+  HOST_STACK_VERSION_CLUSTER_NAME_PROPERTY_ID,
+  HOST_STACK_VERSION_HOST_NAME_PROPERTY_ID,
+  HOST_STACK_VERSION_ID_PROPERTY_ID,
+  HOST_STACK_VERSION_STACK_PROPERTY_ID,
+  HOST_STACK_VERSION_VERSION_PROPERTY_ID,
+  HOST_STACK_VERSION_REPO_VERSION_PROPERTY_ID);
+
+  private static Set propertyIds = Sets.newHashSet(
+  HOST_STACK_VERSION_ID_PROPERTY_ID,
+  HOST_STACK_VERSION_CLUSTER_NAME_PROPERTY_ID,
+  HOST_STACK_VERSION_HOST_NAME_PROPERTY_ID,
+  HOST_STACK_VERSION_STACK_PROPERTY_ID,
+  HOST_STACK_VERSION_VERSION_PROPERTY_ID,
+  HOST_STACK_VERSION_STATE_PROPERTY_ID,
+  HOST_STACK_VERSION_REPOSITORIES_PROPERTY_ID,
+  HOST_STACK_VERSION_REPO_VERSION_PROPERTY_ID);
 
-  @SuppressWarnings("serial")
   private static Map keyPropertyIds = new HashMap() {
 {
   put(Type.Cluster, HOST_STACK_VERSION_CLUSTER_NAME_PROPERTY_ID);
@@ -160,7 +153,7 @@ public class HostStackVersionResourceProvider extends 
AbstractControllerResource
   @Override
   public Set getResources(Request request, Predicate predicate) 
throws
   SystemException, UnsupportedPropertyException, NoSuchResourceException, 
NoSuchParentResourceException {
-final Set resources = new HashSet();
+final Set resources = new HashSet<>();
 final Set requestedIds = getRequestPropertyIds(request, predicate);
 final Set> propertyMaps = getPropertyMaps(predicate);
 
@@ -171,8 

[1/3] ambari git commit: AMBARI-15169: namenode_ha_utils.py returns sometimes Active NNs as emtpy set, and Stand-by NN as a set of 2 NNs in multi-homed environment (jluniya)

2016-02-25 Thread jluniya
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 844abe636 -> 15933088c


AMBARI-15169: namenode_ha_utils.py returns sometimes Active NNs as emtpy set, 
and Stand-by NN as a set of 2 NNs in multi-homed environment (jluniya)


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

Branch: refs/heads/branch-2.2
Commit: 060babc872a8697dd56e9ff83fa19420c8451b4d
Parents: 844abe6
Author: Jayush Luniya 
Authored: Thu Feb 25 14:50:11 2016 -0800
Committer: Jayush Luniya 
Committed: Thu Feb 25 15:04:39 2016 -0800

--
 .../libraries/functions/namenode_ha_utils.py| 29 
 .../package/alerts/alert_ha_namenode_health.py  | 14 --
 2 files changed, 36 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/060babc8/ambari-common/src/main/python/resource_management/libraries/functions/namenode_ha_utils.py
--
diff --git 
a/ambari-common/src/main/python/resource_management/libraries/functions/namenode_ha_utils.py
 
b/ambari-common/src/main/python/resource_management/libraries/functions/namenode_ha_utils.py
index 0920e85..36a34c1 100644
--- 
a/ambari-common/src/main/python/resource_management/libraries/functions/namenode_ha_utils.py
+++ 
b/ambari-common/src/main/python/resource_management/libraries/functions/namenode_ha_utils.py
@@ -33,7 +33,10 @@ HDFS_NN_STATE_STANDBY = 'standby'
 
 NAMENODE_HTTP_FRAGMENT = 'dfs.namenode.http-address.{0}.{1}'
 NAMENODE_HTTPS_FRAGMENT = 'dfs.namenode.https-address.{0}.{1}'
+NAMENODE_RPC_FRAGMENT = 'dfs.namenode.rpc-address.{0}.{1}'
+NAMENODE_RPC_NON_HA = 'dfs.namenode.rpc-address'
 JMX_URI_FRAGMENT = 
"{0}://{1}/jmx?qry=Hadoop:service=NameNode,name=FSNamesystem"
+INADDR_ANY = '0.0.0.0'
 
 def get_namenode_states(hdfs_site, security_enabled, run_user, times=10, 
sleep_time=1, backoff_factor=2):
   """
@@ -73,7 +76,8 @@ def get_namenode_states_noretries(hdfs_site, 
security_enabled, run_user):
   nn_unique_ids = hdfs_site[nn_unique_ids_key].split(',')
   for nn_unique_id in nn_unique_ids:
 is_https_enabled = hdfs_site['dfs.https.enable'] if not 
is_empty(hdfs_site['dfs.https.enable']) else False
-
+
+rpc_key = NAMENODE_RPC_FRAGMENT.format(name_service,nn_unique_id)
 if not is_https_enabled:
   key = NAMENODE_HTTP_FRAGMENT.format(name_service,nn_unique_id)
   protocol = "http"
@@ -84,6 +88,11 @@ def get_namenode_states_noretries(hdfs_site, 
security_enabled, run_user):
 if key in hdfs_site:
   # use str() to ensure that unicode strings do not have the u' in them
   value = str(hdfs_site[key])
+  if INADDR_ANY in value and rpc_key in hdfs_site:
+rpc_value = str(hdfs_site[rpc_key])
+if INADDR_ANY not in rpc_value:
+  rpc_host = rpc_value.split(":")[0]
+  value = value.replace(INADDR_ANY, rpc_host)
 
   jmx_uri = JMX_URI_FRAGMENT.format(protocol, value)
   
@@ -139,6 +148,8 @@ def get_property_for_active_namenode(hdfs_site, 
property_name, security_enabled,
 - In non-ha mode it will return hdfs_site[dfs.namenode.rpc-address]
 - In ha-mode it will return hdfs_site[dfs.namenode.rpc-address.nnha.nn2], 
where nnha is the name of HA, and nn2 is id of active NN
   """
+  value = None
+  rpc_key = None
   if is_ha_enabled(hdfs_site):
 name_service = hdfs_site['dfs.nameservices']
 active_namenodes = get_namenode_states(hdfs_site, security_enabled, 
run_user)[0]
@@ -147,8 +158,16 @@ def get_property_for_active_namenode(hdfs_site, 
property_name, security_enabled,
   raise Fail("There is no active namenodes.")
 
 active_namenode_id = active_namenodes[0][0]
-
-return 
hdfs_site[format("{property_name}.{name_service}.{active_namenode_id}")]
+value = 
hdfs_site[format("{property_name}.{name_service}.{active_namenode_id}")]
+rpc_key = NAMENODE_RPC_FRAGMENT.format(name_service,active_namenode_id)
   else:
-return hdfs_site[property_name]
-  
+value = hdfs_site[property_name]
+rpc_key = NAMENODE_RPC_NON_HA
+
+  if INADDR_ANY in value and rpc_key in hdfs_site:
+rpc_value = str(hdfs_site[rpc_key])
+if INADDR_ANY not in rpc_value:
+  rpc_host = rpc_value.split(":")[0]
+  value = value.replace(INADDR_ANY, rpc_host)
+
+  return value

http://git-wip-us.apache.org/repos/asf/ambari/blob/060babc8/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_ha_namenode_health.py
--
diff --git 

ambari git commit: AMBARI-15168: HBASE_OPTS resets during Ambari 2.2 upgrade (Ajit Kumar via jluniya)

2016-02-25 Thread jluniya
Repository: ambari
Updated Branches:
  refs/heads/trunk c3b3bac94 -> 8fb17ab09


AMBARI-15168: HBASE_OPTS resets during Ambari 2.2 upgrade (Ajit Kumar via 
jluniya)


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

Branch: refs/heads/trunk
Commit: 8fb17ab09e4b71817b5eea90097b2cb11979b5fb
Parents: c3b3bac
Author: Jayush Luniya 
Authored: Thu Feb 25 15:03:18 2016 -0800
Committer: Jayush Luniya 
Committed: Thu Feb 25 15:03:18 2016 -0800

--
 .../java/org/apache/ambari/server/upgrade/UpgradeCatalog220.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/8fb17ab0/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog220.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog220.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog220.java
index a434429..2330a21 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog220.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog220.java
@@ -1017,7 +1017,7 @@ public class UpgradeCatalog220 extends 
AbstractUpgradeCatalog {
 String content = hbaseEnvConfig.getProperties().get(CONTENT_PROPERTY);
 if (content != null) {
   if (!content.contains("-Djava.io.tmpdir")) {
-content += "\n\nexport 
HBASE_OPTS=\"-Djava.io.tmpdir={{java_io_tmpdir}}\"";
+content += "\n\nexport HBASE_OPTS=\"${HBASE_OPTS} 
-Djava.io.tmpdir={{java_io_tmpdir}}\"";
 updateConfig = true;
   }
   if (stackId != null && stackId.getStackName().equals("HDP") &&



ambari git commit: AMBARI-15167: Host API fails with multi-value filter (Ajit Kumar via jluniya)

2016-02-25 Thread jluniya
Repository: ambari
Updated Branches:
  refs/heads/trunk be893d040 -> c3b3bac94


AMBARI-15167: Host API fails with multi-value filter (Ajit Kumar via jluniya)


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

Branch: refs/heads/trunk
Commit: c3b3bac940e766914567f3c10ff85137a3ad3e14
Parents: be893d0
Author: Jayush Luniya 
Authored: Thu Feb 25 15:01:32 2016 -0800
Committer: Jayush Luniya 
Committed: Thu Feb 25 15:01:32 2016 -0800

--
 .../HostStackVersionResourceProvider.java   |  89 ++--
 .../HostStackVersionResourceProviderTest.java   | 135 +++
 2 files changed, 119 insertions(+), 105 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/c3b3bac9/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java
index c7e3ca9..1cd9c0a 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java
@@ -28,6 +28,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import com.google.common.collect.Sets;
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.StaticallyInject;
 import org.apache.ambari.server.actionmanager.ActionManager;
@@ -68,6 +69,7 @@ import org.apache.ambari.server.utils.StageUtils;
 import com.google.gson.Gson;
 import com.google.inject.Inject;
 import com.google.inject.Provider;
+import org.apache.commons.lang.Validate;
 
 /**
  * Resource provider for host stack versions resources.
@@ -90,33 +92,24 @@ public class HostStackVersionResourceProvider extends 
AbstractControllerResource
   protected static final String INSTALL_PACKAGES_FULL_NAME = "Install version";
 
 
-  @SuppressWarnings("serial")
-  private static Set pkPropertyIds = new HashSet() {
-{
-  add(HOST_STACK_VERSION_CLUSTER_NAME_PROPERTY_ID);
-  add(HOST_STACK_VERSION_HOST_NAME_PROPERTY_ID);
-  add(HOST_STACK_VERSION_ID_PROPERTY_ID);
-  add(HOST_STACK_VERSION_STACK_PROPERTY_ID);
-  add(HOST_STACK_VERSION_VERSION_PROPERTY_ID);
-  add(HOST_STACK_VERSION_REPO_VERSION_PROPERTY_ID);
-}
-  };
-
-  @SuppressWarnings("serial")
-  private static Set propertyIds = new HashSet() {
-{
-  add(HOST_STACK_VERSION_ID_PROPERTY_ID);
-  add(HOST_STACK_VERSION_CLUSTER_NAME_PROPERTY_ID);
-  add(HOST_STACK_VERSION_HOST_NAME_PROPERTY_ID);
-  add(HOST_STACK_VERSION_STACK_PROPERTY_ID);
-  add(HOST_STACK_VERSION_VERSION_PROPERTY_ID);
-  add(HOST_STACK_VERSION_STATE_PROPERTY_ID);
-  add(HOST_STACK_VERSION_REPOSITORIES_PROPERTY_ID);
-  add(HOST_STACK_VERSION_REPO_VERSION_PROPERTY_ID);
-}
-  };
+  private static Set pkPropertyIds = Sets.newHashSet(
+  HOST_STACK_VERSION_CLUSTER_NAME_PROPERTY_ID,
+  HOST_STACK_VERSION_HOST_NAME_PROPERTY_ID,
+  HOST_STACK_VERSION_ID_PROPERTY_ID,
+  HOST_STACK_VERSION_STACK_PROPERTY_ID,
+  HOST_STACK_VERSION_VERSION_PROPERTY_ID,
+  HOST_STACK_VERSION_REPO_VERSION_PROPERTY_ID);
+
+  private static Set propertyIds = Sets.newHashSet(
+  HOST_STACK_VERSION_ID_PROPERTY_ID,
+  HOST_STACK_VERSION_CLUSTER_NAME_PROPERTY_ID,
+  HOST_STACK_VERSION_HOST_NAME_PROPERTY_ID,
+  HOST_STACK_VERSION_STACK_PROPERTY_ID,
+  HOST_STACK_VERSION_VERSION_PROPERTY_ID,
+  HOST_STACK_VERSION_STATE_PROPERTY_ID,
+  HOST_STACK_VERSION_REPOSITORIES_PROPERTY_ID,
+  HOST_STACK_VERSION_REPO_VERSION_PROPERTY_ID);
 
-  @SuppressWarnings("serial")
   private static Map keyPropertyIds = new HashMap() {
 {
   put(Type.Cluster, HOST_STACK_VERSION_CLUSTER_NAME_PROPERTY_ID);
@@ -160,7 +153,7 @@ public class HostStackVersionResourceProvider extends 
AbstractControllerResource
   @Override
   public Set getResources(Request request, Predicate predicate) 
throws
   SystemException, UnsupportedPropertyException, NoSuchResourceException, 
NoSuchParentResourceException {
-final Set resources = new HashSet();
+final Set resources = new HashSet<>();
 final Set requestedIds = getRequestPropertyIds(request, predicate);
 final 

ambari git commit: AMBARI-15159. DBAccessor metadata API for schema check calls can return more than 1 result. (mpapirkovskyy)

2016-02-25 Thread mpapirkovskyy
Repository: ambari
Updated Branches:
  refs/heads/trunk 4221872a6 -> be893d040


AMBARI-15159. DBAccessor metadata API for schema check calls can return more 
than 1 result. (mpapirkovskyy)


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

Branch: refs/heads/trunk
Commit: be893d04004ebb17076e1416f96a576fded42984
Parents: 4221872
Author: Myroslav Papirkovskyi 
Authored: Wed Feb 24 17:46:53 2016 +0200
Committer: Myroslav Papirkovskyi 
Committed: Fri Feb 26 00:57:42 2016 +0200

--
 .../server/configuration/Configuration.java | 27 +-
 .../ambari/server/orm/DBAccessorImpl.java   | 54 ++-
 .../internal/AlertResourceProviderTest.java |  1 +
 .../ambari/server/orm/DBAccessorImplTest.java   | 57 +++-
 4 files changed, 122 insertions(+), 17 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/be893d04/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
index 882adb2..17fb42d 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
@@ -234,7 +234,8 @@ public class Configuration {
   public static final String JDBC_UNIT_NAME = "ambari-server";
   public static final String JDBC_LOCAL_URL = "jdbc:postgresql://localhost/";
   public static final String JDBC_LOCAL_DRIVER = "org.postgresql.Driver";
-  public static final String JDBC_IN_MEMORY_URL = 
"jdbc:derby:memory:myDB/ambari;create=true";
+  public static final String DEFAULT_DERBY_SCHEMA = "ambari";
+  public static final String JDBC_IN_MEMORY_URL = 
String.format("jdbc:derby:memory:myDB/%s;create=true", DEFAULT_DERBY_SCHEMA);
   public static final String JDBC_IN_MEMROY_DRIVER = 
"org.apache.derby.jdbc.EmbeddedDriver";
   public static final String HOSTNAME_MACRO = "{hostname}";
   public static final String JDBC_RCA_LOCAL_URL = "jdbc:postgresql://" + 
HOSTNAME_MACRO + "/ambarirca";
@@ -2258,6 +2259,30 @@ public class Configuration {
   }
 
   /**
+   * Gets the schema name of database
+   *
+   * @return the database schema name (can return {@code null} for any DB 
besides Postgres, MySQL, Oracle).
+   */
+  public String getDatabaseSchema() {
+DatabaseType databaseType = getDatabaseType();
+String databaseSchema;
+
+if (databaseType.equals(DatabaseType.POSTGRES)) {
+  databaseSchema = getServerJDBCPostgresSchemaName();
+} else if (databaseType.equals(DatabaseType.MYSQL)) {
+  databaseSchema = getServerDBName();
+} else if (databaseType.equals(DatabaseType.ORACLE)) {
+  databaseSchema = getDatabaseUser();
+} else if (databaseType.equals(DatabaseType.DERBY)) {
+  databaseSchema = DEFAULT_DERBY_SCHEMA;
+} else {
+  databaseSchema = null;
+}
+
+return databaseSchema;
+  }
+
+  /**
* Gets the type of connection pool that EclipseLink should use.
*
* @return default of {@link ConnectionPoolType#INTERNAL}.

http://git-wip-us.apache.org/repos/asf/ambari/blob/be893d04/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java
index 188efa7..b10d32a 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java
@@ -33,7 +33,9 @@ import java.sql.Statement;
 import java.sql.Types;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.configuration.Configuration.DatabaseType;
@@ -73,6 +75,7 @@ public class DBAccessorImpl implements DBAccessor {
   private DatabaseMetaData databaseMetaData;
   private static final String dbURLPatternString = "jdbc:(.*?):.*";
   private DbType dbType;
+  private final String dbSchema;
 
   @Inject
   public DBAccessorImpl(Configuration configuration) {
@@ -98,6 +101,7 @@ public class DBAccessorImpl implements DBAccessor {
   });
   

ambari git commit: AMBARI-15159. DBAccessor metadata API for schema check calls can return more than 1 result. (mpapirkovskyy)

2016-02-25 Thread mpapirkovskyy
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 6688e0065 -> 844abe636


AMBARI-15159. DBAccessor metadata API for schema check calls can return more 
than 1 result. (mpapirkovskyy)


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

Branch: refs/heads/branch-2.2
Commit: 844abe6367c1f68b1f2a3590f2884f47b5a1470e
Parents: 6688e00
Author: Myroslav Papirkovskyi 
Authored: Wed Feb 24 17:46:53 2016 +0200
Committer: Myroslav Papirkovskyi 
Committed: Fri Feb 26 00:55:48 2016 +0200

--
 .../server/configuration/Configuration.java | 27 +-
 .../ambari/server/orm/DBAccessorImpl.java   | 54 ++-
 .../internal/AlertResourceProviderTest.java |  1 +
 .../ambari/server/orm/DBAccessorImplTest.java   | 57 +++-
 4 files changed, 122 insertions(+), 17 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/844abe63/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
index 2986c15..0d7b2f9 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
@@ -221,7 +221,8 @@ public class Configuration {
   public static final String JDBC_UNIT_NAME = "ambari-server";
   public static final String JDBC_LOCAL_URL = "jdbc:postgresql://localhost/";
   public static final String JDBC_LOCAL_DRIVER = "org.postgresql.Driver";
-  public static final String JDBC_IN_MEMORY_URL = 
"jdbc:derby:memory:myDB/ambari;create=true";
+  public static final String DEFAULT_DERBY_SCHEMA = "ambari";
+  public static final String JDBC_IN_MEMORY_URL = 
String.format("jdbc:derby:memory:myDB/%s;create=true", DEFAULT_DERBY_SCHEMA);
   public static final String JDBC_IN_MEMROY_DRIVER = 
"org.apache.derby.jdbc.EmbeddedDriver";
   public static final String HOSTNAME_MACRO = "{hostname}";
   public static final String JDBC_RCA_LOCAL_URL = "jdbc:postgresql://" + 
HOSTNAME_MACRO + "/ambarirca";
@@ -2195,6 +2196,30 @@ public class Configuration {
   }
 
   /**
+   * Gets the schema name of database
+   *
+   * @return the database schema name (can return {@code null} for any DB 
besides Postgres, MySQL, Oracle).
+   */
+  public String getDatabaseSchema() {
+DatabaseType databaseType = getDatabaseType();
+String databaseSchema;
+
+if (databaseType.equals(DatabaseType.POSTGRES)) {
+  databaseSchema = getServerJDBCPostgresSchemaName();
+} else if (databaseType.equals(DatabaseType.MYSQL)) {
+  databaseSchema = getServerDBName();
+} else if (databaseType.equals(DatabaseType.ORACLE)) {
+  databaseSchema = getDatabaseUser();
+} else if (databaseType.equals(DatabaseType.DERBY)) {
+  databaseSchema = DEFAULT_DERBY_SCHEMA;
+} else {
+  databaseSchema = null;
+}
+
+return databaseSchema;
+  }
+
+  /**
* Gets the type of connection pool that EclipseLink should use.
*
* @return default of {@link ConnectionPoolType#INTERNAL}.

http://git-wip-us.apache.org/repos/asf/ambari/blob/844abe63/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java
index abd05bc..78ee0d1 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java
@@ -34,7 +34,9 @@ import java.sql.Types;
 import java.text.MessageFormat;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.orm.helpers.ScriptRunner;
@@ -72,6 +74,7 @@ public class DBAccessorImpl implements DBAccessor {
   private DatabaseMetaData databaseMetaData;
   private static final String dbURLPatternString = "jdbc:(.*?):.*";
   private DbType dbType;
+  private final String dbSchema;
 
   @Inject
   public DBAccessorImpl(Configuration configuration) {
@@ -97,6 +100,7 @@ public class DBAccessorImpl implements DBAccessor {
   });
   

ambari git commit: Revert "AMBARI-15159. DBAccessor metadata API for schema check calls can return more than 1 result. (mpapirkovskyy)"

2016-02-25 Thread jluniya
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 ff93a998b -> 6688e0065


Revert "AMBARI-15159. DBAccessor metadata API for schema check calls can return 
more than 1 result. (mpapirkovskyy)"

This reverts commit 4d8bc0f636dfef646b77cd7fe394ec697046d22c.


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

Branch: refs/heads/branch-2.2
Commit: 6688e006516260406bf2557ad4dfda42ba345f5a
Parents: ff93a99
Author: Jayush Luniya 
Authored: Thu Feb 25 14:47:17 2016 -0800
Committer: Jayush Luniya 
Committed: Thu Feb 25 14:47:17 2016 -0800

--
 .../server/configuration/Configuration.java | 27 +-
 .../ambari/server/orm/DBAccessorImpl.java   | 54 +--
 .../ambari/server/orm/DBAccessorImplTest.java   | 57 +---
 3 files changed, 17 insertions(+), 121 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/6688e006/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
index 0d7b2f9..2986c15 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
@@ -221,8 +221,7 @@ public class Configuration {
   public static final String JDBC_UNIT_NAME = "ambari-server";
   public static final String JDBC_LOCAL_URL = "jdbc:postgresql://localhost/";
   public static final String JDBC_LOCAL_DRIVER = "org.postgresql.Driver";
-  public static final String DEFAULT_DERBY_SCHEMA = "ambari";
-  public static final String JDBC_IN_MEMORY_URL = 
String.format("jdbc:derby:memory:myDB/%s;create=true", DEFAULT_DERBY_SCHEMA);
+  public static final String JDBC_IN_MEMORY_URL = 
"jdbc:derby:memory:myDB/ambari;create=true";
   public static final String JDBC_IN_MEMROY_DRIVER = 
"org.apache.derby.jdbc.EmbeddedDriver";
   public static final String HOSTNAME_MACRO = "{hostname}";
   public static final String JDBC_RCA_LOCAL_URL = "jdbc:postgresql://" + 
HOSTNAME_MACRO + "/ambarirca";
@@ -2196,30 +2195,6 @@ public class Configuration {
   }
 
   /**
-   * Gets the schema name of database
-   *
-   * @return the database schema name (can return {@code null} for any DB 
besides Postgres, MySQL, Oracle).
-   */
-  public String getDatabaseSchema() {
-DatabaseType databaseType = getDatabaseType();
-String databaseSchema;
-
-if (databaseType.equals(DatabaseType.POSTGRES)) {
-  databaseSchema = getServerJDBCPostgresSchemaName();
-} else if (databaseType.equals(DatabaseType.MYSQL)) {
-  databaseSchema = getServerDBName();
-} else if (databaseType.equals(DatabaseType.ORACLE)) {
-  databaseSchema = getDatabaseUser();
-} else if (databaseType.equals(DatabaseType.DERBY)) {
-  databaseSchema = DEFAULT_DERBY_SCHEMA;
-} else {
-  databaseSchema = null;
-}
-
-return databaseSchema;
-  }
-
-  /**
* Gets the type of connection pool that EclipseLink should use.
*
* @return default of {@link ConnectionPoolType#INTERNAL}.

http://git-wip-us.apache.org/repos/asf/ambari/blob/6688e006/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java
index 78ee0d1..abd05bc 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java
@@ -34,9 +34,7 @@ import java.sql.Types;
 import java.text.MessageFormat;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.HashSet;
 import java.util.List;
-import java.util.Set;
 
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.orm.helpers.ScriptRunner;
@@ -74,7 +72,6 @@ public class DBAccessorImpl implements DBAccessor {
   private DatabaseMetaData databaseMetaData;
   private static final String dbURLPatternString = "jdbc:(.*?):.*";
   private DbType dbType;
-  private final String dbSchema;
 
   @Inject
   public DBAccessorImpl(Configuration configuration) {
@@ -100,7 +97,6 @@ public class DBAccessorImpl implements DBAccessor {
   });
   databasePlatform = 

ambari git commit: AMBARI-15169: namenode_ha_utils.py returns sometimes Active NNs as emtpy set, and Stand-by NN as a set of 2 NNs in multi-homed environment (jluniya)

2016-02-25 Thread jluniya
Repository: ambari
Updated Branches:
  refs/heads/trunk a4deda347 -> 4221872a6


AMBARI-15169: namenode_ha_utils.py returns sometimes Active NNs as emtpy set, 
and Stand-by NN as a set of 2 NNs in multi-homed environment (jluniya)


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

Branch: refs/heads/trunk
Commit: 4221872a6d9827ba3e026c767c3f3f7efe01bee0
Parents: a4deda3
Author: Jayush Luniya 
Authored: Thu Feb 25 14:50:11 2016 -0800
Committer: Jayush Luniya 
Committed: Thu Feb 25 14:50:11 2016 -0800

--
 .../libraries/functions/namenode_ha_utils.py| 29 
 .../package/alerts/alert_ha_namenode_health.py  | 14 --
 2 files changed, 36 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/4221872a/ambari-common/src/main/python/resource_management/libraries/functions/namenode_ha_utils.py
--
diff --git 
a/ambari-common/src/main/python/resource_management/libraries/functions/namenode_ha_utils.py
 
b/ambari-common/src/main/python/resource_management/libraries/functions/namenode_ha_utils.py
index 0920e85..36a34c1 100644
--- 
a/ambari-common/src/main/python/resource_management/libraries/functions/namenode_ha_utils.py
+++ 
b/ambari-common/src/main/python/resource_management/libraries/functions/namenode_ha_utils.py
@@ -33,7 +33,10 @@ HDFS_NN_STATE_STANDBY = 'standby'
 
 NAMENODE_HTTP_FRAGMENT = 'dfs.namenode.http-address.{0}.{1}'
 NAMENODE_HTTPS_FRAGMENT = 'dfs.namenode.https-address.{0}.{1}'
+NAMENODE_RPC_FRAGMENT = 'dfs.namenode.rpc-address.{0}.{1}'
+NAMENODE_RPC_NON_HA = 'dfs.namenode.rpc-address'
 JMX_URI_FRAGMENT = 
"{0}://{1}/jmx?qry=Hadoop:service=NameNode,name=FSNamesystem"
+INADDR_ANY = '0.0.0.0'
 
 def get_namenode_states(hdfs_site, security_enabled, run_user, times=10, 
sleep_time=1, backoff_factor=2):
   """
@@ -73,7 +76,8 @@ def get_namenode_states_noretries(hdfs_site, 
security_enabled, run_user):
   nn_unique_ids = hdfs_site[nn_unique_ids_key].split(',')
   for nn_unique_id in nn_unique_ids:
 is_https_enabled = hdfs_site['dfs.https.enable'] if not 
is_empty(hdfs_site['dfs.https.enable']) else False
-
+
+rpc_key = NAMENODE_RPC_FRAGMENT.format(name_service,nn_unique_id)
 if not is_https_enabled:
   key = NAMENODE_HTTP_FRAGMENT.format(name_service,nn_unique_id)
   protocol = "http"
@@ -84,6 +88,11 @@ def get_namenode_states_noretries(hdfs_site, 
security_enabled, run_user):
 if key in hdfs_site:
   # use str() to ensure that unicode strings do not have the u' in them
   value = str(hdfs_site[key])
+  if INADDR_ANY in value and rpc_key in hdfs_site:
+rpc_value = str(hdfs_site[rpc_key])
+if INADDR_ANY not in rpc_value:
+  rpc_host = rpc_value.split(":")[0]
+  value = value.replace(INADDR_ANY, rpc_host)
 
   jmx_uri = JMX_URI_FRAGMENT.format(protocol, value)
   
@@ -139,6 +148,8 @@ def get_property_for_active_namenode(hdfs_site, 
property_name, security_enabled,
 - In non-ha mode it will return hdfs_site[dfs.namenode.rpc-address]
 - In ha-mode it will return hdfs_site[dfs.namenode.rpc-address.nnha.nn2], 
where nnha is the name of HA, and nn2 is id of active NN
   """
+  value = None
+  rpc_key = None
   if is_ha_enabled(hdfs_site):
 name_service = hdfs_site['dfs.nameservices']
 active_namenodes = get_namenode_states(hdfs_site, security_enabled, 
run_user)[0]
@@ -147,8 +158,16 @@ def get_property_for_active_namenode(hdfs_site, 
property_name, security_enabled,
   raise Fail("There is no active namenodes.")
 
 active_namenode_id = active_namenodes[0][0]
-
-return 
hdfs_site[format("{property_name}.{name_service}.{active_namenode_id}")]
+value = 
hdfs_site[format("{property_name}.{name_service}.{active_namenode_id}")]
+rpc_key = NAMENODE_RPC_FRAGMENT.format(name_service,active_namenode_id)
   else:
-return hdfs_site[property_name]
-  
+value = hdfs_site[property_name]
+rpc_key = NAMENODE_RPC_NON_HA
+
+  if INADDR_ANY in value and rpc_key in hdfs_site:
+rpc_value = str(hdfs_site[rpc_key])
+if INADDR_ANY not in rpc_value:
+  rpc_host = rpc_value.split(":")[0]
+  value = value.replace(INADDR_ANY, rpc_host)
+
+  return value

http://git-wip-us.apache.org/repos/asf/ambari/blob/4221872a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_ha_namenode_health.py
--
diff --git 

ambari git commit: AMBARI-14658: Ambari Metrics service does not show data for swap_total memory metric(bhuvnesh chaudhary via odiachenko).

2016-02-25 Thread odiachenko
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 b0a714937 -> ff93a998b


AMBARI-14658: Ambari Metrics service does not show data for swap_total memory 
metric(bhuvnesh chaudhary via odiachenko).


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

Branch: refs/heads/branch-2.2
Commit: ff93a998ba4232ed26b505dc30113cb422128e31
Parents: b0a7149
Author: Oleksandr Diachenko 
Authored: Thu Feb 25 14:19:32 2016 -0800
Committer: Oleksandr Diachenko 
Committed: Thu Feb 25 14:19:32 2016 -0800

--
 .../src/main/python/core/host_info.py | 2 ++
 .../src/main/resources/metrics_def/HOST.dat   | 3 ++-
 .../src/test/resources/ui_metrics_def/HOST.dat| 3 ++-
 3 files changed, 6 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ff93a998/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
--
diff --git 
a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
 
b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
index 007dd42..2e8c442 100644
--- 
a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
+++ 
b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
@@ -113,6 +113,7 @@ class HostInfo():
 swap_stats = psutil.swap_memory()
 disk_usage = self.get_combined_disk_usage()
 mem_total = self.__host_static_info.get('mem_total')
+swap_total = self.__host_static_info.get('swap_total')
 
 bytes2kilobytes = lambda x: x / 1024
 
@@ -124,6 +125,7 @@ class HostInfo():
   'mem_buffered': bytes2kilobytes(mem_stats.buffers) if hasattr(mem_stats, 
'buffers') else 0,
   'mem_cached': bytes2kilobytes(mem_stats.cached) if hasattr(mem_stats, 
'cached') else 0,
   'swap_free': bytes2kilobytes(swap_stats.free) if hasattr(swap_stats, 
'free') else 0,
+  'swap_total': bytes2kilobytes(swap_total) if swap_total else 0,
   'disk_free' : disk_usage.get("disk_free"),
   # todo: cannot send string
   #'part_max_used' : disk_usage.get("max_part_used")[0],

http://git-wip-us.apache.org/repos/asf/ambari/blob/ff93a998/ambari-metrics/ambari-metrics-timelineservice/src/main/resources/metrics_def/HOST.dat
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/resources/metrics_def/HOST.dat
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/resources/metrics_def/HOST.dat
index c940800..9295692 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/resources/metrics_def/HOST.dat
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/resources/metrics_def/HOST.dat
@@ -20,4 +20,5 @@ mem_free
 mem_shared
 pkts_in
 pkts_out
-swap_free
\ No newline at end of file
+swap_free
+swap_total

http://git-wip-us.apache.org/repos/asf/ambari/blob/ff93a998/ambari-metrics/ambari-metrics-timelineservice/src/test/resources/ui_metrics_def/HOST.dat
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/test/resources/ui_metrics_def/HOST.dat
 
b/ambari-metrics/ambari-metrics-timelineservice/src/test/resources/ui_metrics_def/HOST.dat
index 96e7ddd..b201515 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/test/resources/ui_metrics_def/HOST.dat
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/test/resources/ui_metrics_def/HOST.dat
@@ -75,5 +75,6 @@ mem_shared
 mem_free
 cpu_nice
 swap_free
+swap_total
 pkts_out
-|hostname|startTime|endTime|
\ No newline at end of file
+|hostname|startTime|endTime|



ambari git commit: AMBARI-15183. column "upgrade_id" does not exist upgrading to Ambari 2.4.0 (dlysnichenko)

2016-02-25 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 1621a53dc -> 1df953d68


AMBARI-15183. column "upgrade_id" does not exist upgrading to Ambari 2.4.0 
(dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 1df953d68aea7bc33d0fa01f5500c8e896c3abe7
Parents: 1621a53
Author: Lisnichenko Dmitro 
Authored: Thu Feb 25 21:23:34 2016 +0200
Committer: Lisnichenko Dmitro 
Committed: Thu Feb 25 21:23:34 2016 +0200

--
 .../server/upgrade/UpgradeCatalog240.java   | 17 
 .../server/upgrade/UpgradeCatalog240Test.java   | 27 
 2 files changed, 44 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/1df953d6/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java
index a3316c0..2f509b4 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java
@@ -32,6 +32,7 @@ import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.controller.AmbariManagementController;
+import org.apache.ambari.server.orm.DBAccessor;
 import org.apache.ambari.server.orm.DBAccessor.DBColumnInfo;
 import org.apache.ambari.server.orm.dao.AlertDefinitionDAO;
 import org.apache.ambari.server.orm.dao.PermissionDAO;
@@ -43,6 +44,7 @@ import 
org.apache.ambari.server.orm.entities.RoleAuthorizationEntity;
 import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.Clusters;
 import org.apache.ambari.server.state.RepositoryType;
+import org.apache.ambari.server.state.State;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.jdbc.support.JdbcUtils;
@@ -72,6 +74,10 @@ public class UpgradeCatalog240 extends 
AbstractUpgradeCatalog {
   protected static final String SERVICE_COMPONENT_HISTORY_TABLE = 
"servicecomponent_history";
   protected static final String UPGRADE_TABLE = "upgrade";
   protected static final String STACK_TABLE = "stack";
+  protected static final String CLUSTER_TABLE = "clusters";
+  protected static final String CLUSTER_UPGRADE_ID_COLUMN = "upgrade_id";
+  public static final String DESIRED_VERSION_COLUMN_NAME = "desired_version";
+
 
   @Inject
   PermissionDAO permissionDAO;
@@ -132,6 +138,14 @@ public class UpgradeCatalog240 extends 
AbstractUpgradeCatalog {
 updateRepoVersionTableDDL();
 updateServiceComponentDesiredStateTableDDL();
 createServiceComponentHistoryTable();
+updateClusterTableDDL();
+  }
+
+  private void updateClusterTableDDL() throws SQLException {
+dbAccessor.addColumn(CLUSTER_TABLE, new 
DBColumnInfo(CLUSTER_UPGRADE_ID_COLUMN, Long.class, null, null, true));
+
+dbAccessor.addFKConstraint(CLUSTER_TABLE, "FK_clusters_upgrade_id",
+CLUSTER_UPGRADE_ID_COLUMN, UPGRADE_TABLE, "upgrade_id", false);
   }
 
   @Override
@@ -562,5 +576,8 @@ public class UpgradeCatalog240 extends 
AbstractUpgradeCatalog {
 // recovery_enabled SMALLINT DEFAULT 0 NOT NULL
 dbAccessor.addColumn(SERVICE_COMPONENT_DESIRED_STATE_TABLE,
 new DBColumnInfo(RECOVERY_ENABLED_COL, Short.class, null, 0, 
false));
+
+dbAccessor.addColumn(SERVICE_COMPONENT_DESIRED_STATE_TABLE,
+  new DBColumnInfo(DESIRED_VERSION_COLUMN_NAME, String.class, 255, 
State.UNKNOWN.toString(), false));
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/1df953d6/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java
index f5fafbc..a909f84 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java
@@ -104,6 +104,8 @@ public class UpgradeCatalog240Test {
   public void testExecuteDDLUpdates() throws SQLException, AmbariException {
 Capture capturedColumnInfo = newCapture();
 Capture capturedScColumnInfo = newCapture();
+Capture 

ambari git commit: AMBARI-15173 - Express Upgrade Stuck At Manual Prompt Due To HRC Status Calculation Cache Problem (jonathanhurley)

2016-02-25 Thread jonathanhurley
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 d1b96572c -> a57c458c3


AMBARI-15173 - Express Upgrade Stuck At Manual Prompt Due To HRC Status 
Calculation Cache Problem (jonathanhurley)


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

Branch: refs/heads/branch-2.2
Commit: a57c458c39f7082468c7aa3944ee55a4e651f4a1
Parents: d1b9657
Author: Jonathan Hurley 
Authored: Wed Feb 24 18:02:00 2016 -0500
Committer: Jonathan Hurley 
Committed: Thu Feb 25 13:03:37 2016 -0500

--
 .../persist/jpa/AmbariJpaPersistModule.java |  64 ---
 .../ambari/annotations/TransactionalLock.java   | 148 
 .../actionmanager/ActionDBAccessorImpl.java |  28 ++-
 .../orm/AmbariJpaLocalTxnInterceptor.java   |  45 +++--
 .../orm/TransactionalLockInterceptor.java   |  84 +
 .../ambari/server/orm/TransactionalLocks.java   | 170 +++
 .../server/orm/dao/HostRoleCommandDAO.java  | 137 ++-
 .../stacks/HDP/2.3/upgrades/upgrade-2.4.xml |   8 +-
 .../annotations/TransactionalLockTest.java  | 126 ++
 9 files changed, 710 insertions(+), 100 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a57c458c/ambari-server/src/main/java/com/google/inject/persist/jpa/AmbariJpaPersistModule.java
--
diff --git 
a/ambari-server/src/main/java/com/google/inject/persist/jpa/AmbariJpaPersistModule.java
 
b/ambari-server/src/main/java/com/google/inject/persist/jpa/AmbariJpaPersistModule.java
index 4e4dd35..604546c 100644
--- 
a/ambari-server/src/main/java/com/google/inject/persist/jpa/AmbariJpaPersistModule.java
+++ 
b/ambari-server/src/main/java/com/google/inject/persist/jpa/AmbariJpaPersistModule.java
@@ -17,26 +17,9 @@
  */
 package com.google.inject.persist.jpa;
 
-import com.google.common.collect.Lists;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import com.google.inject.persist.PersistModule;
-import com.google.inject.persist.PersistService;
-import com.google.inject.persist.UnitOfWork;
-import com.google.inject.persist.finder.DynamicFinder;
-import com.google.inject.persist.finder.Finder;
-import com.google.inject.util.Providers;
-import org.aopalliance.intercept.MethodInterceptor;
-import org.aopalliance.intercept.MethodInvocation;
-import org.apache.ambari.server.orm.AmbariJpaLocalTxnInterceptor;
-import org.apache.ambari.server.orm.AmbariLocalSessionInterceptor;
-import org.apache.ambari.server.orm.RequiresSession;
-
 import static com.google.inject.matcher.Matchers.annotatedWith;
 import static com.google.inject.matcher.Matchers.any;
 
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
 import java.lang.reflect.AccessibleObject;
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Method;
@@ -44,6 +27,27 @@ import java.lang.reflect.Proxy;
 import java.util.List;
 import java.util.Properties;
 
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+
+import org.aopalliance.intercept.MethodInterceptor;
+import org.aopalliance.intercept.MethodInvocation;
+import org.apache.ambari.annotations.TransactionalLock;
+import org.apache.ambari.server.orm.AmbariJpaLocalTxnInterceptor;
+import org.apache.ambari.server.orm.AmbariLocalSessionInterceptor;
+import org.apache.ambari.server.orm.TransactionalLockInterceptor;
+import org.apache.ambari.server.orm.RequiresSession;
+
+import com.google.common.collect.Lists;
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+import com.google.inject.persist.PersistModule;
+import com.google.inject.persist.PersistService;
+import com.google.inject.persist.UnitOfWork;
+import com.google.inject.persist.finder.DynamicFinder;
+import com.google.inject.persist.finder.Finder;
+import com.google.inject.util.Providers;
+
 /**
  * Copy of guice persist module for local modifications
  */
@@ -60,7 +64,6 @@ public class AmbariJpaPersistModule extends PersistModule {
 
   private Properties properties;
   private MethodInterceptor transactionInterceptor;
-  private MethodInterceptor sessionInterceptor;
 
   @Override protected void configurePersistence() {
 bindConstant().annotatedWith(Jpa.class).to(jpaUnit);
@@ -68,8 +71,7 @@ public class AmbariJpaPersistModule extends PersistModule {
 if (null != properties) {
   bind(Properties.class).annotatedWith(Jpa.class).toInstance(properties);
 } else {
-  bind(Properties.class).annotatedWith(Jpa.class)
-  .toProvider(Providers.of(null));
+  

ambari git commit: AMBARI-15173 - Express Upgrade Stuck At Manual Prompt Due To HRC Status Calculation Cache Problem (jonathanhurley)

2016-02-25 Thread jonathanhurley
Repository: ambari
Updated Branches:
  refs/heads/trunk e4aeab5f8 -> 1621a53dc


AMBARI-15173 - Express Upgrade Stuck At Manual Prompt Due To HRC Status 
Calculation Cache Problem (jonathanhurley)


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

Branch: refs/heads/trunk
Commit: 1621a53dc5820ba1ca5bf5204628b51d341f0caa
Parents: e4aeab5
Author: Jonathan Hurley 
Authored: Wed Feb 24 18:02:00 2016 -0500
Committer: Jonathan Hurley 
Committed: Thu Feb 25 13:02:03 2016 -0500

--
 .../persist/jpa/AmbariJpaPersistModule.java |  64 ---
 .../ambari/annotations/TransactionalLock.java   | 148 
 .../actionmanager/ActionDBAccessorImpl.java |  28 ++-
 .../orm/AmbariJpaLocalTxnInterceptor.java   |  45 +++--
 .../orm/TransactionalLockInterceptor.java   |  84 +
 .../ambari/server/orm/TransactionalLocks.java   | 170 +++
 .../server/orm/dao/HostRoleCommandDAO.java  | 137 ++-
 .../stacks/HDP/2.3/upgrades/upgrade-2.4.xml |   8 +-
 .../annotations/TransactionalLockTest.java  | 126 ++
 9 files changed, 710 insertions(+), 100 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/1621a53d/ambari-server/src/main/java/com/google/inject/persist/jpa/AmbariJpaPersistModule.java
--
diff --git 
a/ambari-server/src/main/java/com/google/inject/persist/jpa/AmbariJpaPersistModule.java
 
b/ambari-server/src/main/java/com/google/inject/persist/jpa/AmbariJpaPersistModule.java
index 4e4dd35..604546c 100644
--- 
a/ambari-server/src/main/java/com/google/inject/persist/jpa/AmbariJpaPersistModule.java
+++ 
b/ambari-server/src/main/java/com/google/inject/persist/jpa/AmbariJpaPersistModule.java
@@ -17,26 +17,9 @@
  */
 package com.google.inject.persist.jpa;
 
-import com.google.common.collect.Lists;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import com.google.inject.persist.PersistModule;
-import com.google.inject.persist.PersistService;
-import com.google.inject.persist.UnitOfWork;
-import com.google.inject.persist.finder.DynamicFinder;
-import com.google.inject.persist.finder.Finder;
-import com.google.inject.util.Providers;
-import org.aopalliance.intercept.MethodInterceptor;
-import org.aopalliance.intercept.MethodInvocation;
-import org.apache.ambari.server.orm.AmbariJpaLocalTxnInterceptor;
-import org.apache.ambari.server.orm.AmbariLocalSessionInterceptor;
-import org.apache.ambari.server.orm.RequiresSession;
-
 import static com.google.inject.matcher.Matchers.annotatedWith;
 import static com.google.inject.matcher.Matchers.any;
 
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
 import java.lang.reflect.AccessibleObject;
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Method;
@@ -44,6 +27,27 @@ import java.lang.reflect.Proxy;
 import java.util.List;
 import java.util.Properties;
 
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+
+import org.aopalliance.intercept.MethodInterceptor;
+import org.aopalliance.intercept.MethodInvocation;
+import org.apache.ambari.annotations.TransactionalLock;
+import org.apache.ambari.server.orm.AmbariJpaLocalTxnInterceptor;
+import org.apache.ambari.server.orm.AmbariLocalSessionInterceptor;
+import org.apache.ambari.server.orm.TransactionalLockInterceptor;
+import org.apache.ambari.server.orm.RequiresSession;
+
+import com.google.common.collect.Lists;
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+import com.google.inject.persist.PersistModule;
+import com.google.inject.persist.PersistService;
+import com.google.inject.persist.UnitOfWork;
+import com.google.inject.persist.finder.DynamicFinder;
+import com.google.inject.persist.finder.Finder;
+import com.google.inject.util.Providers;
+
 /**
  * Copy of guice persist module for local modifications
  */
@@ -60,7 +64,6 @@ public class AmbariJpaPersistModule extends PersistModule {
 
   private Properties properties;
   private MethodInterceptor transactionInterceptor;
-  private MethodInterceptor sessionInterceptor;
 
   @Override protected void configurePersistence() {
 bindConstant().annotatedWith(Jpa.class).to(jpaUnit);
@@ -68,8 +71,7 @@ public class AmbariJpaPersistModule extends PersistModule {
 if (null != properties) {
   bind(Properties.class).annotatedWith(Jpa.class).toInstance(properties);
 } else {
-  bind(Properties.class).annotatedWith(Jpa.class)
-  .toProvider(Providers.of(null));
+  

ambari git commit: AMBARI-13946. Non NameNode-HA properties still in hdfs-site.xml causing (at least) Balancer and ATS to fail (akovalenko)

2016-02-25 Thread akovalenko
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 4c9c3c575 -> d1b96572c


AMBARI-13946. Non NameNode-HA properties still in hdfs-site.xml causing (at 
least) Balancer and ATS to fail (akovalenko)


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

Branch: refs/heads/branch-2.2
Commit: d1b96572c936cae7b86321e7eb38c66e152a6b94
Parents: 4c9c3c5
Author: Aleksandr Kovalenko 
Authored: Thu Feb 25 18:50:08 2016 +0200
Committer: Aleksandr Kovalenko 
Committed: Thu Feb 25 19:37:19 2016 +0200

--
 .../main/admin/highAvailability/nameNode/step3_controller.js   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d1b96572/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
 
b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
index 5baf90f..fa7c339 100644
--- 
a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
+++ 
b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
@@ -34,7 +34,7 @@ App.HighAvailabilityWizardStep3Controller = 
Em.Controller.extend({
* @type Object
*/
   configsToRemove: {
-'hdfs-site': ['dfs.namenode.secondary.http-address', 
'dfs.namenode.rpc-address']
+'hdfs-site': ['dfs.namenode.secondary.http-address', 
'dfs.namenode.rpc-address', 'dfs.namenode.http-address', 
'dfs.namenode.https-address']
   },
 
   clearStep: function () {



ambari git commit: AMBARI-13946. Non NameNode-HA properties still in hdfs-site.xml causing (at least) Balancer and ATS to fail (akovalenko)

2016-02-25 Thread akovalenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 0817b4d22 -> e4aeab5f8


AMBARI-13946. Non NameNode-HA properties still in hdfs-site.xml causing (at 
least) Balancer and ATS to fail (akovalenko)


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

Branch: refs/heads/trunk
Commit: e4aeab5f870cedfe3c97c75e126e856176c5f46b
Parents: 0817b4d
Author: Aleksandr Kovalenko 
Authored: Thu Feb 25 18:50:08 2016 +0200
Committer: Aleksandr Kovalenko 
Committed: Thu Feb 25 19:41:21 2016 +0200

--
 .../main/admin/highAvailability/nameNode/step3_controller.js   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e4aeab5f/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
 
b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
index 2df1ef4..7305861 100644
--- 
a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
+++ 
b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
@@ -46,7 +46,7 @@ App.HighAvailabilityWizardStep3Controller = 
Em.Controller.extend({
* @type Object
*/
   configsToRemove: {
-'hdfs-site': ['dfs.namenode.secondary.http-address', 
'dfs.namenode.rpc-address']
+'hdfs-site': ['dfs.namenode.secondary.http-address', 
'dfs.namenode.rpc-address', 'dfs.namenode.http-address', 
'dfs.namenode.https-address']
   },
 
   clearStep: function () {



[2/2] ambari git commit: AMBARI-15157. Cannot change hive.metastore.warehouse.dir to S3 (aonishuk)

2016-02-25 Thread aonishuk
AMBARI-15157. Cannot change hive.metastore.warehouse.dir to S3 (aonishuk)


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

Branch: refs/heads/branch-2.2
Commit: 4c9c3c575ea3c0b46be59d576a458ce413b98c6b
Parents: 4d8bc0f
Author: Andrew Onishuk 
Authored: Thu Feb 25 19:13:50 2016 +0200
Committer: Andrew Onishuk 
Committed: Thu Feb 25 19:13:50 2016 +0200

--
 .../HIVE/0.12.0.2.0/package/scripts/hive.py | 20 
 .../0.12.0.2.0/package/scripts/params_linux.py  |  3 +++
 2 files changed, 15 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/4c9c3c57/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
index 39b3433..f383e8f 100644
--- 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
@@ -177,14 +177,18 @@ def hive(name=None):
  host_sys_prepped=params.host_sys_prepped)
 # *** End Copy Tarballs ***
 # *
-
-# Create Hive Metastore Warehouse Dir
-params.HdfsResource(params.hive_apps_whs_dir,
- type="directory",
-  action="create_on_execute",
-  owner=params.hive_user,
-  mode=0777
-)
+
+# if warehouse directory is in DFS
+if not params.whs_dir_protocol or params.whs_dir_protocol == 
urlparse(params.default_fs).scheme:
+  # Create Hive Metastore Warehouse Dir
+  params.HdfsResource(params.hive_apps_whs_dir,
+   type="directory",
+action="create_on_execute",
+owner=params.hive_user,
+mode=0777
+  )
+else:
+  Logger.info(format("Not creating warehouse directory 
'{hive_apps_whs_dir}', as the location is not in DFS."))
 
 # Create Hive User Dir
 params.HdfsResource(params.hive_hdfs_user_dir,

http://git-wip-us.apache.org/repos/asf/ambari/blob/4c9c3c57/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
index a66b6d0..e25a9a0 100644
--- 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
@@ -22,6 +22,8 @@ import status_params
 import ambari_simplejson as json # simplejson is much faster comparing to 
Python 2.6 json module and has the same functions set.
 import os
 
+from urlparse import urlparse
+
 from ambari_commons.constants import AMBARI_SUDO_BINARY
 from ambari_commons.os_check import OSCheck
 
@@ -357,6 +359,7 @@ hive_env_sh_template = 
config['configurations']['hive-env']['content']
 hive_hdfs_user_dir = format("/user/{hive_user}")
 hive_hdfs_user_mode = 0755
 hive_apps_whs_dir = 
config['configurations']['hive-site']["hive.metastore.warehouse.dir"]
+whs_dir_protocol = urlparse(hive_apps_whs_dir).scheme
 hive_exec_scratchdir = 
config['configurations']['hive-site']["hive.exec.scratchdir"]
 #for create_hdfs_directory
 hdfs_user_keytab = config['configurations']['hadoop-env']['hdfs_user_keytab']



[1/2] ambari git commit: AMBARI-15157. Cannot change hive.metastore.warehouse.dir to S3 (aonishuk)

2016-02-25 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 4d8bc0f63 -> 4c9c3c575
  refs/heads/trunk c82f1337e -> 0817b4d22


AMBARI-15157. Cannot change hive.metastore.warehouse.dir to S3 (aonishuk)


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

Branch: refs/heads/trunk
Commit: 0817b4d22b17f8b797fb509827ca3e93d190621c
Parents: c82f133
Author: Andrew Onishuk 
Authored: Thu Feb 25 19:13:47 2016 +0200
Committer: Andrew Onishuk 
Committed: Thu Feb 25 19:13:47 2016 +0200

--
 .../HIVE/0.12.0.2.0/package/scripts/hive.py | 20 
 .../0.12.0.2.0/package/scripts/params_linux.py  |  3 +++
 2 files changed, 15 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/0817b4d2/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
index a141185..92e4ad7 100644
--- 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
@@ -177,14 +177,18 @@ def hive(name=None):
  host_sys_prepped=params.host_sys_prepped)
 # *** End Copy Tarballs ***
 # *
-
-# Create Hive Metastore Warehouse Dir
-params.HdfsResource(params.hive_apps_whs_dir,
- type="directory",
-  action="create_on_execute",
-  owner=params.hive_user,
-  mode=0777
-)
+
+# if warehouse directory is in DFS
+if not params.whs_dir_protocol or params.whs_dir_protocol == 
urlparse(params.default_fs).scheme:
+  # Create Hive Metastore Warehouse Dir
+  params.HdfsResource(params.hive_apps_whs_dir,
+   type="directory",
+action="create_on_execute",
+owner=params.hive_user,
+mode=0777
+  )
+else:
+  Logger.info(format("Not creating warehouse directory 
'{hive_apps_whs_dir}', as the location is not in DFS."))
 
 # Create Hive User Dir
 params.HdfsResource(params.hive_hdfs_user_dir,

http://git-wip-us.apache.org/repos/asf/ambari/blob/0817b4d2/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
index e9500d9..caaa9f3 100644
--- 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
@@ -22,6 +22,8 @@ import status_params
 import ambari_simplejson as json # simplejson is much faster comparing to 
Python 2.6 json module and has the same functions set.
 import os
 
+from urlparse import urlparse
+
 from ambari_commons.constants import AMBARI_SUDO_BINARY
 from ambari_commons.os_check import OSCheck
 
@@ -357,6 +359,7 @@ hive_env_sh_template = 
config['configurations']['hive-env']['content']
 hive_hdfs_user_dir = format("/user/{hive_user}")
 hive_hdfs_user_mode = 0755
 hive_apps_whs_dir = 
config['configurations']['hive-site']["hive.metastore.warehouse.dir"]
+whs_dir_protocol = urlparse(hive_apps_whs_dir).scheme
 hive_exec_scratchdir = 
config['configurations']['hive-site']["hive.exec.scratchdir"]
 #for create_hdfs_directory
 hdfs_user_keytab = config['configurations']['hadoop-env']['hdfs_user_keytab']



[1/2] ambari git commit: AMBARI-15159. DBAccessor metadata API for schema check calls can return more than 1 result. (mpapirkovskyy)

2016-02-25 Thread mpapirkovskyy
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 5edef8a68 -> 4d8bc0f63
  refs/heads/trunk ed954bbe8 -> c82f1337e


AMBARI-15159. DBAccessor metadata API for schema check calls can return more 
than 1 result. (mpapirkovskyy)


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

Branch: refs/heads/trunk
Commit: c82f1337e406b37d5515c5de4fc1a9d4b541f843
Parents: ed954bb
Author: Myroslav Papirkovskyi 
Authored: Wed Feb 24 17:46:53 2016 +0200
Committer: Myroslav Papirkovskyi 
Committed: Thu Feb 25 18:13:49 2016 +0200

--
 .../server/configuration/Configuration.java | 27 +-
 .../ambari/server/orm/DBAccessorImpl.java   | 54 ++-
 .../ambari/server/orm/DBAccessorImplTest.java   | 57 +++-
 3 files changed, 121 insertions(+), 17 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/c82f1337/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
index 882adb2..17fb42d 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
@@ -234,7 +234,8 @@ public class Configuration {
   public static final String JDBC_UNIT_NAME = "ambari-server";
   public static final String JDBC_LOCAL_URL = "jdbc:postgresql://localhost/";
   public static final String JDBC_LOCAL_DRIVER = "org.postgresql.Driver";
-  public static final String JDBC_IN_MEMORY_URL = 
"jdbc:derby:memory:myDB/ambari;create=true";
+  public static final String DEFAULT_DERBY_SCHEMA = "ambari";
+  public static final String JDBC_IN_MEMORY_URL = 
String.format("jdbc:derby:memory:myDB/%s;create=true", DEFAULT_DERBY_SCHEMA);
   public static final String JDBC_IN_MEMROY_DRIVER = 
"org.apache.derby.jdbc.EmbeddedDriver";
   public static final String HOSTNAME_MACRO = "{hostname}";
   public static final String JDBC_RCA_LOCAL_URL = "jdbc:postgresql://" + 
HOSTNAME_MACRO + "/ambarirca";
@@ -2258,6 +2259,30 @@ public class Configuration {
   }
 
   /**
+   * Gets the schema name of database
+   *
+   * @return the database schema name (can return {@code null} for any DB 
besides Postgres, MySQL, Oracle).
+   */
+  public String getDatabaseSchema() {
+DatabaseType databaseType = getDatabaseType();
+String databaseSchema;
+
+if (databaseType.equals(DatabaseType.POSTGRES)) {
+  databaseSchema = getServerJDBCPostgresSchemaName();
+} else if (databaseType.equals(DatabaseType.MYSQL)) {
+  databaseSchema = getServerDBName();
+} else if (databaseType.equals(DatabaseType.ORACLE)) {
+  databaseSchema = getDatabaseUser();
+} else if (databaseType.equals(DatabaseType.DERBY)) {
+  databaseSchema = DEFAULT_DERBY_SCHEMA;
+} else {
+  databaseSchema = null;
+}
+
+return databaseSchema;
+  }
+
+  /**
* Gets the type of connection pool that EclipseLink should use.
*
* @return default of {@link ConnectionPoolType#INTERNAL}.

http://git-wip-us.apache.org/repos/asf/ambari/blob/c82f1337/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java
index 188efa7..b10d32a 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java
@@ -33,7 +33,9 @@ import java.sql.Statement;
 import java.sql.Types;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.configuration.Configuration.DatabaseType;
@@ -73,6 +75,7 @@ public class DBAccessorImpl implements DBAccessor {
   private DatabaseMetaData databaseMetaData;
   private static final String dbURLPatternString = "jdbc:(.*?):.*";
   private DbType dbType;
+  private final String dbSchema;
 
   @Inject
   public DBAccessorImpl(Configuration configuration) {
@@ -98,6 +101,7 @@ public class DBAccessorImpl implements DBAccessor {
   });
   databasePlatform = 

[2/2] ambari git commit: AMBARI-15159. DBAccessor metadata API for schema check calls can return more than 1 result. (mpapirkovskyy)

2016-02-25 Thread mpapirkovskyy
AMBARI-15159. DBAccessor metadata API for schema check calls can return more 
than 1 result. (mpapirkovskyy)


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

Branch: refs/heads/branch-2.2
Commit: 4d8bc0f636dfef646b77cd7fe394ec697046d22c
Parents: 5edef8a
Author: Myroslav Papirkovskyi 
Authored: Wed Feb 24 17:46:53 2016 +0200
Committer: Myroslav Papirkovskyi 
Committed: Thu Feb 25 18:22:30 2016 +0200

--
 .../server/configuration/Configuration.java | 27 +-
 .../ambari/server/orm/DBAccessorImpl.java   | 54 ++-
 .../ambari/server/orm/DBAccessorImplTest.java   | 57 +++-
 3 files changed, 121 insertions(+), 17 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/4d8bc0f6/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
index 2986c15..0d7b2f9 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
@@ -221,7 +221,8 @@ public class Configuration {
   public static final String JDBC_UNIT_NAME = "ambari-server";
   public static final String JDBC_LOCAL_URL = "jdbc:postgresql://localhost/";
   public static final String JDBC_LOCAL_DRIVER = "org.postgresql.Driver";
-  public static final String JDBC_IN_MEMORY_URL = 
"jdbc:derby:memory:myDB/ambari;create=true";
+  public static final String DEFAULT_DERBY_SCHEMA = "ambari";
+  public static final String JDBC_IN_MEMORY_URL = 
String.format("jdbc:derby:memory:myDB/%s;create=true", DEFAULT_DERBY_SCHEMA);
   public static final String JDBC_IN_MEMROY_DRIVER = 
"org.apache.derby.jdbc.EmbeddedDriver";
   public static final String HOSTNAME_MACRO = "{hostname}";
   public static final String JDBC_RCA_LOCAL_URL = "jdbc:postgresql://" + 
HOSTNAME_MACRO + "/ambarirca";
@@ -2195,6 +2196,30 @@ public class Configuration {
   }
 
   /**
+   * Gets the schema name of database
+   *
+   * @return the database schema name (can return {@code null} for any DB 
besides Postgres, MySQL, Oracle).
+   */
+  public String getDatabaseSchema() {
+DatabaseType databaseType = getDatabaseType();
+String databaseSchema;
+
+if (databaseType.equals(DatabaseType.POSTGRES)) {
+  databaseSchema = getServerJDBCPostgresSchemaName();
+} else if (databaseType.equals(DatabaseType.MYSQL)) {
+  databaseSchema = getServerDBName();
+} else if (databaseType.equals(DatabaseType.ORACLE)) {
+  databaseSchema = getDatabaseUser();
+} else if (databaseType.equals(DatabaseType.DERBY)) {
+  databaseSchema = DEFAULT_DERBY_SCHEMA;
+} else {
+  databaseSchema = null;
+}
+
+return databaseSchema;
+  }
+
+  /**
* Gets the type of connection pool that EclipseLink should use.
*
* @return default of {@link ConnectionPoolType#INTERNAL}.

http://git-wip-us.apache.org/repos/asf/ambari/blob/4d8bc0f6/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java
index abd05bc..78ee0d1 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java
@@ -34,7 +34,9 @@ import java.sql.Types;
 import java.text.MessageFormat;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.orm.helpers.ScriptRunner;
@@ -72,6 +74,7 @@ public class DBAccessorImpl implements DBAccessor {
   private DatabaseMetaData databaseMetaData;
   private static final String dbURLPatternString = "jdbc:(.*?):.*";
   private DbType dbType;
+  private final String dbSchema;
 
   @Inject
   public DBAccessorImpl(Configuration configuration) {
@@ -97,6 +100,7 @@ public class DBAccessorImpl implements DBAccessor {
   });
   databasePlatform = (DatabasePlatform) 
Class.forName(dbPlatform).newInstance();
   dbmsHelper = loadHelper(databasePlatform);
+  dbSchema = 

ambari git commit: AMBARI-15160. YARN restart icon appeared after 5 minutes after reconfig (aonishuk)

2016-02-25 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 42b08a65c -> 5edef8a68


AMBARI-15160. YARN restart icon appeared after 5 minutes after reconfig 
(aonishuk)


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

Branch: refs/heads/branch-2.2
Commit: 5edef8a68c41fedaee171f40afd0fe204890aca5
Parents: 42b08a6
Author: Andrew Onishuk 
Authored: Thu Feb 25 18:17:25 2016 +0200
Committer: Andrew Onishuk 
Committed: Thu Feb 25 18:18:13 2016 +0200

--
 .../ambari/server/state/ConfigHelper.java   | 43 +++-
 .../ambari/server/state/ConfigHelperTest.java   |  2 +-
 2 files changed, 42 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/5edef8a6/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java 
b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
index aa30b48..30e4157 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
@@ -19,6 +19,8 @@ package org.apache.ambari.server.state;
 
 import com.google.common.cache.Cache;
 import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.RemovalListener;
+import com.google.common.cache.RemovalNotification;
 import com.google.common.collect.Maps;
 import com.google.inject.Inject;
 import com.google.inject.Singleton;
@@ -33,6 +35,7 @@ import 
org.apache.ambari.server.orm.entities.ClusterConfigEntity;
 import org.apache.ambari.server.state.PropertyInfo.PropertyType;
 import org.apache.ambari.server.state.configgroup.ConfigGroup;
 import org.apache.ambari.server.upgrade.UpgradeCatalog170;
+import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -83,6 +86,30 @@ public class ConfigHelper {
   public static final String HTTP_ONLY = "HTTP_ONLY";
   public static final String HTTPS_ONLY = "HTTPS_ONLY";
 
+  /**
+   * Used to debug stale config cache changes.
+   */
+  private class StaleConfigRemovalListener implements RemovalListener {
+
+@Override
+public void onRemoval(RemovalNotification removalNotification) {
+  ServiceComponentHost sch;
+  if(removalNotification.getKey() instanceof ServiceComponentHost)
+  {
+sch = (ServiceComponentHost)removalNotification.getKey();
+  } else {
+return;
+  }
+  String message = String.format(
+  "Removed stale config flag 
for:\n\thost:component=%s:%s\n\treason=%s",
+  sch.getHostName(),
+  sch.getServiceComponentName(),
+  removalNotification.getCause().toString()
+  );
+  LOG.info(message);
+}
+  }
+
   @Inject
   public ConfigHelper(Clusters c, AmbariMetaInfo metaInfo, Configuration 
configuration, ClusterDAO clusterDAO) {
 clusters = c;
@@ -90,7 +117,8 @@ public class ConfigHelper {
 this.clusterDAO = clusterDAO;
 STALE_CONFIGS_CACHE_ENABLED = configuration.isStaleConfigCacheEnabled();
 staleConfigsCache = CacheBuilder.newBuilder().
-expireAfterWrite(STALE_CONFIGS_CACHE_EXPIRATION_TIME, 
TimeUnit.SECONDS).build();
+expireAfterWrite(STALE_CONFIGS_CACHE_EXPIRATION_TIME, 
TimeUnit.SECONDS).
+removalListener(new StaleConfigRemovalListener()).build();
   }
 
   /**
@@ -977,6 +1005,17 @@ public class ConfigHelper {
 Map> desired = getEffectiveDesiredTags(cluster,
 sch.getHostName());
 
+ArrayList configs = new ArrayList<>();
+Iterator>> configIterator = 
desired.entrySet().iterator();
+while (configIterator.hasNext()) {
+  Entry> desiredEntry = configIterator.next();
+  configs.add(desiredEntry.getKey() + ":" + desiredEntry.getValue());
+}
+LOG.info(String.format(
+"Calculating stale configs for \n\tcomponent:%s\n\twith 
configs:%s",
+sch.getHostName() + ":" + sch.getServiceComponentName(),
+StringUtils.join(configs, ';')));
+
 ServiceInfo serviceInfo = ambariMetaInfo.getService(stackId.getStackName(),
 stackId.getStackVersion(), sch.getServiceName());
 ComponentInfo componentInfo = 
serviceInfo.getComponentByName(sch.getServiceComponentName());
@@ -1179,4 +1218,4 @@ public class ConfigHelper {
   }
 
 
-}
+}
\ No newline at end of file


ambari git commit: AMBARI-13002. Turning on the Maintenance mode wouldn't let you install the additional components properly (alexantonenko)

2016-02-25 Thread alexantonenko
Repository: ambari
Updated Branches:
  refs/heads/trunk efb4b8778 -> ed954bbe8


AMBARI-13002. Turning on the Maintenance mode wouldn't let you install the 
additional components properly (alexantonenko)


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

Branch: refs/heads/trunk
Commit: ed954bbe86575d8aa0730968c4642807fb87a6d5
Parents: efb4b87
Author: Alex Antonenko 
Authored: Thu Feb 25 17:47:45 2016 +0200
Committer: Alex Antonenko 
Committed: Thu Feb 25 18:09:37 2016 +0200

--
 .../app/controllers/main/admin/highAvailability_controller.js | 3 +++
 ambari-web/app/messages.js| 1 +
 2 files changed, 4 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ed954bbe/ambari-web/app/controllers/main/admin/highAvailability_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/admin/highAvailability_controller.js 
b/ambari-web/app/controllers/main/admin/highAvailability_controller.js
index 710e4d0..0bdd09c 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability_controller.js
@@ -39,6 +39,9 @@ App.MainAdminHighAvailabilityController = 
Em.Controller.extend({
 if (hostComponents.filterProperty('componentName', 
'ZOOKEEPER_SERVER').length < 3) {
   message.push(Em.I18n.t('admin.highAvailability.error.zooKeeperNum'));
 }
+if(hostComponents.filterProperty('isMaster', 
true).someProperty('passiveState', "ON") || 
hostComponents.filterProperty('isMaster', true).someProperty('isImpliedState', 
true)) {
+  message.push(Em.I18n.t('admin.highAvailability.error.maintenanceMode'));
+}
 
 if (App.router.get('mainHostController.hostsCountMap.TOTAL') < 3) {
   message.push(Em.I18n.t('admin.highAvailability.error.hostsNum'));

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed954bbe/ambari-web/app/messages.js
--
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 733ac86..1cefce2 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1171,6 +1171,7 @@ Em.I18n.translations = {
   'admin.highAvailability.confirmManualRollbackBody':'You are in the process 
of enabling NameNode HA. If you exit now, you must follow manual instructions 
to revert back to the non-HA setup as documented in the Ambari User Guide\'s 
Rolling Back NameNode HA section.  Are you sure you want to exit the 
wizard?',
   'admin.highAvailability.error.hostsNum':'You must have at least 3 hosts in 
your cluster to enable NameNode HA.',
   'admin.highAvailability.error.namenodeStarted':'NameNode must be running 
before you enable NameNode HA.',
+  'admin.highAvailability.error.maintenanceMode':'In order to enable NameNode 
HA, all services, and hosts with master components need to be out of 
Maintenance Mode.',
   'admin.highAvailability.error.zooKeeperNum':'You must have at least 3 
ZooKeeper Servers in your cluster to enable NameNode HA.',
   'admin.rm_highAvailability.error.hostsNum':'You must have at least 3 hosts 
in your cluster to enable ResourceManager HA.',
   'admin.rm_highAvailability.error.zooKeeperNum':'You must have at least 3 
ZooKeeper Servers in your cluster to enable ResourceManager HA.',



ambari git commit: AMBARI-13002. Turning on the Maintenance mode wouldn't let you install the additional components properly (alexantonenko)

2016-02-25 Thread alexantonenko
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 17e641638 -> 42b08a65c


AMBARI-13002. Turning on the Maintenance mode wouldn't let you install the 
additional components properly (alexantonenko)


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

Branch: refs/heads/branch-2.2
Commit: 42b08a65c4ba90150bb29ce813423128cce43f8b
Parents: 17e6416
Author: Alex Antonenko 
Authored: Thu Feb 25 18:03:02 2016 +0200
Committer: Alex Antonenko 
Committed: Thu Feb 25 18:08:57 2016 +0200

--
 .../controllers/main/admin/highAvailability_controller.js   | 9 +
 ambari-web/app/messages.js  | 1 +
 2 files changed, 10 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/42b08a65/ambari-web/app/controllers/main/admin/highAvailability_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/admin/highAvailability_controller.js 
b/ambari-web/app/controllers/main/admin/highAvailability_controller.js
index 710e4d0..8c3adc9 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability_controller.js
@@ -40,6 +40,15 @@ App.MainAdminHighAvailabilityController = 
Em.Controller.extend({
   message.push(Em.I18n.t('admin.highAvailability.error.zooKeeperNum'));
 }
 
+if(
+  hostComponents.filterProperty('isMaster', 
true).someProperty('passiveState', "ON") ||
+  hostComponents.filterProperty('isMaster', 
true).someProperty('passiveState', "IMPLIED_FROM_SERVICE_AND_HOST") ||
+  hostComponents.filterProperty('isMaster', 
true).someProperty('passiveState', "IMPLIED_FROM_HOST") ||
+  hostComponents.filterProperty('isMaster', 
true).someProperty('passiveState', "IMPLIED_FROM_SERVICE")
+) {
+  message.push(Em.I18n.t('admin.highAvailability.error.maintenanceMode'));
+}
+
 if (App.router.get('mainHostController.hostsCountMap.TOTAL') < 3) {
   message.push(Em.I18n.t('admin.highAvailability.error.hostsNum'));
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/42b08a65/ambari-web/app/messages.js
--
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index e74b662..1c3c208 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1139,6 +1139,7 @@ Em.I18n.translations = {
   'admin.highAvailability.confirmManualRollbackBody':'You are in the process 
of enabling NameNode HA. If you exit now, you must follow manual instructions 
to revert back to the non-HA setup as documented in the Ambari User Guide\'s 
Rolling Back NameNode HA section.  Are you sure you want to exit the 
wizard?',
   'admin.highAvailability.error.hostsNum':'You must have at least 3 hosts in 
your cluster to enable NameNode HA.',
   'admin.highAvailability.error.namenodeStarted':'NameNode must be running 
before you enable NameNode HA.',
+  'admin.highAvailability.error.maintenanceMode':'In order to enable NameNode 
HA, all services, and hosts with master components need to be out of 
Maintenance Mode.',
   'admin.highAvailability.error.zooKeeperNum':'You must have at least 3 
ZooKeeper Servers in your cluster to enable NameNode HA.',
   'admin.rm_highAvailability.error.hostsNum':'You must have at least 3 hosts 
in your cluster to enable ResourceManager HA.',
   'admin.rm_highAvailability.error.zooKeeperNum':'You must have at least 3 
ZooKeeper Servers in your cluster to enable ResourceManager HA.',



ambari git commit: AMBARI-14922 - Atlas Integration: Support Atlas / Falcon integration

2016-02-25 Thread tbeerbower
Repository: ambari
Updated Branches:
  refs/heads/trunk 46b4a797e -> efb4b8778


AMBARI-14922 - Atlas Integration: Support Atlas / Falcon integration


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

Branch: refs/heads/trunk
Commit: efb4b877850ca5d56153afe278d48a459b0f07b3
Parents: 46b4a79
Author: tbeerbower 
Authored: Thu Feb 25 09:50:37 2016 -0500
Committer: tbeerbower 
Committed: Thu Feb 25 09:50:37 2016 -0500

--
 .../configuration/application-properties.xml| 35 
 .../FALCON/0.5.0.2.1/package/scripts/falcon.py  | 15 +
 .../0.5.0.2.1/package/scripts/params_linux.py   | 29 +++-
 .../configuration/falcon-startup.properties.xml | 10 +-
 4 files changed, 79 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/efb4b877/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/application-properties.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/application-properties.xml
 
b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/application-properties.xml
index ed9f1bc..a6deda1 100644
--- 
a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/application-properties.xml
+++ 
b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/application-properties.xml
@@ -176,4 +176,39 @@
 21443
 
   
+  
+atlas.http.authentication.type
+simple
+
+  
+  
+atlas.hook.falcon.synchronous
+false
+
+  
+  
+atlas.hook.falcon.numRetries
+3
+
+  
+  
+atlas.hook.falcon.minThreads
+5
+
+  
+  
+atlas.hook.falcon.maxThreads
+5
+
+  
+  
+atlas.hook.falcon.keepAliveTime
+10
+
+  
+  
+atlas.hook.falcon.queueSize
+1000
+
+  
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/efb4b877/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py
 
b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py
index 81ea39e..ca967b0 100644
--- 
a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py
+++ 
b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py
@@ -27,6 +27,7 @@ from resource_management.core.resources.service import Service
 from resource_management.core.resources.service import ServiceConfig
 from resource_management.core.resources.system import Directory
 from resource_management.core.resources.system import File
+from resource_management.core.resources.system import Link
 from resource_management.libraries.script import Script
 from resource_management.libraries.resources import PropertiesFile
 from resource_management.libraries.functions import format
@@ -106,6 +107,11 @@ def falcon(type, action = None, upgrade_type=None):
 create_parents = True,
 cd_access = "a")
 
+if params.has_atlas:
+  Link(params.falcon_conf_dir + "/application.properties",
+   to = params.atlas_conf_dir + "/application.properties"
+   )
+
   if type == 'server':
 if action == 'config':
   if params.store_uri[0:4] == "hdfs":
@@ -176,6 +182,15 @@ def falcon(type, action = None, upgrade_type=None):
 path = params.hadoop_bin_dir,
 environment=environment_dictionary)
 
+  if params.has_atlas:
+atlas_falcon_hook_dir = params.atlas_home_dir + "/hook/falcon"
+src_files = os.listdir(atlas_falcon_hook_dir)
+for file_name in src_files:
+  atlas_falcon_hook_file_name = os.path.join(atlas_falcon_hook_dir, 
file_name)
+  falcon_lib_file_name = os.path.join(params.falcon_webinf_lib, 
file_name)
+  if (os.path.isfile(atlas_falcon_hook_file_name)):
+Link(falcon_lib_file_name, to = atlas_falcon_hook_file_name)
+
 if action == 'stop':
   Execute(format('{falcon_home}/bin/falcon-stop'),
 user = params.falcon_user,

http://git-wip-us.apache.org/repos/asf/ambari/blob/efb4b877/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/params_linux.py
--
diff --git 

ambari git commit: AMBARI-15181. JS error on UI load (onechiporenko)

2016-02-25 Thread onechiporenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 87f8746f4 -> 66ba9f294


AMBARI-15181. JS error on UI load (onechiporenko)


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

Branch: refs/heads/trunk
Commit: 66ba9f294f879d1636038b8873447207df130300
Parents: 87f8746
Author: Oleg Nechiporenko 
Authored: Thu Feb 25 15:04:55 2016 +0200
Committer: Oleg Nechiporenko 
Committed: Thu Feb 25 15:04:55 2016 +0200

--
 .../app/mappers/alert_definition_summary_mapper.js   | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/66ba9f29/ambari-web/app/mappers/alert_definition_summary_mapper.js
--
diff --git a/ambari-web/app/mappers/alert_definition_summary_mapper.js 
b/ambari-web/app/mappers/alert_definition_summary_mapper.js
index 72eeb01..8b59c7c 100644
--- a/ambari-web/app/mappers/alert_definition_summary_mapper.js
+++ b/ambari-web/app/mappers/alert_definition_summary_mapper.js
@@ -48,7 +48,7 @@ App.alertDefinitionSummaryMapper = 
App.QuickDataMapper.create({
 });
 summaryMap[alertDefinitionSummary.definition_id] = {
   summary: summary,
-  lastTriggered: App.dateTimeWithTimeZone(parseInt(timestamp)),
+  lastTriggered: App.dateTimeWithTimeZone(parseInt(timestamp, 10)),
   lastTriggeredRaw: timestamp
 };
   }
@@ -56,7 +56,7 @@ App.alertDefinitionSummaryMapper = 
App.QuickDataMapper.create({
 
 alertDefinitions.forEach(function (d) {
   var id = d.get('id');
-  if ((alertDefinitionsMap[id].get('stateManager.currentState.name') !== 
'saved')) {
+  if (alertDefinitionsMap[id].get('stateManager.currentState.name') !== 
'saved') {
 alertDefinitionsMap[id].get('stateManager').transitionTo('saved');
   }
   alertDefinitionsMap[id].setProperties(summaryMap[id]);
@@ -92,11 +92,10 @@ App.alertDefinitionSummaryMapper = 
App.QuickDataMapper.create({
   hasCriticalAlerts: hasCriticalAlerts
 });
 
-var masters = service.get('hostComponents').filterProperty('isMaster');
-masters.forEach(function (master) {
-  var hasCriticalAlerts = false;
+
service.get('hostComponents').filterProperty('isMaster').forEach(function 
(master) {
 
-  var alertsCount = 
groupedByComponentName[master.get('componentName')].map(function 
(alertDefinition) {
+  hasCriticalAlerts = false;
+  alertsCount = (groupedByComponentName[master.get('componentName')] 
|| []).map(function (alertDefinition) {
 
 var criticalCount = 
alertDefinition.getWithDefault('summary.CRITICAL.count', 0);
 var warningCount = 
alertDefinition.getWithDefault('summary.WARNING.count', 0);



[2/2] ambari git commit: AMBARI-15180. Remove duplicate code from widgets views (onechiporenko)

2016-02-25 Thread onechiporenko
AMBARI-15180. Remove duplicate code from widgets views (onechiporenko)


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

Branch: refs/heads/trunk
Commit: 87f8746f46494d688b5cc0ae6040ec137723b414
Parents: afc2f7b
Author: Oleg Nechiporenko 
Authored: Thu Feb 25 14:05:24 2016 +0200
Committer: Oleg Nechiporenko 
Committed: Thu Feb 25 14:15:25 2016 +0200

--
 ambari-web/app/mixins.js|   2 +
 .../mixins/main/dashboard/widgets/editable.js   | 124 
 .../dashboard/widgets/editable_with_limit.js| 138 +
 ambari-web/app/utils/ajax/ajax.js   |   2 +-
 ambari-web/app/views/main/dashboard/widget.js   |  63 +++---
 ambari-web/app/views/main/dashboard/widgets.js  |   4 +-
 .../dashboard/widgets/cluster_metrics_widget.js |   4 +
 .../main/dashboard/widgets/datanode_live.js | 200 +--
 .../main/dashboard/widgets/flume_agent_live.js  | 131 ++--
 .../main/dashboard/widgets/hawqsegment_live.js  | 191 +-
 .../dashboard/widgets/hbase_average_load.js | 109 +-
 .../views/main/dashboard/widgets/hbase_links.js |   6 +-
 .../main/dashboard/widgets/hbase_master_heap.js |   4 +-
 .../widgets/hbase_regions_in_transition.js  | 112 +--
 .../main/dashboard/widgets/hdfs_capacity.js |  34 ++--
 .../views/main/dashboard/widgets/hdfs_links.js  |   8 +-
 .../main/dashboard/widgets/links_widget.js  |   1 -
 .../main/dashboard/widgets/namenode_cpu.js  |  26 +--
 .../main/dashboard/widgets/namenode_heap.js |   5 +-
 .../main/dashboard/widgets/namenode_rpc.js  | 124 ++--
 .../dashboard/widgets/node_managers_live.js | 138 ++---
 .../main/dashboard/widgets/pie_chart_widget.js  |  41 ++--
 .../dashboard/widgets/resource_manager_heap.js  |   5 +-
 .../widgets/resource_manager_uptime.js  |   1 -
 .../main/dashboard/widgets/supervisor_live.js   | 133 ++--
 .../views/main/dashboard/widgets/text_widget.js |   9 +-
 .../dashboard/widgets/uptime_text_widget.js |   4 +-
 .../views/main/dashboard/widgets/yarn_memory.js |   1 -
 .../test/views/main/dashboard/widget_test.js|   2 +
 .../dashboard/widgets/datanode_live_test.js |  87 
 .../dashboard/widgets/hawqsegment_live_test.js  |  72 ---
 .../widgets/hbase_average_load_test.js  |  24 ---
 .../widgets/hbase_regions_in_transition_test.js |  24 ---
 .../main/dashboard/widgets/links_widget_test.js |   3 +
 .../main/dashboard/widgets/namenode_rpc_test.js |  14 --
 .../widgets/resource_manager_uptime_test.js |  12 --
 .../main/dashboard/widgets/text_widget_test.js  |  33 ---
 .../widgets/uptime_text_widget_test.js  |   7 +-
 38 files changed, 610 insertions(+), 1288 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/87f8746f/ambari-web/app/mixins.js
--
diff --git a/ambari-web/app/mixins.js b/ambari-web/app/mixins.js
index 460953e..0a686b3 100644
--- a/ambari-web/app/mixins.js
+++ b/ambari-web/app/mixins.js
@@ -28,6 +28,8 @@ require('mixins/common/reload_popup');
 require('mixins/common/serverValidator');
 require('mixins/common/table_server_view_mixin');
 require('mixins/common/table_server_mixin');
+require('mixins/main/dashboard/widgets/editable');
+require('mixins/main/dashboard/widgets/editable_with_limit');
 require('mixins/main/host/details/host_components/decommissionable');
 require('mixins/main/host/details/host_components/install_component');
 require('mixins/main/host/details/actions/install_new_version');

http://git-wip-us.apache.org/repos/asf/ambari/blob/87f8746f/ambari-web/app/mixins/main/dashboard/widgets/editable.js
--
diff --git a/ambari-web/app/mixins/main/dashboard/widgets/editable.js 
b/ambari-web/app/mixins/main/dashboard/widgets/editable.js
new file mode 100644
index 000..9081ee8
--- /dev/null
+++ b/ambari-web/app/mixins/main/dashboard/widgets/editable.js
@@ -0,0 +1,124 @@
+/**
+ * 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 

[1/2] ambari git commit: AMBARI-15180. Remove duplicate code from widgets views (onechiporenko)

2016-02-25 Thread onechiporenko
Repository: ambari
Updated Branches:
  refs/heads/trunk afc2f7b24 -> 87f8746f4


http://git-wip-us.apache.org/repos/asf/ambari/blob/87f8746f/ambari-web/app/views/main/dashboard/widgets/resource_manager_heap.js
--
diff --git 
a/ambari-web/app/views/main/dashboard/widgets/resource_manager_heap.js 
b/ambari-web/app/views/main/dashboard/widgets/resource_manager_heap.js
index 3e165f6..9509053 100644
--- a/ambari-web/app/views/main/dashboard/widgets/resource_manager_heap.js
+++ b/ambari-web/app/views/main/dashboard/widgets/resource_manager_heap.js
@@ -17,7 +17,6 @@
  */
 
 var App = require('app');
-var numberUtils = require('utils/number_utils');
 
 App.ResourceManagerHeapPieChartView = App.PieChartDashboardWidgetView.extend({
 
@@ -30,11 +29,11 @@ App.ResourceManagerHeapPieChartView = 
App.PieChartDashboardWidgetView.extend({
   widgetHtmlId: 'widget-rm-heap',
 
   getUsed: function() {
-return (this.get('model').get(this.get('modelFieldUsed')) / (1024 * 1024)) 
|| 0;
+return this.get('model').get(this.get('modelFieldUsed')) / (1024 * 1024) 
|| 0;
   },
 
   getMax: function() {
-return (this.get('model').get(this.get('modelFieldMax')) / (1024 * 1024)) 
|| 0;
+return this.get('model').get(this.get('modelFieldMax')) / (1024 * 1024) || 
0;
   },
 
   didInsertElement: function() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/87f8746f/ambari-web/app/views/main/dashboard/widgets/resource_manager_uptime.js
--
diff --git 
a/ambari-web/app/views/main/dashboard/widgets/resource_manager_uptime.js 
b/ambari-web/app/views/main/dashboard/widgets/resource_manager_uptime.js
index e67cf39..6d87741 100644
--- a/ambari-web/app/views/main/dashboard/widgets/resource_manager_uptime.js
+++ b/ambari-web/app/views/main/dashboard/widgets/resource_manager_uptime.js
@@ -17,7 +17,6 @@
  */
 
 var App = require('app');
-var date = require('utils/date/date');
 
 App.ResourceManagerUptimeView = App.UptimeTextDashboardWidgetView.extend({
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/87f8746f/ambari-web/app/views/main/dashboard/widgets/supervisor_live.js
--
diff --git a/ambari-web/app/views/main/dashboard/widgets/supervisor_live.js 
b/ambari-web/app/views/main/dashboard/widgets/supervisor_live.js
index 3b9e928..b8e36ca 100644
--- a/ambari-web/app/views/main/dashboard/widgets/supervisor_live.js
+++ b/ambari-web/app/views/main/dashboard/widgets/supervisor_live.js
@@ -18,22 +18,20 @@
 
 var App = require('app');
 
-App.SuperVisorUpView = App.TextDashboardWidgetView.extend({
+App.SuperVisorUpView = 
App.TextDashboardWidgetView.extend(App.EditableWithLimitWidgetMixin, {
 
   title: Em.I18n.t('dashboard.widgets.SuperVisorUp'),
   id: '21',
 
-  isPieChart: false,
-  isText: true,
-  isProgressBar: false,
   model_type: 'storm',
 
   hiddenInfo: function () {
-var result = [];
-result.pushObject(this.get('superVisorsLive') + ' ' + 
Em.I18n.t('dashboard.services.hdfs.nodes.live'));
-result.pushObject(this.get('superVisorsDead') + ' ' + 
Em.I18n.t('dashboard.services.hdfs.nodes.dead'));
-return result;
+return [
+  this.get('superVisorsLive') + ' ' + 
Em.I18n.t('dashboard.services.hdfs.nodes.live'),
+  this.get('superVisorsDead') + ' ' + 
Em.I18n.t('dashboard.services.hdfs.nodes.dead')
+];
   }.property('superVisorsLive', 'superVisorsDead'),
+
   hiddenInfoClass: "hidden-info-two-line",
 
   thresh1: 40,
@@ -49,126 +47,19 @@ App.SuperVisorUpView = App.TextDashboardWidgetView.extend({
   data: function () {
 if ( !this.get('superVisorsTotal') || 
Em.isNone(this.get('superVisorsLive'))) {
   return -1;
-} else {
-  return ((this.get('superVisorsLive') / 
this.get('superVisorsTotal')).toFixed(2)) * 100;
 }
+return (this.get('superVisorsLive') / 
this.get('superVisorsTotal')).toFixed(2) * 100;
   }.property('superVisorsTotal', 'superVisorsLive'),
 
   content: function () {
 if (!Em.isNone(this.get('superVisorsTotal')) && 
!Em.isNone(this.get('superVisorsLive'))) {
   return this.get('superVisorsLive') + "/" + this.get('superVisorsTotal');
-} else {
-  return Em.I18n.t('services.service.summary.notAvailable');
 }
+return Em.I18n.t('services.service.summary.notAvailable');
   }.property('superVisorsLive', 'superVisorsTotal'),
 
-  editWidget: function (event) {
-var parent = this;
-var max_tmp =  parseFloat(parent.get('maxValue'));
-var configObj = Ember.Object.create({
-  thresh1: parent.get('thresh1') + '',
-  thresh2: parent.get('thresh2') + '',
-  hintInfo: Em.I18n.t('dashboard.widgets.hintInfo.hint1').format(max_tmp),
-  isThresh1Error: false,
-  isThresh2Error: false,
-  errorMessage1: "",
-  errorMessage2: "",
-  maxValue: max_tmp,
-  observeNewThresholdValue: function () {
-var 

ambari git commit: AMBARI-15161. VERSION_MISMATCH Doesn't Change Back When Component Is Corrected (dlysnichenko)

2016-02-25 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 70c6dbc47 -> afc2f7b24


AMBARI-15161. VERSION_MISMATCH Doesn't Change Back When Component Is Corrected 
(dlysnichenko)


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

Branch: refs/heads/trunk
Commit: afc2f7b24f3112466432c9e5dcff07a4fa3931ff
Parents: 70c6dbc
Author: Lisnichenko Dmitro 
Authored: Thu Feb 25 14:01:23 2016 +0200
Committer: Lisnichenko Dmitro 
Committed: Thu Feb 25 14:04:52 2016 +0200

--
 .../events/listeners/upgrade/StackVersionListener.java  | 12 ++--
 .../main/java/org/apache/ambari/server/state/State.java |  3 ++-
 2 files changed, 12 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/afc2f7b2/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java
index e2a7795..9d989f1 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java
@@ -152,9 +152,11 @@ public class StackVersionListener {
   private void processComponentVersionChange(Cluster cluster, ServiceComponent 
sc,
  ServiceComponentHost sch,
  String newVersion) {
-if (sch.getUpgradeState().equals(UpgradeState.IN_PROGRESS)) {
+String desiredVersion = sc.getDesiredVersion();
+UpgradeState upgradeState = sch.getUpgradeState();
+if (upgradeState == UpgradeState.IN_PROGRESS) {
   // Component status update is received during upgrade process
-  if (sc.getDesiredVersion().equals(newVersion)) {
+  if (desiredVersion.equals(newVersion)) {
 sch.setUpgradeState(UpgradeState.COMPLETE);  // Component upgrade 
confirmed
 sch.setStackVersion(cluster.getDesiredStackVersion());
   } else { // Unexpected (wrong) version received
@@ -162,6 +164,12 @@ public class StackVersionListener {
 // That's why mark as VERSION_MISMATCH
 sch.setUpgradeState(UpgradeState.VERSION_MISMATCH);
   }
+} else if (upgradeState == UpgradeState.VERSION_MISMATCH && 
desiredVersion.equals(newVersion)) {
+  if (cluster.getUpgradeEntity() != null) {
+sch.setUpgradeState(UpgradeState.COMPLETE);
+  } else {
+sch.setUpgradeState(UpgradeState.NONE);
+  }
 } else { // No upgrade in progress, unexpected version change
   sch.setUpgradeState(UpgradeState.VERSION_MISMATCH);
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/afc2f7b2/ambari-server/src/main/java/org/apache/ambari/server/state/State.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/State.java 
b/ambari-server/src/main/java/org/apache/ambari/server/state/State.java
index 78af13f..c3f30c3 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/State.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/State.java
@@ -62,7 +62,8 @@ public enum State {
*/
   WIPING_OUT,
   /**
-   * In the process of upgrading the deployed bits.
+   * In the process of upgrading the host component deployed bits.
+   * Valid only for host component state
*/
   UPGRADING,
   /**



[2/2] ambari git commit: AMBARI-15155. Change in hadoop-env for YARN does not require YARN restart in Ambari (aonishuk)

2016-02-25 Thread aonishuk
AMBARI-15155. Change in hadoop-env for YARN does not require YARN restart in 
Ambari (aonishuk)


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

Branch: refs/heads/branch-2.2
Commit: be2745037b3dfcc085be9a6eb4015adca3f497d1
Parents: 78320ca
Author: Andrew Onishuk 
Authored: Thu Feb 25 12:44:02 2016 +0200
Committer: Andrew Onishuk 
Committed: Thu Feb 25 12:44:02 2016 +0200

--
 .../src/main/resources/common-services/YARN/2.1.0.2.0/metainfo.xml | 2 ++
 1 file changed, 2 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/be274503/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/metainfo.xml 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/metainfo.xml
index 41e19a3..0f71585 100644
--- 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/metainfo.xml
+++ 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/metainfo.xml
@@ -147,6 +147,7 @@
 yarn-site
 yarn-env
 hdfs-site
+hadoop-env
 core-site
 mapred-site
 yarn-log4j
@@ -251,6 +252,7 @@
 
   
 hdfs-site
+hadoop-env
 core-site
 mapred-site
 mapred-env



[1/2] ambari git commit: AMBARI-15155. Change in hadoop-env for YARN does not require YARN restart in Ambari (aonishuk)

2016-02-25 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 78320ca75 -> be2745037
  refs/heads/trunk 35db055aa -> 70c6dbc47


AMBARI-15155. Change in hadoop-env for YARN does not require YARN restart in 
Ambari (aonishuk)


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

Branch: refs/heads/trunk
Commit: 70c6dbc4701ed4ec73caec547c75c36b78fc8585
Parents: 35db055
Author: Andrew Onishuk 
Authored: Thu Feb 25 12:44:00 2016 +0200
Committer: Andrew Onishuk 
Committed: Thu Feb 25 12:44:00 2016 +0200

--
 .../src/main/resources/common-services/YARN/2.1.0.2.0/metainfo.xml | 2 ++
 1 file changed, 2 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/70c6dbc4/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/metainfo.xml 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/metainfo.xml
index 41e19a3..0f71585 100644
--- 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/metainfo.xml
+++ 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/metainfo.xml
@@ -147,6 +147,7 @@
 yarn-site
 yarn-env
 hdfs-site
+hadoop-env
 core-site
 mapred-site
 yarn-log4j
@@ -251,6 +252,7 @@
 
   
 hdfs-site
+hadoop-env
 core-site
 mapred-site
 mapred-env



ambari git commit: AMBARI-15163. 'ambari-server start' is failed [import FatalException, NonFatalException] after upgrade from 2.1.2 ... 2.2.0.0 etc to 2.2.1.1 (aonishuk)

2016-02-25 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 031f4bf91 -> 78320ca75


AMBARI-15163. 'ambari-server start' is failed [import FatalException, 
NonFatalException] after upgrade from 2.1.2 ... 2.2.0.0 etc  to 2.2.1.1 
(aonishuk)


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

Branch: refs/heads/branch-2.2
Commit: 78320ca75e634e663dacfc6c73da080c0b8fb3a0
Parents: 031f4bf
Author: Andrew Onishuk 
Authored: Thu Feb 25 12:42:00 2016 +0200
Committer: Andrew Onishuk 
Committed: Thu Feb 25 12:42:00 2016 +0200

--
 ambari-server/conf/unix/install-helper.sh | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/78320ca7/ambari-server/conf/unix/install-helper.sh
--
diff --git a/ambari-server/conf/unix/install-helper.sh 
b/ambari-server/conf/unix/install-helper.sh
index f3cff91..d01afc6 100644
--- a/ambari-server/conf/unix/install-helper.sh
+++ b/ambari-server/conf/unix/install-helper.sh
@@ -71,10 +71,12 @@ do_install(){
 ln -s "$AMBARI_PYTHON" "$PYTHON_WRAPER_TARGET"
   fi
 
-  PYTHON_PATH_LINE='export 
PYTHONPATH=$PYTHONPATH:/usr/lib/python2.6/site-packages'
-  grep "^$PYTHON_PATH_LINE\$" "$AMBARI_ENV_RPMSAVE" > /dev/null
-  if [ -f "$AMBARI_ENV_RPMSAVE" ] && [ $? -ne 0 ] ; then
-echo -e "\n$PYTHON_PATH_LINE" >> $AMBARI_ENV_RPMSAVE
+  if [ -f "$AMBARI_ENV_RPMSAVE" ] ; then
+PYTHON_PATH_LINE='export 
PYTHONPATH=$PYTHONPATH:/usr/lib/python2.6/site-packages'
+grep "^$PYTHON_PATH_LINE\$" "$AMBARI_ENV_RPMSAVE" > /dev/null
+if [ $? -ne 0 ] ; then
+  echo -e "\n$PYTHON_PATH_LINE" >> $AMBARI_ENV_RPMSAVE
+fi
   fi
 }
 



ambari git commit: AMBARI-15163. 'ambari-server start' is failed [import FatalException, NonFatalException] after upgrade from 2.1.2 ... 2.2.0.0 etc to 2.2.1.1 (aonishuk)

2016-02-25 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/trunk 0abc53fa5 -> 35db055aa


AMBARI-15163. 'ambari-server start' is failed [import FatalException, 
NonFatalException] after upgrade from 2.1.2 ... 2.2.0.0 etc  to 2.2.1.1 
(aonishuk)


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

Branch: refs/heads/trunk
Commit: 35db055aaef6e410d9d3e0c9744871453088b85e
Parents: 0abc53f
Author: Andrew Onishuk 
Authored: Thu Feb 25 12:40:50 2016 +0200
Committer: Andrew Onishuk 
Committed: Thu Feb 25 12:41:06 2016 +0200

--
 ambari-server/conf/unix/install-helper.sh | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/35db055a/ambari-server/conf/unix/install-helper.sh
--
diff --git a/ambari-server/conf/unix/install-helper.sh 
b/ambari-server/conf/unix/install-helper.sh
index fc137b6..25a10d6 100644
--- a/ambari-server/conf/unix/install-helper.sh
+++ b/ambari-server/conf/unix/install-helper.sh
@@ -112,10 +112,12 @@ do_install(){
$AUTOSTART_SERVER_CMD
   fi
 
-  PYTHON_PATH_LINE='export 
PYTHONPATH=$PYTHONPATH:/usr/lib/python2.6/site-packages'
-  grep "^$PYTHON_PATH_LINE\$" "$AMBARI_ENV_RPMSAVE" > /dev/null
-  if [ -f "$AMBARI_ENV_RPMSAVE" ] && [ $? -ne 0 ] ; then
-echo -e "\n$PYTHON_PATH_LINE" >> $AMBARI_ENV_RPMSAVE
+  if [ -f "$AMBARI_ENV_RPMSAVE" ] ; then
+PYTHON_PATH_LINE='export 
PYTHONPATH=$PYTHONPATH:/usr/lib/python2.6/site-packages'
+grep "^$PYTHON_PATH_LINE\$" "$AMBARI_ENV_RPMSAVE" > /dev/null
+if [ $? -ne 0 ] ; then
+  echo -e "\n$PYTHON_PATH_LINE" >> $AMBARI_ENV_RPMSAVE
+fi
   fi
 }