ambari git commit: AMBARI-9416. Remove dfs.namenode.secondary.http-address after configuring NameNode HA. (akovalenko)

2015-01-30 Thread akovalenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 30e491797 - b2f392d8f


AMBARI-9416. Remove dfs.namenode.secondary.http-address after configuring 
NameNode HA. (akovalenko)


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

Branch: refs/heads/trunk
Commit: b2f392d8fc5fecd4753aff17f97b84bddac826c3
Parents: 30e4917
Author: Aleksandr Kovalenko akovale...@hortonworks.com
Authored: Fri Jan 30 17:51:06 2015 +0200
Committer: Aleksandr Kovalenko akovale...@hortonworks.com
Committed: Fri Jan 30 17:51:21 2015 +0200

--
 ambari-web/app/assets/test/tests.js |   1 +
 .../nameNode/step3_controller.js|  27 
 .../nameNode/step3_controller_test.js   | 147 +++
 3 files changed, 175 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b2f392d8/ambari-web/app/assets/test/tests.js
--
diff --git a/ambari-web/app/assets/test/tests.js 
b/ambari-web/app/assets/test/tests.js
index 5d21495..d2cf0e7 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -56,6 +56,7 @@ var files = ['test/init_model_test',
   'test/controllers/main/admin/serviceAccounts_controller_test',
   'test/controllers/main/admin/highAvailability_controller_test',
   'test/controllers/main/admin/highAvailability/progress_controller_test',
+  
'test/controllers/main/admin/highAvailability/nameNode/step3_controller_test',
   
'test/controllers/main/admin/highAvailability/nameNode/step4_controller_test',
   
'test/controllers/main/admin/highAvailability/resourceManager/step3_controller_test',
   'test/controllers/main/admin/security_test',

http://git-wip-us.apache.org/repos/asf/ambari/blob/b2f392d8/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 83b4ed0..f146567 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
@@ -28,6 +28,14 @@ App.HighAvailabilityWizardStep3Controller = 
Em.Controller.extend({
   isLoaded: false,
   versionLoaded: true,
 
+  /**
+   * Map of sites and properties to delete
+   * @type Object
+   */
+  configsToRemove: {
+'hdfs-site': ['dfs.namenode.secondary.http-address']
+  },
+
   clearStep: function () {
 this.get('stepConfigs').clear();
 this.serverConfigData = {};
@@ -75,6 +83,7 @@ App.HighAvailabilityWizardStep3Controller = 
Em.Controller.extend({
 
   onLoadConfigs: function (data) {
 this.set('serverConfigData',data);
+this.removeConfigs(this.get('configsToRemove'));
 this.tweakServiceConfigs(this.get('haConfig.configs'));
 this.renderServiceConfigs(this.get('haConfig'));
 this.set('isLoaded', true);
@@ -134,6 +143,24 @@ App.HighAvailabilityWizardStep3Controller = 
Em.Controller.extend({
 }
   },
 
+  /**
+   * Find and remove config properties in codeserverConfigData/code
+   * @param configsToRemove - map of config sites and properties to remove
+   * @returns {Object}
+   */
+  removeConfigs:function (configsToRemove) {
+var configs = this.get('serverConfigData');
+Em.keys(configsToRemove).forEach(function(site){
+  var siteConfigs = configs.items.findProperty('type', site);
+  if (siteConfigs) {
+configsToRemove[site].forEach(function (property) {
+  delete siteConfigs.properties[property];
+});
+  }
+});
+return configs;
+  },
+
   setConfigInitialValue: function(config,value) {
 config.value = value;
 config.defaultValue = value;

http://git-wip-us.apache.org/repos/asf/ambari/blob/b2f392d8/ambari-web/test/controllers/main/admin/highAvailability/nameNode/step3_controller_test.js
--
diff --git 
a/ambari-web/test/controllers/main/admin/highAvailability/nameNode/step3_controller_test.js
 
b/ambari-web/test/controllers/main/admin/highAvailability/nameNode/step3_controller_test.js
new file mode 100644
index 000..9f6deb8
--- /dev/null
+++ 
b/ambari-web/test/controllers/main/admin/highAvailability/nameNode/step3_controller_test.js
@@ -0,0 +1,147 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for 

ambari git commit: AMBARI-9410. Allow cluster and service artifacts to be updated and deleted

2015-01-30 Thread jspeidel
Repository: ambari
Updated Branches:
  refs/heads/trunk b2f392d8f - ee4e786a4


AMBARI-9410. Allow cluster and service artifacts to be updated and deleted


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

Branch: refs/heads/trunk
Commit: ee4e786a4daf639da34ea81a7ff1a11f3dad378f
Parents: b2f392d
Author: John Speidel jspei...@hortonworks.com
Authored: Thu Jan 29 17:27:14 2015 -0500
Committer: John Speidel jspei...@hortonworks.com
Committed: Fri Jan 30 11:54:39 2015 -0500

--
 .../server/api/services/ClusterService.java | 124 --
 .../server/api/services/ServiceService.java |  92 
 .../internal/ArtifactResourceProvider.java  |  84 ++-
 .../ambari/server/orm/dao/ArtifactDAO.java  |  22 +-
 .../server/api/services/ClusterServiceTest.java |  50 +++-
 .../server/api/services/ServiceServiceTest.java |  59 +
 .../internal/ArtifactResourceProviderTest.java  | 235 ---
 7 files changed, 607 insertions(+), 59 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ee4e786a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java
index 5f44b2f..a794693 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java
@@ -185,10 +185,10 @@ public class ClusterService extends BaseService {
   @GET
   @Path({clusterName}/artifacts)
   @Produces(text/plain)
-  public Response getClusterArtifacts(String body,
-  @Context HttpHeaders headers,
-  @Context UriInfo ui,
-  @PathParam(clusterName) String 
clusterName) {
+  public Response getArtifacts(String body,
+   @Context HttpHeaders headers,
+   @Context UriInfo ui,
+   @PathParam(clusterName) String clusterName) {
 
 hasPermission(Request.Type.GET, clusterName);
 return handleRequest(headers, body, ui, Request.Type.GET,
@@ -210,11 +210,11 @@ public class ClusterService extends BaseService {
   @GET
   @Path({clusterName}/artifacts/{artifactName})
   @Produces(text/plain)
-  public Response getClusterArtifact(String body,
-  @Context HttpHeaders headers,
-  @Context UriInfo ui,
-  @PathParam(clusterName) String 
clusterName,
-  @PathParam(artifactName) String 
artifactName) {
+  public Response getArtifact(String body,
+  @Context HttpHeaders headers,
+  @Context UriInfo ui,
+  @PathParam(clusterName) String clusterName,
+  @PathParam(artifactName) String artifactName) {
 
 hasPermission(Request.Type.GET, clusterName);
 return handleRequest(headers, body, ui, Request.Type.GET,
@@ -235,11 +235,11 @@ public class ClusterService extends BaseService {
   @POST
   @Path({clusterName}/artifacts/{artifactName})
   @Produces(text/plain)
-  public Response createClusterArtifact(String body,
-  @Context HttpHeaders headers,
-  @Context UriInfo ui,
-  @PathParam(clusterName) String 
clusterName,
-  @PathParam(artifactName) String 
artifactName) {
+  public Response createArtifact(String body,
+ @Context HttpHeaders headers,
+ @Context UriInfo ui,
+ @PathParam(clusterName) String clusterName,
+ @PathParam(artifactName) String 
artifactName) {
 
 hasPermission(Request.Type.POST, clusterName);
 return handleRequest(headers, body, ui, Request.Type.POST,
@@ -247,6 +247,102 @@ public class ClusterService extends BaseService {
   }
 
   /**
+   * Handles: PUT /clusters/{clusterID}/artifacts
+   * Update all artifacts matching the provided predicate.
+   *
+   * @param headers  http headers
+   * @param ui   uri info
+   * @param clusterName  cluster name
+   *
+   * @return information regarding the updated artifacts
+   */
+  

ambari git commit: AMBARI-9415 Version state stays installed when upgrade started. (atkach)

2015-01-30 Thread atkach
Repository: ambari
Updated Branches:
  refs/heads/trunk ee4e786a4 - 4e80ff992


AMBARI-9415 Version state stays installed when upgrade started. (atkach)


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

Branch: refs/heads/trunk
Commit: 4e80ff992fdf4132d166e3ab16c89f62accdbbeb
Parents: ee4e786
Author: Andrii Tkach atk...@hortonworks.com
Authored: Fri Jan 30 15:58:13 2015 +0200
Committer: Andrii Tkach atk...@hortonworks.com
Committed: Fri Jan 30 19:03:59 2015 +0200

--
 .../stack_upgrade/upgrade_version_box_view.js   | 15 ++--
 .../upgrade_version_box_view_test.js| 37 +++-
 2 files changed, 48 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/4e80ff99/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
--
diff --git 
a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js 
b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
index 40e9e06..4f422e8 100644
--- a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
+++ b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
@@ -42,6 +42,14 @@ App.UpgradeVersionBoxView = Em.View.extend({
   
}.property('App.router.backgroundOperationsController.services.@each.progress'),
 
   /**
+   * version is upgrading
+   * @type {boolean}
+   */
+  isUpgrading: function () {
+return (this.get('controller.upgradeVersion') === 
this.get('content.displayName')  App.get('upgradeState') !== 'INIT');
+  }.property('App.upgradeState', 'content.displayName', 
'controller.upgradeVersion'),
+
+  /**
* @type {string}
*/
   versionClass: function () {
@@ -85,6 +93,7 @@ App.UpgradeVersionBoxView = Em.View.extend({
   /**
* object that describes how content should be displayed
* @type {Em.Object}
+   * TODO remove codeisUpgrading/code condition when transition of version 
states in API fixed
*/
   stateElement: function () {
 var currentVersion = this.get('controller.currentVersion');
@@ -110,7 +119,7 @@ App.UpgradeVersionBoxView = Em.View.extend({
   element.set('isLink', true);
   element.set('text', 
Em.I18n.t('hosts.host.stackVersions.status.installing'));
   element.set('action', 'showProgressPopup');
-} else if (status === 'INSTALLED') {
+} else if (status === 'INSTALLED'  !this.get('isUpgrading')) {
   if (stringUtils.compareVersions(this.get('content.repositoryVersion'), 
currentVersion.repository_version) === 1) {
 element.set('isButton', true);
 element.set('text', 
Em.I18n.t('admin.stackVersions.version.performUpgrade'));
@@ -121,7 +130,7 @@ App.UpgradeVersionBoxView = Em.View.extend({
 element.set('text', Em.I18n.t('common.installed'));
 element.set('action', null);
   }
-} else if (['UPGRADING', 'UPGRADE_FAILED', 'UPGRADED'].contains(status)) {
+} else if (['UPGRADING', 'UPGRADE_FAILED', 'UPGRADED'].contains(status) || 
this.get('isUpgrading')) {
   element.set('isLink', true);
   element.set('action', 'openUpgradeDialog');
   if (['HOLDING', 'HOLDING_FAILED', 
'HOLDING_TIMEDOUT'].contains(App.get('upgradeState'))) {
@@ -141,7 +150,7 @@ App.UpgradeVersionBoxView = Em.View.extend({
   }
 }
 return element;
-  }.property('content.status', 'controller.isDowngrade'),
+  }.property('content.status', 'controller.isDowngrade', 'isUpgrading'),
 
   didInsertElement: function () {
 App.tooltip($('.link-tooltip'), {title: 
Em.I18n.t('admin.stackVersions.version.linkTooltip')});

http://git-wip-us.apache.org/repos/asf/ambari/blob/4e80ff99/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
--
diff --git 
a/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
 
b/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
index 9ccff43..69134bb 100644
--- 
a/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
+++ 
b/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
@@ -24,6 +24,41 @@ describe('App.UpgradeVersionBoxView', function () {
   var view = App.UpgradeVersionBoxView.create({
 controller: Em.Object.create({
   upgrade: Em.K
-})
+}),
+content: Em.K
+  });
+
+  describe(#isUpgrading, function () {
+afterEach(function () {
+  App.set('upgradeState', 'INIT');
+});
+it(wrong version, function () {
+  App.set('upgradeState', 'IN_PROGRESS');
+   

ambari git commit: AMBARI-9385. Implement Keytab regeneration (rlevas)

2015-01-30 Thread rlevas
Repository: ambari
Updated Branches:
  refs/heads/trunk 4e80ff992 - a116498e9


AMBARI-9385. Implement Keytab regeneration (rlevas)


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

Branch: refs/heads/trunk
Commit: a116498e92babd241f2bc083bb1ef2325f4ca3d7
Parents: 4e80ff9
Author: Robert Levas rle...@hortonworks.com
Authored: Fri Jan 30 10:57:59 2015 -0500
Committer: Robert Levas rle...@hortonworks.com
Committed: Fri Jan 30 12:46:44 2015 -0500

--
 .../resources/ClusterResourceDefinition.java|  10 +
 .../AmbariManagementControllerImpl.java |  13 +-
 .../server/controller/KerberosHelper.java   |  96 ++-
 .../AmbariManagementControllerImplTest.java |  66 -
 .../server/controller/KerberosHelperTest.java   | 268 ++-
 5 files changed, 435 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a116498e/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
index 9b744d0..980a40f 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
@@ -18,6 +18,7 @@
 
 package org.apache.ambari.server.api.resources;
 
+import java.util.Collection;
 import java.util.HashSet;
 import java.util.Set;
 
@@ -75,4 +76,13 @@ public class ClusterResourceDefinition extends 
BaseStacksResourceDefinition {
 
 return setChildren;
   }
+
+  @Override
+  public CollectionString getUpdateDirectives() {
+CollectionString directives = super.getUpdateDirectives();
+directives.add(regenerate_keytabs);
+
+return directives;
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/a116498e/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index e867f99..b6dd5c4 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -1153,12 +1153,12 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
   //
   // ***
 
-  response = updateCluster(request);
+  response = updateCluster(request, requestProperties);
 }
 return response;
   }
 
-  private synchronized RequestStatusResponse updateCluster(ClusterRequest 
request)
+  private synchronized RequestStatusResponse updateCluster(ClusterRequest 
request, MapString, String requestProperties)
   throws AmbariException {
 
 RequestStageContainer requestStageContainer = null;
@@ -1331,7 +1331,13 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
 
 // set the new security type of the cluster if change is requested
 SecurityType securityType = request.getSecurityType();
-if((securityType != null)  (cluster.getSecurityType() != securityType) ){
+
+if(securityType != null) {
+  // if any custom operations are valid and requested, the process of 
executing them should be initiated,
+  // most of the validation logic will be left to the KerberosHelper to 
avoid polluting the controller
+  if (kerberosHelper.shouldExecuteCustomOperations(securityType, 
requestProperties)) {
+requestStageContainer = 
kerberosHelper.executeCustomOperations(cluster, 
request.getKerberosDescriptor(), requestProperties, requestStageContainer);
+  } else if (cluster.getSecurityType() != securityType) {
 LOG.info(Received cluster security type change request from {} to {},
 cluster.getSecurityType().name(), securityType.name());
 
@@ -1345,6 +1351,7 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
 }
 
 cluster.setSecurityType(securityType);
+  }
 }
 
 if (requestStageContainer != null) {


ambari git commit: AMBARI-9418 UI changes to resolve discrepancies between what the stack vs Ambari reports as live for slaves such as DataNodes and NodeManagers. (ababiichuk)

2015-01-30 Thread ababiichuk
Repository: ambari
Updated Branches:
  refs/heads/trunk a116498e9 - f1bc1bdad


AMBARI-9418 UI changes to resolve discrepancies between what the stack vs 
Ambari reports as live for slaves such as DataNodes and NodeManagers. 
(ababiichuk)


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

Branch: refs/heads/trunk
Commit: f1bc1bdad427e8d81d3f3776e80f8b8ed73cf218
Parents: a116498
Author: aBabiichuk ababiic...@cybervisiontech.com
Authored: Fri Jan 30 18:45:27 2015 +0200
Committer: aBabiichuk ababiic...@cybervisiontech.com
Committed: Fri Jan 30 20:08:10 2015 +0200

--
 .../app/controllers/global/update_controller.js |  3 +++
 .../app/mappers/service_metrics_mapper.js   | 18 -
 ambari-web/app/messages.js  | 14 +
 ambari-web/app/models/service/hdfs.js   |  5 -
 ambari-web/app/models/service/yarn.js   |  7 ---
 .../templates/main/service/services/hdfs.hbs| 20 +--
 .../templates/main/service/services/yarn.hbs| 12 +--
 .../main/dashboard/widgets/datanode_live.js | 21 +++-
 .../dashboard/widgets/node_managers_live.js | 10 +-
 .../app/views/main/service/services/hdfs.js |  3 +++
 .../global/update_controller_test.js|  1 +
 ambari-web/test/models/service/yarn_test.js |  4 ++--
 12 files changed, 81 insertions(+), 37 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/f1bc1bda/ambari-web/app/controllers/global/update_controller.js
--
diff --git a/ambari-web/app/controllers/global/update_controller.js 
b/ambari-web/app/controllers/global/update_controller.js
index e190b7d..1c2c5ed 100644
--- a/ambari-web/app/controllers/global/update_controller.js
+++ b/ambari-web/app/controllers/global/update_controller.js
@@ -377,6 +377,8 @@ App.UpdateController = Em.Controller.extend({
 'host_components/metrics/rpc/RpcQueueTime_avg_time,' +
 'host_components/metrics/dfs/FSNamesystem/*,' +
 'host_components/metrics/dfs/namenode/Version,' +
+'host_components/metrics/dfs/namenode/LiveNodes,' +
+'host_components/metrics/dfs/namenode/DeadNodes,' +
 'host_components/metrics/dfs/namenode/DecomNodes,' +
 'host_components/metrics/dfs/namenode/TotalFiles,' +
 'host_components/metrics/dfs/namenode/UpgradeFinalized,' +
@@ -406,6 +408,7 @@ App.UpdateController = Em.Controller.extend({
 host_components/processes/HostComponentProcess,
   'YARN': host_components/metrics/yarn/Queue, +
 ServiceComponentInfo/rm_metrics/cluster/activeNMcount, +
+ServiceComponentInfo/rm_metrics/cluster/lostNMcount, +
 ServiceComponentInfo/rm_metrics/cluster/unhealthyNMcount, +
 ServiceComponentInfo/rm_metrics/cluster/rebootedNMcount, +
 ServiceComponentInfo/rm_metrics/cluster/decommissionedNMcount,

http://git-wip-us.apache.org/repos/asf/ambari/blob/f1bc1bda/ambari-web/app/mappers/service_metrics_mapper.js
--
diff --git a/ambari-web/app/mappers/service_metrics_mapper.js 
b/ambari-web/app/mappers/service_metrics_mapper.js
index d341b46..3685c6b 100644
--- a/ambari-web/app/mappers/service_metrics_mapper.js
+++ b/ambari-web/app/mappers/service_metrics_mapper.js
@@ -44,9 +44,12 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
 standby_name_node_id: 'standby_name_node_id',
 standby_name_node2_id: 'standby_name_node2_id',
 journal_nodes: 'journal_nodes',
+metrics_not_available: 'metrics_not_available',
 name_node_start_time: 
'nameNodeComponent.host_components[0].metrics.runtime.StartTime',
 jvm_memory_heap_used: 
'nameNodeComponent.host_components[0].metrics.jvm.HeapMemoryUsed',
 jvm_memory_heap_max: 
'nameNodeComponent.host_components[0].metrics.jvm.HeapMemoryMax',
+live_data_nodes: 'live_data_nodes',
+dead_data_nodes: 'dead_data_nodes',
 decommission_data_nodes: 'decommission_data_nodes',
 capacity_used: 
'nameNodeComponent.host_components[0].metrics.dfs.FSNamesystem.CapacityUsed',
 capacity_total: 
'nameNodeComponent.host_components[0].metrics.dfs.FSNamesystem.CapacityTotal',
@@ -79,7 +82,7 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
 apps_killed: 
'resourceManagerComponent.host_components[0].metrics.yarn.Queue.root.AppsKilled',
 apps_failed: 
'resourceManagerComponent.host_components[0].metrics.yarn.Queue.root.AppsFailed',
 node_managers_count_active: 

ambari git commit: AMBARI-9417. Incorrect target hosts values allowable for moving HiveServer2 via service actions (alexantonenko)

2015-01-30 Thread alexantonenko
Repository: ambari
Updated Branches:
  refs/heads/trunk f1bc1bdad - 326238b84


AMBARI-9417. Incorrect target hosts values allowable for moving HiveServer2 via 
service actions (alexantonenko)


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

Branch: refs/heads/trunk
Commit: 326238b8444a1389100fb44f1107518bb49a64b6
Parents: f1bc1bd
Author: Alex Antonenko hiv...@gmail.com
Authored: Fri Jan 30 18:12:28 2015 +0200
Committer: Alex Antonenko hiv...@gmail.com
Committed: Fri Jan 30 20:51:04 2015 +0200

--
 .../main/service/reassign/step2_controller.js   |  8 ++---
 .../main/host/details/host_component.hbs|  2 +-
 .../main/host/details/host_component_view.js|  8 +
 ambari-web/app/views/main/service/item.js   |  6 ++--
 .../service/reassign/step2_controller_test.js   | 36 +---
 ambari-web/test/views/main/service/item_test.js | 30 ++--
 6 files changed, 61 insertions(+), 29 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/326238b8/ambari-web/app/controllers/main/service/reassign/step2_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/service/reassign/step2_controller.js 
b/ambari-web/app/controllers/main/service/reassign/step2_controller.js
index 3902d8a..e2ed854 100644
--- a/ambari-web/app/controllers/main/service/reassign/step2_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step2_controller.js
@@ -88,16 +88,16 @@ App.ReassignMasterWizardStep2Controller = 
App.WizardStep5Controller.extend({
   availableComponentHosts = [];
 
 this.get(hosts).forEach(function (item) {
-  if (this.get('currentHostId') !== item.get('host_name')) {
+  if ( (this.get('currentHostId') !== item.get('host_name'))  
!(currentComponents.mapProperty(selectedHost).contains(item.get('host_name'
 {
 availableComponentHosts.pushObject(item);
   }
 }, this);
 
 if (availableComponentHosts.length  0) {
-  currentComponents.forEach(function (item) {
-var preparedAvailableHosts = availableComponentHosts.slice(0);
+  var preparedAvailableHosts = availableComponentHosts.slice(0);
 
-if (item.get('selectedHost') === this.get('currentHostId')  
item.get('component_name') === this.get('content.reassign.component_name')) {
+  currentComponents.forEach(function (item) {
+if (item.get('selectedHost') === this.get('currentHostId')  
item.get('component_name') === componentName) {
   item.set('selectedHost', 
preparedAvailableHosts.objectAt(0).host_name);
 }
 item.set(availableHosts, 
preparedAvailableHosts.sortProperty('host_name'));

http://git-wip-us.apache.org/repos/asf/ambari/blob/326238b8/ambari-web/app/templates/main/host/details/host_component.hbs
--
diff --git a/ambari-web/app/templates/main/host/details/host_component.hbs 
b/ambari-web/app/templates/main/host/details/host_component.hbs
index 5a2a040..419d794 100644
--- a/ambari-web/app/templates/main/host/details/host_component.hbs
+++ b/ambari-web/app/templates/main/host/details/host_component.hbs
@@ -94,7 +94,7 @@
 /li
   {{/if}}
   {{#if view.isReassignable}}
-li {{bindAttr class=view.noActionAvailable}}
+li {{bindAttr class=view.noActionAvailable 
view.isMoveComponentDisabled:disabled}}
   a href=javascript:void(null) data-toggle=modal {{action 
moveComponent view.content target=controller}}
 {{t common.move}}
   /a

http://git-wip-us.apache.org/repos/asf/ambari/blob/326238b8/ambari-web/app/views/main/host/details/host_component_view.js
--
diff --git a/ambari-web/app/views/main/host/details/host_component_view.js 
b/ambari-web/app/views/main/host/details/host_component_view.js
index 190c95c..8d7e102 100644
--- a/ambari-web/app/views/main/host/details/host_component_view.js
+++ b/ambari-web/app/views/main/host/details/host_component_view.js
@@ -193,6 +193,14 @@ App.HostComponentView = Em.View.extend({
   }.property('content'),
 
   /**
+   * Host component with some codeworkStatus/code can't be moved (so, 
disable such action in the dropdown list)
+   * @type {bool}
+   */
+  isMoveComponentDisabled: function () {
+return App.allHostNames.length === 
App.HostComponent.find().filterProperty('componentName', 
this.get('content.componentName')).mapProperty('hostName').length;
+  }.property('content'),
+
+  /**
* Host component with some codeworkStatus/code 

ambari git commit: AMBARI-9419. Sometimes manage alert groups doesn't work. (akovalenko)

2015-01-30 Thread akovalenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 3e601aa3e - d8997295d


AMBARI-9419. Sometimes manage alert groups doesn't work. (akovalenko)


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

Branch: refs/heads/trunk
Commit: d8997295d3ad692ce871ccb1759dc9c87d5ad7fa
Parents: 3e601aa
Author: Aleksandr Kovalenko akovale...@hortonworks.com
Authored: Fri Jan 30 20:31:36 2015 +0200
Committer: Aleksandr Kovalenko akovale...@hortonworks.com
Committed: Sat Jan 31 01:38:50 2015 +0200

--
 ambari-web/app/mappers/alert_groups_mapper.js   | 24 +++-
 ambari-web/app/models/alert_group.js|  2 +-
 .../test/mappers/alert_groups_mapper_test.js| 12 ++
 3 files changed, 6 insertions(+), 32 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d8997295/ambari-web/app/mappers/alert_groups_mapper.js
--
diff --git a/ambari-web/app/mappers/alert_groups_mapper.js 
b/ambari-web/app/mappers/alert_groups_mapper.js
index a1b33f5..50a8ea5 100644
--- a/ambari-web/app/mappers/alert_groups_mapper.js
+++ b/ambari-web/app/mappers/alert_groups_mapper.js
@@ -38,27 +38,12 @@ App.alertGroupsMapper = App.QuickDataMapper.create({
 }
   },
 
-  /**
-   * Map for alertGroup's alertDefinitions
-   * Store alertDefinitions to alertGroup-properties basing on 
alertDefinitionType
-   * Format: key - alertDefinitionType, value - alertGroup-property where 
alertDefinition should be saved
-   * @type {object}
-   */
-  typesMap: {
-PORT: 'port_alert_definitions',
-METRIC: 'metrics_alert_definitions',
-WEB: 'web_alert_definitions',
-AGGREGATE: 'aggregate_alert_definitions',
-SCRIPT: 'script_alert_definitions'
-  },
-
   map: function (json) {
 if (!Em.isNone(json, 'items')) {
 
   var alertGroups = [],
 self = this,
 groupsToDelete = App.AlertGroup.find().mapProperty('id'),
-typesMap = this.get('typesMap'),
 /**
  * AlertGroups-map for codeApp.AlertDefinitionsMappers/code
  * Format:
@@ -77,15 +62,12 @@ App.alertGroupsMapper = App.QuickDataMapper.create({
   json.items.forEach(function(item) {
 var group = self.parseIt(item, self.get('config'));
 groupsToDelete = groupsToDelete.without(group.id);
-Em.keys(typesMap).forEach(function(k) {
-  group[typesMap[k]] = [];
-});
 group.targets = [];
+group.definitions = [];
 if (item.AlertGroup.definitions) {
   item.AlertGroup.definitions.forEach(function(definition) {
-var type = typesMap[definition.source_type];
-if (!group[type].contains(definition.id)) {
-  group[type].push(definition.id);
+if (!group.definitions.contains(definition.id)) {
+  group.definitions.push(definition.id);
 }
 if (Em.isNone(alertDefinitionsGroupsMap[definition.id])) {
   alertDefinitionsGroupsMap[definition.id] = [];

http://git-wip-us.apache.org/repos/asf/ambari/blob/d8997295/ambari-web/app/models/alert_group.js
--
diff --git a/ambari-web/app/models/alert_group.js 
b/ambari-web/app/models/alert_group.js
index df038d6..e914ed5 100644
--- a/ambari-web/app/models/alert_group.js
+++ b/ambari-web/app/models/alert_group.js
@@ -44,7 +44,7 @@ App.AlertGroup = DS.Model.extend({
   /**
* @type {App.AlertDefinition[]}
*/
-  definitions: App.AlertDefinition.find(),
+  definitions: DS.hasMany('App.AlertDefinition'),
 
   /**
* @type {App.AlertNotification[]}

http://git-wip-us.apache.org/repos/asf/ambari/blob/d8997295/ambari-web/test/mappers/alert_groups_mapper_test.js
--
diff --git a/ambari-web/test/mappers/alert_groups_mapper_test.js 
b/ambari-web/test/mappers/alert_groups_mapper_test.js
index f21f694..eb83759 100644
--- a/ambari-web/test/mappers/alert_groups_mapper_test.js
+++ b/ambari-web/test/mappers/alert_groups_mapper_test.js
@@ -113,22 +113,14 @@ describe('App.alertGroupsMapper', function () {
   id: 3,
   name: 'ZOOKEEPER',
   default: true,
-  port_alert_definitions: [8],
-  metrics_alert_definitions: [],
-  web_alert_definitions: [],
-  aggregate_alert_definitions: [9],
-  script_alert_definitions: [],
+  definitions: [8,9],
   targets: [1, 2]
 },
 {
   id: 2,
   name: 'YARN',
   default: true,
-  port_alert_definitions: [],
-  

ambari git commit: AMBARI-9365. RU - FinalizeUpgradeAction needs to ignore hosts without a host_version record (alejandro)

2015-01-30 Thread alejandro
Repository: ambari
Updated Branches:
  refs/heads/trunk d8997295d - 082beafcb


AMBARI-9365. RU - FinalizeUpgradeAction needs to ignore hosts without a 
host_version record (alejandro)


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

Branch: refs/heads/trunk
Commit: 082beafcb28d2e2b2c34349805ee97061a8eb103
Parents: d899729
Author: Alejandro Fernandez afernan...@hortonworks.com
Authored: Tue Jan 27 16:33:03 2015 -0800
Committer: Alejandro Fernandez afernan...@hortonworks.com
Committed: Fri Jan 30 16:36:05 2015 -0800

--
 .../server/orm/dao/HostComponentStateDAO.java   |  19 ++-
 .../orm/entities/HostComponentStateEntity.java  |   5 +
 .../upgrades/FinalizeUpgradeAction.java |  95 +++
 .../server/state/cluster/ClusterImpl.java   |  34 ++
 .../svccomphost/ServiceComponentHostImpl.java   |  27 +
 .../ServiceComponentHostSummary.java| 118 +++
 .../stacks/HDP/2.2/upgrades/upgrade-2.2.xml |   2 +-
 7 files changed, 220 insertions(+), 80 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/082beafc/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostComponentStateDAO.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostComponentStateDAO.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostComponentStateDAO.java
index fd1ce9e..66e91d3 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostComponentStateDAO.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostComponentStateDAO.java
@@ -35,6 +35,8 @@ import java.util.List;
 public class HostComponentStateDAO {
   @Inject
   ProviderEntityManager entityManagerProvider;
+  @Inject
+  DaoUtils daoUtils;
 
   @RequiresSession
   public HostComponentStateEntity findByPK(HostComponentStateEntityPK 
primaryKey) {
@@ -43,8 +45,7 @@ public class HostComponentStateDAO {
 
   @RequiresSession
   public ListHostComponentStateEntity findAll() {
-TypedQueryHostComponentStateEntity query = entityManagerProvider.get()
-  .createQuery(SELECT hsc from HostComponentStateEntity hsc, 
HostComponentStateEntity.class);
+final TypedQueryHostComponentStateEntity query = 
entityManagerProvider.get().createNamedQuery(HostComponentStateEntity.findAll,
 HostComponentStateEntity.class);
 try {
   return query.getResultList();
 } catch (NoResultException ignored) {
@@ -52,6 +53,20 @@ public class HostComponentStateDAO {
 return null;
   }
 
+  /**
+   * Retrieve all of the Host Component States for the given host.
+   *
+   * @param hostName HOst name
+   * @return Return all of the Host Component States that match the criteria.
+   */
+  @RequiresSession
+  public ListHostComponentStateEntity findByHost(String hostName) {
+final TypedQueryHostComponentStateEntity query = 
entityManagerProvider.get().createNamedQuery(HostComponentStateEntity.findByHost,
 HostComponentStateEntity.class);
+query.setParameter(hostName, hostName);
+
+return daoUtils.selectList(query);
+  }
+
   @Transactional
   public void refresh(HostComponentStateEntity hostComponentStateEntity) {
 entityManagerProvider.get().refresh(hostComponentStateEntity);

http://git-wip-us.apache.org/repos/asf/ambari/blob/082beafc/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java
index 1e48950..0a31b90 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java
@@ -29,6 +29,11 @@ import static 
org.apache.commons.lang.StringUtils.defaultString;
 @IdClass(HostComponentStateEntityPK.class)
 @Table(name = hostcomponentstate)
 @Entity
+@NamedQueries({
+@NamedQuery(name = HostComponentStateEntity.findAll, query = SELECT hcs 
from HostComponentStateEntity hcs),
+@NamedQuery(name = HostComponentStateEntity.findByHost, query =
+SELECT hcs from HostComponentStateEntity hcs WHERE 
hcs.hostName=:hostName),
+})
 public class HostComponentStateEntity {
 
   @Id

http://git-wip-us.apache.org/repos/asf/ambari/blob/082beafc/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java

ambari git commit: AMBARI-9399. Views: Pig, arguments are not stored when you save the script, error handling fixes. (alexantonenko)

2015-01-30 Thread alexantonenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 72dcffc31 - 876b1969c


AMBARI-9399. Views: Pig, arguments are not stored when you save the script, 
error handling fixes. (alexantonenko)


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

Branch: refs/heads/trunk
Commit: 876b1969c126e49f37e0163490bd5f6def3c3fe4
Parents: 72dcffc
Author: Alex Antonenko hiv...@gmail.com
Authored: Thu Jan 29 16:21:55 2015 +0200
Committer: Alex Antonenko hiv...@gmail.com
Committed: Fri Jan 30 11:24:30 2015 +0200

--
 .../ui/pig-web/app/components/scriptListRow.js  |  3 ++
 .../resources/ui/pig-web/app/controllers/pig.js | 31 +++-
 .../ui/pig-web/app/controllers/script.js| 14 ---
 .../ui/pig-web/app/controllers/scriptEdit.js| 20 --
 .../main/resources/ui/pig-web/app/initialize.js |  1 +
 .../ui/pig-web/app/mixins/routeError.js | 30 +++
 .../resources/ui/pig-web/app/models/pig_job.js  | 29 ++-
 .../ui/pig-web/app/models/pig_script.js | 10 ++---
 .../main/resources/ui/pig-web/app/routes/pig.js | 28 ++
 .../ui/pig-web/app/routes/pigHistory.js | 10 +
 .../ui/pig-web/app/routes/pigScripts.js |  5 ++-
 .../resources/ui/pig-web/app/routes/pigUdfs.js  |  3 +-
 .../resources/ui/pig-web/app/routes/script.js   | 13 +++
 .../ui/pig-web/app/routes/scriptEdit.js | 14 +--
 .../ui/pig-web/app/routes/scriptJob.js  |  2 +-
 .../app/templates/components/scriptListRow.hbs  | 29 ++-
 .../ui/pig-web/app/templates/pig/scripts.hbs| 39 +---
 .../ui/pig-web/app/templates/script/job.hbs |  4 +-
 .../resources/ui/pig-web/app/translations.js|  4 ++
 .../resources/ui/pig-web/app/views/pig/alert.js | 20 --
 20 files changed, 147 insertions(+), 162 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/876b1969/contrib/views/pig/src/main/resources/ui/pig-web/app/components/scriptListRow.js
--
diff --git 
a/contrib/views/pig/src/main/resources/ui/pig-web/app/components/scriptListRow.js
 
b/contrib/views/pig/src/main/resources/ui/pig-web/app/components/scriptListRow.js
index 2f5d9e6..3dc67ca 100644
--- 
a/contrib/views/pig/src/main/resources/ui/pig-web/app/components/scriptListRow.js
+++ 
b/contrib/views/pig/src/main/resources/ui/pig-web/app/components/scriptListRow.js
@@ -19,6 +19,9 @@
 var App = require('app');
 
 App.ScriptListRowComponent = Em.Component.extend({
+  layoutName:'components/scriptListRow',
+  jobs:[],
+  script:null,
   tagName:'tr',
   scriptJobs:function () {
 var scriptId = this.get('script.id');

http://git-wip-us.apache.org/repos/asf/ambari/blob/876b1969/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/pig.js
--
diff --git 
a/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/pig.js 
b/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/pig.js
index 8cde338..1741a07 100644
--- a/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/pig.js
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/pig.js
@@ -60,24 +60,19 @@ App.PigController = Em.ArrayController.extend({
   return script.save().then(onSuccess,onFail);
 },
 copyScript:function (script) {
-  script.get('pigScript').then(function (file) {
-
-var newScript = this.store.createRecord('script',{
-  title:script.get('title')+' (copy)',
-  templetonArguments:script.get('templetonArguments')
-});
-
-newScript.save().then(function (savedScript) {
-  savedScript.get('pigScript').then(function (newFile) {
-newFile.set('fileContent',file.get('fileContent'));
-newFile.save().then(function () {
-  this.send('showAlert', {'message':script.get('title') + ' is 
copied.',status:'success'});
-  if (this.get('activeScript')) {
-this.send('openModal','gotoCopy',savedScript);
-  }
-}.bind(this));
-  }.bind(this));
-}.bind(this));
+  var newScript = this.store.createRecord('script',{
+title:script.get('title')+' (copy)',
+templetonArguments:script.get('templetonArguments')
+  });
+  newScript.save().then(function (savedScript) {
+return 
Em.RSVP.all([savedScript.get('pigScript'),script.get('pigScript.fileContent')]);
+  }).then(function (data) {
+return data.objectAt(0).set('fileContent',data.objectAt(1)).save();
+  }).then(function () {
+  

ambari git commit: AMBARI-9276. Memory leaks in Firefox after some time on Alerts page. Additional patch. (akovalenko)

2015-01-30 Thread akovalenko
Repository: ambari
Updated Branches:
  refs/heads/trunk bfa0e4aec - cb4df42ff


AMBARI-9276. Memory leaks in Firefox after some time on Alerts page. Additional 
patch. (akovalenko)


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

Branch: refs/heads/trunk
Commit: cb4df42ff706c6b05590b6951149504269db509c
Parents: bfa0e4a
Author: Aleksandr Kovalenko akovale...@hortonworks.com
Authored: Thu Jan 29 20:38:29 2015 +0200
Committer: Aleksandr Kovalenko akovale...@hortonworks.com
Committed: Fri Jan 30 13:54:40 2015 +0200

--
 .../alert_definitions_actions_controller.js |  1 +
 .../alerts/manage_alert_groups_controller.js|  6 
 .../app/views/main/alert_definitions_view.js| 34 
 3 files changed, 28 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/cb4df42f/ambari-web/app/controllers/main/alerts/alert_definitions_actions_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/alerts/alert_definitions_actions_controller.js
 
b/ambari-web/app/controllers/main/alerts/alert_definitions_actions_controller.js
index b8a8af6..96df2ac 100644
--- 
a/ambari-web/app/controllers/main/alerts/alert_definitions_actions_controller.js
+++ 
b/ambari-web/app/controllers/main/alerts/alert_definitions_actions_controller.js
@@ -154,6 +154,7 @@ App.MainAlertDefinitionActionsController = 
Em.ArrayController.extend({
 });
   }
   App.router.get('updateController').updateAlertGroups(function () 
{
+
App.router.get('manageAlertGroupsController').toggleProperty('changeTrigger');
 
App.router.get('updateController').updateAlertDefinitions(function() {
   
App.router.get('updateController').updateAlertNotifications(Em.K);
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb4df42f/ambari-web/app/controllers/main/alerts/manage_alert_groups_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/alerts/manage_alert_groups_controller.js 
b/ambari-web/app/controllers/main/alerts/manage_alert_groups_controller.js
index fddd6bb..b2ead3f 100644
--- a/ambari-web/app/controllers/main/alerts/manage_alert_groups_controller.js
+++ b/ambari-web/app/controllers/main/alerts/manage_alert_groups_controller.js
@@ -31,6 +31,12 @@ App.ManageAlertGroupsController = Em.Controller.extend({
   isLoaded: false,
 
   /**
+   * Property used to trigger Alert Groups Filter content updating
+   * @type {Boolean}
+   */
+  changeTrigger: false,
+
+  /**
* @type {App.AlertGroup[]}
*/
   alertGroups: [],

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb4df42f/ambari-web/app/views/main/alert_definitions_view.js
--
diff --git a/ambari-web/app/views/main/alert_definitions_view.js 
b/ambari-web/app/views/main/alert_definitions_view.js
index 737c9f2..05d4186 100644
--- a/ambari-web/app/views/main/alert_definitions_view.js
+++ b/ambari-web/app/views/main/alert_definitions_view.js
@@ -53,12 +53,17 @@ App.MainAlertDefinitionsView = App.TableView.extend({
 
   didInsertElement: function () {
 var self = this;
-this.tooltipsUpdater();
 Em.run.next(function () {
   self.set('isInitialRendering', false);
+  self.tooltipsUpdater();
+  self.addObserver('pageContent.length', self, 'tooltipsUpdater');
 });
   },
 
+  willDestroyElement: function () {
+this.removeObserver('pageContent.length', this, 'tooltipsUpdater');
+  },
+
   /**
* Save codestartIndex/code to the localStorage
* @method saveStartIndex
@@ -401,27 +406,30 @@ App.MainAlertDefinitionsView = App.TableView.extend({
  * @method updateContent
  */
 updateContent: function() {
-  var alertGroups = App.AlertGroup.find().map(function (group) {
-return Em.Object.create({
+  var defaultGroups = [];
+  var customGroups = [];
+  App.AlertGroup.find().forEach(function (group) {
+var item = Em.Object.create({
   value: group.get('id'),
-  label: group.get('displayNameDefinitions'),
-  default: group.get('default')
+  label: group.get('displayNameDefinitions')
 });
+if (group.get('default')) {
+  defaultGroups.push(item);
+} else {
+  customGroups.push(item);
+}
   });
-  var defaultGroups = alertGroups.filterProperty('default');
-  defaultGroups.forEach(function(defaultGroup) {
-

ambari git commit: AMBARI-9413 Once all hivemetastore servers are delete unable to add a new hive metastore. (ababiichuk)

2015-01-30 Thread ababiichuk
Repository: ambari
Updated Branches:
  refs/heads/trunk cb4df42ff - 30e491797


AMBARI-9413 Once all hivemetastore servers are delete unable to add a new hive 
metastore. (ababiichuk)


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

Branch: refs/heads/trunk
Commit: 30e4917970dc0dd7f27a1a443775bd273bb87186
Parents: cb4df42
Author: aBabiichuk ababiic...@cybervisiontech.com
Authored: Fri Jan 30 14:40:20 2015 +0200
Committer: aBabiichuk ababiic...@cybervisiontech.com
Committed: Fri Jan 30 14:40:31 2015 +0200

--
 ambari-web/app/controllers/main/service/item.js |  2 +-
 .../main/host/details/host_component_view.js| 15 +++-
 .../host/details/host_component_view_test.js| 38 
 3 files changed, 53 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/30e49179/ambari-web/app/controllers/main/service/item.js
--
diff --git a/ambari-web/app/controllers/main/service/item.js 
b/ambari-web/app/controllers/main/service/item.js
index c8dbf92..4cf26d5 100644
--- a/ambari-web/app/controllers/main/service/item.js
+++ b/ambari-web/app/controllers/main/service/item.js
@@ -569,7 +569,7 @@ App.MainServiceItemController = Em.Controller.extend({
*/
   addComponent: function (componentName) {
 var self = this;
-var component = App.HostComponent.find().findProperty('componentName', 
componentName);
+var component = 
App.StackServiceComponent.find().findProperty('componentName', componentName);
 var componentDisplayName = component.get('displayName');
 
 self.loadHostsWithoutComponent(componentName);

http://git-wip-us.apache.org/repos/asf/ambari/blob/30e49179/ambari-web/app/views/main/host/details/host_component_view.js
--
diff --git a/ambari-web/app/views/main/host/details/host_component_view.js 
b/ambari-web/app/views/main/host/details/host_component_view.js
index 9f4929d..190c95c 100644
--- a/ambari-web/app/views/main/host/details/host_component_view.js
+++ b/ambari-web/app/views/main/host/details/host_component_view.js
@@ -197,10 +197,23 @@ App.HostComponentView = Em.View.extend({
* @type {bool}
*/
   isDeleteComponentDisabled: function () {
-return ![App.HostComponentStatus.stopped, App.HostComponentStatus.unknown, 
App.HostComponentStatus.install_failed, App.HostComponentStatus.upgrade_failed, 
App.HostComponentStatus.init].contains(this.get('workStatus'));
+var stackComponentCount = 
App.StackServiceComponent.find(this.get('hostComponent.componentName')).get('minToInstall');
+var installedCount = this.componentCounter();
+return (installedCount = stackComponentCount)
+  || ![App.HostComponentStatus.stopped, App.HostComponentStatus.unknown, 
App.HostComponentStatus.install_failed, App.HostComponentStatus.upgrade_failed, 
App.HostComponentStatus.init].contains(this.get('workStatus'));
   }.property('workStatus'),
 
   /**
+   * gets number of current component that are applied to the cluster;
+   * @returns {Number}
+   */
+  componentCounter: function() {
+return 
App.StackServiceComponent.find(this.get('hostComponent.componentName')).get('isMaster')
+  ? App.HostComponent.find().filterProperty('componentName', 
this.get('content.componentName')).length
+  : App.SlaveComponent.find().findProperty('componentName', 
this.get('content.componentName')).get('totalCount');
+  },
+
+  /**
* Check if component may be reassinged to another host
* @type {bool}
*/

http://git-wip-us.apache.org/repos/asf/ambari/blob/30e49179/ambari-web/test/views/main/host/details/host_component_view_test.js
--
diff --git 
a/ambari-web/test/views/main/host/details/host_component_view_test.js 
b/ambari-web/test/views/main/host/details/host_component_view_test.js
index 2887b02..2cb5105 100644
--- a/ambari-web/test/views/main/host/details/host_component_view_test.js
+++ b/ambari-web/test/views/main/host/details/host_component_view_test.js
@@ -223,18 +223,56 @@ describe('App.HostComponentView', function() {
 
   describe('#isDeleteComponentDisabled', function() {
 
+beforeEach(function() {
+  sinon.stub(hostComponentView, 'componentCounter', function() {
+return 1;
+  });
+  sinon.stub(App.StackServiceComponent, 'find', function(component) {
+var min = component == 'comp0' ? 0 : 1;
+return Em.Object.create({minToInstall: min});
+  });
+});
+afterEach(function() {
+  hostComponentView.componentCounter.restore();
+  

ambari git commit: AMBARI-9407. Install Version aborting cause infinite Installing state (dlysnichenko)

2015-01-30 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 876b1969c - bfa0e4aec


AMBARI-9407. Install Version aborting cause infinite Installing state 
(dlysnichenko)


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

Branch: refs/heads/trunk
Commit: bfa0e4aec8279db13afc4cb55e7919591894f1c4
Parents: 876b196
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Fri Jan 30 13:23:51 2015 +0200
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Fri Jan 30 13:23:51 2015 +0200

--
 .../DistributeRepositoriesActionListener.java   | 23 +---
 1 file changed, 10 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/bfa0e4ae/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/DistributeRepositoriesActionListener.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/DistributeRepositoriesActionListener.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/DistributeRepositoriesActionListener.java
index 0f06f6e..e4b26b1 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/DistributeRepositoriesActionListener.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/DistributeRepositoriesActionListener.java
@@ -152,24 +152,21 @@ public class DistributeRepositoriesActionListener {
   }
 }
 
-if (repositoryVersion != null) {
-  ListHostVersionEntity hostVersions = 
hostVersionDAO.get().findByHost(event.getHostname());
-  HostVersionEntity foundHostVersion = null;
-
-  for (HostVersionEntity hostVersion : hostVersions) {
-if 
(hostVersion.getRepositoryVersion().getVersion().equals(repositoryVersion)) {
-  foundHostVersion = hostVersion;
-  break;
-}
+ListHostVersionEntity hostVersions = 
hostVersionDAO.get().findByHost(event.getHostname());
+// We have to iterate over all host versions. Otherwise server-side 
command aborts (that do not
+// provide exact host stack version info) would be ignored
+for (HostVersionEntity hostVersion : hostVersions) {
+  if (repositoryVersion != null  ! 
hostVersion.getRepositoryVersion().getVersion().equals(repositoryVersion)) {
+continue;
   }
-
-  if (foundHostVersion != null  foundHostVersion.getState() == 
RepositoryVersionState.INSTALLING) {
-foundHostVersion.setState(newHostState);
+  // If we know exact host stack version, there will be single execution 
of a code below
+  if (hostVersion.getState() == RepositoryVersionState.INSTALLING) {
+hostVersion.setState(newHostState);
 
 // Update state of a cluster stack version
 try {
   Cluster cluster = clusters.get().getClusterById(clusterId);
-  
cluster.recalculateClusterVersionState(foundHostVersion.getRepositoryVersion().getVersion());
+  
cluster.recalculateClusterVersionState(hostVersion.getRepositoryVersion().getVersion());
 } catch (AmbariException e) {
   LOG.error(Cannot get cluster with Id  + clusterId.toString(), e);
 }