git commit: AMBARI-6533. Add API to get file log location in the task execution output, currently hardcoded in UI. (Alejandro Fernandez via swagle)

2014-07-25 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk d5bd15bdc - f3aab68ec


AMBARI-6533. Add API to get file log location in the task execution output, 
currently hardcoded in UI. (Alejandro Fernandez via swagle)


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

Branch: refs/heads/trunk
Commit: f3aab68ec417d8e2c39c216962e1e1d47d56d401
Parents: d5bd15b
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Thu Jul 24 23:40:43 2014 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Thu Jul 24 23:40:43 2014 -0700

--
 .../src/main/python/ambari_agent/ActionQueue.py |  5 +-
 .../src/main/python/ambari_agent/Register.py|  3 +-
 .../python/ambari_agent/TestRegistration.py |  3 +-
 .../actionmanager/ActionDBAccessorImpl.java | 21 +++-
 .../server/actionmanager/HostRoleCommand.java   | 18 +++
 .../ambari/server/agent/HeartBeatHandler.java   |  3 ++
 .../apache/ambari/server/agent/Register.java|  8 ++-
 .../server/configuration/Configuration.java |  7 +++
 .../server/controller/ShortTaskStatus.java  | 29 ++-
 .../server/controller/TaskStatusResponse.java   |  4 +-
 .../internal/TaskResourceProvider.java  |  4 ++
 .../orm/entities/HostRoleCommandEntity.java | 21 
 .../org/apache/ambari/server/state/Host.java| 12 +
 .../ambari/server/state/host/HostImpl.java  | 20 +++-
 .../server/upgrade/UpgradeCatalog170.java   | 16 ++
 .../main/resources/Ambari-DDL-MySQL-CREATE.sql  |  2 +-
 .../main/resources/Ambari-DDL-Oracle-CREATE.sql |  2 +-
 .../resources/Ambari-DDL-Postgres-CREATE.sql|  2 +-
 .../Ambari-DDL-Postgres-EMBEDDED-CREATE.sql |  2 +-
 .../src/main/resources/properties.json  |  2 +
 .../HDP/2.1/services/HIVE/metainfo.xml.orig | 51 
 .../server/agent/LocalAgentSimulator.java   |  2 +
 .../server/agent/TestHeartbeatHandler.java  |  4 ++
 .../AmbariManagementControllerTest.java | 44 +
 .../internal/TaskResourceProviderTest.java  |  2 +-
 .../server/orm/InMemoryDefaultTestModule.java   |  4 +-
 .../global/background_operations_controller.js  |  2 +
 ambari-web/app/messages.js  |  2 +-
 ambari-web/app/utils/host_progress_popup.js |  5 +-
 .../views/wizard/step9/hostLogPopupBody_view.js |  2 -
 30 files changed, 227 insertions(+), 75 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/f3aab68e/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py 
b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
index 123288b..d023cde 100644
--- a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
+++ b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
@@ -122,9 +122,6 @@ class ActionQueue(threading.Thread):
   except (Queue.Empty):
 pass
 
-
-
-
   def process_command(self, command):
 logger.debug(Took an element of Queue:  + pprint.pformat(command))
 # make sure we log failures
@@ -157,6 +154,8 @@ class ActionQueue(threading.Thread):
 taskId = command['taskId']
 # Preparing 'IN_PROGRESS' report
 in_progress_status = self.commandStatuses.generate_report_template(command)
+# The path of the files that contain the output log and error log use a 
prefix that the agent advertises to the
+# server. The prefix is defined in agent-config.ini
 in_progress_status.update({
   'tmpout': self.tmpdir + os.sep + 'output-' + str(taskId) + '.txt',
   'tmperr': self.tmpdir + os.sep + 'errors-' + str(taskId) + '.txt',

http://git-wip-us.apache.org/repos/asf/ambari/blob/f3aab68e/ambari-agent/src/main/python/ambari_agent/Register.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/Register.py 
b/ambari-agent/src/main/python/ambari_agent/Register.py
index dbf0ef1..fada031 100644
--- a/ambari-agent/src/main/python/ambari_agent/Register.py
+++ b/ambari-agent/src/main/python/ambari_agent/Register.py
@@ -52,7 +52,8 @@ class Register:
  'publicHostname': hostname.public_hostname(),
  'hardwareProfile'   : self.hardware.get(),
  'agentEnv'  : agentEnv,
- 'agentVersion'  : version
+ 'agentVersion'  : version,
+ 'prefix': self.config.get('agent', 'prefix')
}
 return register
 


git commit: AMBARI-6585. Deleted hosts come back to life after ambari-server restart. (Alejandro Fernandez via swagle)

2014-07-25 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk f3aab68ec - fb16c640c


AMBARI-6585. Deleted hosts come back to life after ambari-server restart. 
(Alejandro Fernandez via swagle)


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

Branch: refs/heads/trunk
Commit: fb16c640cf84ea62fc84a60a83e4791b1cefcebe
Parents: f3aab68
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Thu Jul 24 23:47:26 2014 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Thu Jul 24 23:47:26 2014 -0700

--
 .../server/orm/entities/ClusterEntity.java  | 16 +++
 .../ambari/server/orm/entities/HostEntity.java  | 29 ++--
 .../server/state/cluster/ClustersImpl.java  | 13 +
 3 files changed, 14 insertions(+), 44 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/fb16c640/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterEntity.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterEntity.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterEntity.java
index 7e01140..6fb9b5a 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterEntity.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterEntity.java
@@ -162,24 +162,16 @@ public class ClusterEntity {
 
 ClusterEntity that = (ClusterEntity) o;
 
-if (clusterId != null ? !clusterId.equals(that.clusterId) : that.clusterId 
!= null) return false;
-if (clusterInfo != null ? !clusterInfo.equals(that.clusterInfo) : 
that.clusterInfo != null) return false;
-if (clusterName != null ? !clusterName.equals(that.clusterName) : 
that.clusterName != null) return false;
-if (desiredClusterState != null ? 
!desiredClusterState.equals(that.desiredClusterState) : 
that.desiredClusterState != null)
-  return false;
-if (desiredStackVersion != null ? 
!desiredStackVersion.equals(that.desiredStackVersion) : 
that.desiredStackVersion != null)
-  return false;
+if (!clusterId.equals(that.clusterId)) return false;
+if (!clusterName.equals(that.clusterName)) return false;
 
 return true;
   }
 
   @Override
   public int hashCode() {
-int result = clusterId != null ? clusterId.intValue() : 0;
-result = 31 * result + (clusterName != null ? clusterName.hashCode() : 0);
-result = 31 * result + (desiredClusterState != null ? 
desiredClusterState.hashCode() : 0);
-result = 31 * result + (clusterInfo != null ? clusterInfo.hashCode() : 0);
-result = 31 * result + (desiredStackVersion != null ? 
desiredStackVersion.hashCode() : 0);
+int result = clusterId.hashCode();
+result = 31 * result + clusterName.hashCode();
 return result;
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/fb16c640/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostEntity.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostEntity.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostEntity.java
index 0739ddf..a71fddb 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostEntity.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostEntity.java
@@ -237,39 +237,14 @@ public class HostEntity {
 
 HostEntity that = (HostEntity) o;
 
-if (cpuCount != null ? !cpuCount.equals(that.cpuCount) : that.cpuCount != 
null) return false;
-if (lastRegistrationTime != null ? 
!lastRegistrationTime.equals(that.lastRegistrationTime) : 
that.lastRegistrationTime != null) return false;
-if (totalMem != null ? !totalMem.equals(that.totalMem) : that.totalMem != 
null) return false;
-if (cpuInfo != null ? !cpuInfo.equals(that.cpuInfo) : that.cpuInfo != 
null) return false;
-if (discoveryStatus != null ? 
!discoveryStatus.equals(that.discoveryStatus) : that.discoveryStatus != null)
-  return false;
-if (hostAttributes != null ? !hostAttributes.equals(that.hostAttributes) : 
that.hostAttributes != null)
-  return false;
-if (hostName != null ? !hostName.equals(that.hostName) : that.hostName != 
null) return false;
-if (ipv4 != null ? !ipv4.equals(that.ipv4) : that.ipv4 != null) return 
false;
-if (osArch != null ? !osArch.equals(that.osArch) : that.osArch != null) 
return false;
-if (osInfo != null ? !osInfo.equals(that.osInfo) : that.osInfo != null) 
return false;
-if (osType != null 

git commit: AMBARI-6607. Alerts for gmonds are generated even it gmond does not exist (aonishuk)

2014-07-25 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/trunk fb16c640c - 55f928c9d


AMBARI-6607. Alerts for gmonds are generated even it gmond does not exist 
(aonishuk)


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

Branch: refs/heads/trunk
Commit: 55f928c9db5a4b45d7e9d80f97a9603d928a2909
Parents: fb16c64
Author: Andrew Onishuk aonis...@hortonworks.com
Authored: Fri Jul 25 12:17:33 2014 +0300
Committer: Andrew Onishuk aonis...@hortonworks.com
Committed: Fri Jul 25 12:17:33 2014 +0300

--
 .../services/NAGIOS/package/templates/hadoop-services.cfg.j2 | 8 
 1 file changed, 8 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/55f928c9/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/hadoop-services.cfg.j2
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/hadoop-services.cfg.j2
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/hadoop-services.cfg.j2
index 2b2df1e..0f4f2ca 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/hadoop-services.cfg.j2
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/hadoop-services.cfg.j2
@@ -160,6 +160,7 @@ define service {
 max_check_attempts  4
 }
 
+{% if hostgroup_defs['namenode'] %}
 define service {
 hostgroup_name ganglia-server
 use hadoop-service
@@ -170,7 +171,9 @@ define service {
 retry_check_interval0.25
 max_check_attempts  4
 }
+{% endif %}
 
+{% if hostgroup_defs['hbasemasters'] %}
 define service {
 hostgroup_name ganglia-server
 use hadoop-service
@@ -181,7 +184,9 @@ define service {
 retry_check_interval0.25
 max_check_attempts  4
 }
+{% endif %}
 
+{% if hostgroup_defs['resourcemanager'] %}
 define service {
 hostgroup_name ganglia-server
 use hadoop-service
@@ -192,7 +197,9 @@ define service {
 retry_check_interval0.25
 max_check_attempts  4
 }
+{% endif %}
 
+{% if hostgroup_defs['historyserver2'] %}
 define service {
 hostgroup_name ganglia-server
 use hadoop-service
@@ -204,6 +211,7 @@ define service {
 max_check_attempts  4
 }
 {% endif %}
+{% endif %}
 
 
 {% if hostgroup_defs['snamenode'] and hostgroup_defs['namenode'] != None %}



git commit: AMBARI-6609 Ambari-DDL-Postgres-CREATE.sql fix for CLUSTER.OPERATE (dsen)

2014-07-25 Thread dsen
Repository: ambari
Updated Branches:
  refs/heads/trunk 55f928c9d - 54243b8a7


AMBARI-6609 Ambari-DDL-Postgres-CREATE.sql fix for CLUSTER.OPERATE (dsen)


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

Branch: refs/heads/trunk
Commit: 54243b8a74c680baa23336e5567525a1a840e8ec
Parents: 55f928c
Author: Dmytro Sen d...@hortonworks.com
Authored: Fri Jul 25 13:24:33 2014 +0300
Committer: Dmytro Sen d...@hortonworks.com
Committed: Fri Jul 25 13:24:33 2014 +0300

--
 ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/54243b8a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
--
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 
b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
index 8ddd8e8..73bf442 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
@@ -333,7 +333,7 @@ BEGIN;
   UNION ALL
   SELECT 2, 'CLUSTER.READ', 2
   UNION ALL
-  SELECT 3, CLUSTER.OPERATE'', 2
+  SELECT 3, 'CLUSTER.OPERATE', 2
   UNION ALL
   SELECT 4, 'VIEW.USE', 3;
 



git commit: AMBARI-6021. Hive ports are not configurable (aonishuk)

2014-07-25 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/trunk 54243b8a7 - 5399843e4


AMBARI-6021. Hive ports are not configurable (aonishuk)


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

Branch: refs/heads/trunk
Commit: 5399843e4cbb9f394560028b7de92f710ca0aad0
Parents: 54243b8
Author: Andrew Onishuk aonis...@hortonworks.com
Authored: Fri Jul 25 14:03:33 2014 +0300
Committer: Andrew Onishuk aonis...@hortonworks.com
Committed: Fri Jul 25 14:03:33 2014 +0300

--
 .../2.1.GlusterFS/services/HIVE/configuration/hive-site.xml  | 8 
 .../stacks/HDP/2.1/services/HIVE/configuration/hive-site.xml | 8 
 2 files changed, 16 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/5399843e/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/HIVE/configuration/hive-site.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/HIVE/configuration/hive-site.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/HIVE/configuration/hive-site.xml
index b584f73..c4e3d76 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/HIVE/configuration/hive-site.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/HIVE/configuration/hive-site.xml
@@ -472,4 +472,12 @@ limitations under the License.
 descriptionDetermines caching mechanism DataNucleus L2 cache will use. 
It is strongly recommended to use default value of 'none' as other values may 
cause consistency errors in Hive./description
   /property
 
+  property
+namehive.server2.thrift.port/name
+value1/value
+description
+  TCP port number to listen on, default 1.
+/description
+  /property
+
 /configuration

http://git-wip-us.apache.org/repos/asf/ambari/blob/5399843e/ambari-server/src/main/resources/stacks/HDP/2.1/services/HIVE/configuration/hive-site.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.1/services/HIVE/configuration/hive-site.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.1/services/HIVE/configuration/hive-site.xml
index ee9abf0..6e60be2 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.1/services/HIVE/configuration/hive-site.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.1/services/HIVE/configuration/hive-site.xml
@@ -490,4 +490,12 @@ limitations under the License.
 descriptionDetermines caching mechanism DataNucleus L2 cache will use. 
It is strongly recommended to use default value of 'none' as other values may 
cause consistency errors in Hive./description
   /property
 
+  property
+namehive.server2.thrift.port/name
+value1/value
+description
+  TCP port number to listen on, default 1.
+/description
+  /property
+
 /configuration



git commit: AMBARI-6610. Ambari POM Version not updated on release (dlysnichenko)

2014-07-25 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 5399843e4 - ebfd77fd5


AMBARI-6610. Ambari POM Version not updated on release (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: ebfd77fd50b3bf40471c6f298420fe9e5eb2fa76
Parents: 5399843
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Fri Jul 25 17:26:50 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Fri Jul 25 17:26:50 2014 +0300

--
 contrib/views/pom.xml| 5 -
 contrib/views/slider/pom.xml | 3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ebfd77fd/contrib/views/pom.xml
--
diff --git a/contrib/views/pom.xml b/contrib/views/pom.xml
index 363ff0e..1a9c097 100644
--- a/contrib/views/pom.xml
+++ b/contrib/views/pom.xml
@@ -22,6 +22,9 @@
   packagingpom/packaging
   version0.1.0-SNAPSHOT/version
   nameAmbari Contrib Views/name
+  properties
+ambari.version1.3.0-SNAPSHOT/ambari.version
+  /properties
   modules
 modulefiles/module
 modulepig/module
@@ -118,7 +121,7 @@
   dependency
 groupIdorg.apache.ambari/groupId
 artifactIdambari-views/artifactId
-version[1.5.0.1,)/version
+version[${ambari.version},)/version
   /dependency
 /dependencies
   /dependencyManagement

http://git-wip-us.apache.org/repos/asf/ambari/blob/ebfd77fd/contrib/views/slider/pom.xml
--
diff --git a/contrib/views/slider/pom.xml b/contrib/views/slider/pom.xml
index f2279d1..9f66554 100644
--- a/contrib/views/slider/pom.xml
+++ b/contrib/views/slider/pom.xml
@@ -369,7 +369,8 @@
nodejs.directory${basedir}/target/nodejs/nodejs.directory
npm.version1.4.3/npm.version
ui.directory${basedir}/src/main/resources/ui/ui.directory
-   ambari.version1.3.0-SNAPSHOT/ambari.version
+   !-- deprecated, moved to top component --
+   !-- ambari.version1.3.0-SNAPSHOT/ambari.version --
hadoop.version2.4.0/hadoop.version
avro.version1.7.4/avro.version
bigtop.version0.7.0/bigtop.version



git commit: AMBARI-6621. RM HA Wizard: Show confirmation popup if user try to close wizard on the last step. (akovalenko)

2014-07-25 Thread akovalenko
Repository: ambari
Updated Branches:
  refs/heads/trunk ebfd77fd5 - d6949dc37


AMBARI-6621. RM HA Wizard: Show confirmation popup if user try to close wizard 
on the last step. (akovalenko)


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

Branch: refs/heads/trunk
Commit: d6949dc3784961da1f70dfa2435d6770df52d173
Parents: ebfd77f
Author: Aleksandr Kovalenko akovale...@hortonworks.com
Authored: Fri Jul 25 19:51:09 2014 +0300
Committer: Aleksandr Kovalenko akovale...@hortonworks.com
Committed: Fri Jul 25 19:51:09 2014 +0300

--
 ambari-web/app/messages.js  |  1 +
 .../app/routes/rm_high_availability_routes.js   | 39 +---
 2 files changed, 27 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d6949dc3/ambari-web/app/messages.js
--
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 56d99a1..44f9bad 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -840,6 +840,7 @@ Em.I18n.translations = {
   'admin.highAvailability.error.security':'You cannot enable NameNode HA via 
this wizard as your cluster is already secured.  First, disable security by 
going to Admin  Security, and then run this Enable NameNode HA wizard again.  
After NameNode HA is enabled, you can go back to Admin  Security to secure the 
cluster.',
   '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.',
+  'admin.rm_highAvailability.closePopup':'Enable ResourceManager HA Wizard is 
in progress. You must allow the wizard to complete for Ambari to be in usable 
state. If you choose to quit, you must follow manual instructions to complete 
or revert enabling ResourceManager HA as documented in the Ambari User Guide. 
Are you sure you want to exit the wizard?',
 
   'admin.highAvailability.wizard.header':'Enable NameNode HA Wizard',
   'admin.highAvailability.wizard.progressPage.notice.inProgress':'Please wait 
while NameNode HA is being deployed.',

http://git-wip-us.apache.org/repos/asf/ambari/blob/d6949dc3/ambari-web/app/routes/rm_high_availability_routes.js
--
diff --git a/ambari-web/app/routes/rm_high_availability_routes.js 
b/ambari-web/app/routes/rm_high_availability_routes.js
index a84c1f5..dcc7c8d 100644
--- a/ambari-web/app/routes/rm_high_availability_routes.js
+++ b/ambari-web/app/routes/rm_high_availability_routes.js
@@ -36,18 +36,30 @@ module.exports = App.WizardRoute.extend({
 secondary: null,
 
 onClose: function () {
-  var controller = 
App.router.get('rMHighAvailabilityWizardController');
-  controller.clearStorageData();
-  controller.setCurrentStep('1');
-  App.router.get('updateController').set('isWorking', true);
-  App.clusterStatus.setClusterStatus({
-clusterName: App.router.get('content.cluster.name'),
-clusterState: 'DEFAULT',
-wizardControllerName: 
App.router.get('rMHighAvailabilityWizardController.name'),
-localdb: App.db.data
-  });
-  this.hide();
-  App.router.transitionTo('main.admin.adminHighAvailability');
+  var rMHighAvailabilityWizardController = 
router.get('rMHighAvailabilityWizardController');
+  var currStep = rMHighAvailabilityWizardController.get('currentStep');
+
+  if (parseInt(currStep) === 4) {
+var self = this;
+App.showConfirmationPopup(function () {
+  self.hide();
+  rMHighAvailabilityWizardController.setCurrentStep('1');
+  App.clusterStatus.setClusterStatus({
+clusterName: App.router.getClusterName(),
+clusterState: 'DEFAULT',
+wizardControllerName: 
rMHighAvailabilityWizardController.get('name'),
+localdb: App.db.data
+  });
+  router.get('updateController').set('isWorking', true);
+  router.transitionTo('main.admin.adminHighAvailability.index');
+  location.reload();
+}, Em.I18n.t('admin.rm_highAvailability.closePopup'));
+  } else {
+this.hide();
+rMHighAvailabilityWizardController.setCurrentStep('1');
+router.get('updateController').set('isWorking', true);
+

git commit: AMBARI-6620. Alerts: DAO Relationships and Cascading (Jonathan Hurley via ncole)

2014-07-25 Thread ncole
Repository: ambari
Updated Branches:
  refs/heads/trunk d4b0b2f6f - 7602acae4


AMBARI-6620. Alerts: DAO Relationships and Cascading (Jonathan Hurley via ncole)


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

Branch: refs/heads/trunk
Commit: 7602acae48d1c6b6369574f53bef552258b5ef21
Parents: d4b0b2f
Author: Nate Cole nc...@hortonworks.com
Authored: Fri Jul 25 16:24:30 2014 -0400
Committer: Nate Cole nc...@hortonworks.com
Committed: Fri Jul 25 16:24:30 2014 -0400

--
 .../AlertDefinitionResourceProvider.java|  33 ++-
 .../server/orm/dao/AlertDefinitionDAO.java  |  30 ++-
 .../ambari/server/orm/dao/AlertDispatchDAO.java |  98 ++-
 .../apache/ambari/server/orm/dao/AlertsDAO.java |  61 -
 .../server/orm/entities/AlertCurrentEntity.java |  21 +-
 .../orm/entities/AlertDefinitionEntity.java |  44 ++-
 .../server/orm/entities/AlertGroupEntity.java   |  16 +-
 .../server/orm/entities/AlertHistoryEntity.java |  33 +--
 .../server/orm/entities/AlertNoticeEntity.java  |   5 +-
 .../server/orm/entities/AlertTargetEntity.java  |  26 +-
 .../resources/Ambari-DDL-Postgres-CREATE.sql|  15 +-
 .../Ambari-DDL-Postgres-EMBEDDED-CREATE.sql |  20 +-
 .../AlertDefinitionResourceProviderTest.java|   4 +-
 .../apache/ambari/server/orm/OrmTestHelper.java |  76 ++
 .../server/orm/dao/AlertDefinitionDAOTest.java  | 148 +++---
 .../server/orm/dao/AlertDispatchDAOTest.java| 270 +--
 .../ambari/server/orm/dao/AlertsDAOTest.java|  58 ++--
 17 files changed, 788 insertions(+), 170 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7602acae/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertDefinitionResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertDefinitionResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertDefinitionResourceProvider.java
index 966d8b5..6f00c27 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertDefinitionResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertDefinitionResourceProvider.java
@@ -42,6 +42,7 @@ import 
org.apache.ambari.server.controller.utilities.PropertyHelper;
 import org.apache.ambari.server.orm.dao.AlertDefinitionDAO;
 import org.apache.ambari.server.orm.entities.AlertDefinitionEntity;
 import org.apache.ambari.server.state.Cluster;
+import org.apache.ambari.server.state.alert.Scope;
 import org.apache.ambari.server.state.alert.SourceType;
 
 import com.google.gson.Gson;
@@ -129,8 +130,9 @@ public class AlertDefinitionResourceProvider extends 
AbstractControllerResourceP
 
 if (!requestMap.containsKey(ALERT_DEF_INTERVAL))
   throw new IllegalArgumentException(Check interval must be specified);
-Long interval = Long.valueOf((String) requestMap.get(ALERT_DEF_INTERVAL));
 
+Integer interval = Integer.valueOf((String) 
requestMap.get(ALERT_DEF_INTERVAL));
+
 if (!requestMap.containsKey(ALERT_DEF_NAME))
   throw new IllegalArgumentException(Definition name must be specified);
 
@@ -159,22 +161,28 @@ public class AlertDefinitionResourceProvider extends 
AbstractControllerResourceP
 Cluster cluster = 
getManagementController().getClusters().getCluster(clusterName);
 
 AlertDefinitionEntity entity = new AlertDefinitionEntity();
-
 entity.setClusterId(Long.valueOf(cluster.getClusterId()));
 entity.setComponentName((String) requestMap.get(ALERT_DEF_COMPONENT_NAME));
 entity.setDefinitionName((String) requestMap.get(ALERT_DEF_NAME));
 
-boolean b = requestMap.containsKey(ALERT_DEF_ENABLED) ?
+boolean enabled = requestMap.containsKey(ALERT_DEF_ENABLED) ?
 Boolean.parseBoolean((String)requestMap.get(ALERT_DEF_ENABLED)) : true;
-entity.setEnabled(b);
 
+entity.setEnabled(enabled);
 entity.setHash(UUID.randomUUID().toString());
 entity.setScheduleInterval(interval);
-entity.setScope((String) requestMap.get(ALERT_DEF_SCOPE));
 entity.setServiceName((String) requestMap.get(ALERT_DEF_SERVICE_NAME));
 entity.setSourceType((String) requestMap.get(ALERT_DEF_SOURCE_TYPE));
 entity.setSource(jsonObj.toString());
 
+Scope scope = null;
+String desiredScope = (String) requestMap.get(ALERT_DEF_SCOPE);
+if (null != desiredScope  desiredScope.length()  0) {
+  scope = Scope.valueOf(desiredScope);
+}
+
+entity.setScope(scope);
+
 return entity;
   }
 

git commit: AMBARI-6343. Views : Admin - Add Group and Group Member Resources. Additional fix.

2014-07-25 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 7602acae4 - 0ae8350bc


AMBARI-6343. Views : Admin - Add Group and Group Member Resources. Additional 
fix.


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

Branch: refs/heads/trunk
Commit: 0ae8350bc62ef827c6de471514e2131385201c8c
Parents: 7602aca
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Fri Jul 25 14:32:20 2014 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Fri Jul 25 14:32:20 2014 -0700

--
 .../server/api/services/MemberService.java  | 15 
 .../controller/AmbariManagementController.java  |  9 +
 .../AmbariManagementControllerImpl.java | 33 -
 .../internal/MemberResourceProvider.java|  2 +-
 .../server/security/authorization/Users.java| 18 +
 .../server/api/services/MemberServiceTest.java  |  6 +++
 .../internal/MemberResourceProviderTest.java| 39 +++-
 7 files changed, 118 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/0ae8350b/ambari-server/src/main/java/org/apache/ambari/server/api/services/MemberService.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/MemberService.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/MemberService.java
index 72e194f..28e53e6 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/MemberService.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/MemberService.java
@@ -23,6 +23,7 @@ import java.util.Map;
 import javax.ws.rs.DELETE;
 import javax.ws.rs.GET;
 import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
@@ -132,6 +133,20 @@ public class MemberService extends BaseService {
   }
 
   /**
+   * Updates all members.
+   * Handles: PUT /groups/{groupname}/members requests.
+   *
+   * @param headershttp headers
+   * @param ui uri info
+   * @return status of the request
+   */
+  @PUT
+  @Produces(text/plain)
+  public Response updateMembers(String body, @Context HttpHeaders headers, 
@Context UriInfo ui) {
+return handleRequest(headers, body, ui, Request.Type.PUT, 
createMemberResource(groupName, null));
+  }
+
+  /**
* Create a member resource instance.
*
* @param groupName  group name

http://git-wip-us.apache.org/repos/asf/ambari/blob/0ae8350b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
index 2776394..b2c5ed0 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
@@ -249,6 +249,15 @@ public interface AmbariManagementController {
*/
   public void updateGroups(SetGroupRequest requests) throws AmbariException;
 
+  /**
+   * Updates the members of the group specified.
+   *
+   * @param requests the members to be set for this group
+   *
+   * @throws AmbariException if the resources cannot be updated
+   */
+  public void updateMembers(SetMemberRequest requests) throws 
AmbariException;
+
 
   // - Delete ---
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/0ae8350b/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 64383fe..b25e56c 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
@@ -23,6 +23,7 @@ import com.google.inject.Inject;
 import com.google.inject.Injector;
 import com.google.inject.Singleton;
 import com.google.inject.persist.Transactional;
+
 import java.io.File;
 import java.io.IOException;
 import java.net.InetAddress;
@@ -58,6 +59,7 @@ import 

git commit: AMBARI-6588. Decommission/Recommission BG window UI defects.(xiwang)

2014-07-25 Thread xiwang
Repository: ambari
Updated Branches:
  refs/heads/trunk 0ae8350bc - 9100e08a7


AMBARI-6588. Decommission/Recommission BG window UI defects.(xiwang)


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

Branch: refs/heads/trunk
Commit: 9100e08a7b7a8c0f050ef6f22843f9f7eaf8cc29
Parents: 0ae8350
Author: Xi Wang xiw...@apache.org
Authored: Wed Jul 23 15:38:37 2014 -0700
Committer: Xi Wang xiw...@apache.org
Committed: Fri Jul 25 14:38:39 2014 -0700

--
 .../controllers/global/background_operations_controller.js| 2 ++
 ambari-web/app/models/stack_service_component.js  | 1 +
 ambari-web/app/utils/helper.js| 7 ---
 ambari-web/app/utils/host_progress_popup.js   | 2 +-
 4 files changed, 8 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9100e08a/ambari-web/app/controllers/global/background_operations_controller.js
--
diff --git 
a/ambari-web/app/controllers/global/background_operations_controller.js 
b/ambari-web/app/controllers/global/background_operations_controller.js
index 52108f7..b6dc603 100644
--- a/ambari-web/app/controllers/global/background_operations_controller.js
+++ b/ambari-web/app/controllers/global/background_operations_controller.js
@@ -123,6 +123,7 @@ App.BackgroundOperationsController = Em.Controller.extend({
*/
   callBackFilteredByRequest: function (data, ajaxQuery, params) {
 var requestId = data.Requests.id;
+var requestInputs = data.Requests.inputs;
 var request = this.get('services').findProperty('id', requestId);
 var hostsMap = {};
 var previousTaskStatusMap = request.get('previousTaskStatusMap');
@@ -130,6 +131,7 @@ App.BackgroundOperationsController = Em.Controller.extend({
 data.tasks.forEach(function (task) {
   var host = hostsMap[task.Tasks.host_name];
   task.Tasks.request_id = requestId;
+  task.Tasks.request_inputs = requestInputs;
   if (host) {
 host.logTasks.push(task);
 host.isModified = (host.isModified) ? true : 
previousTaskStatusMap[task.Tasks.id] !== task.Tasks.status;

http://git-wip-us.apache.org/repos/asf/ambari/blob/9100e08a/ambari-web/app/models/stack_service_component.js
--
diff --git a/ambari-web/app/models/stack_service_component.js 
b/ambari-web/app/models/stack_service_component.js
index 3f42eb6..ff6da8b 100644
--- a/ambari-web/app/models/stack_service_component.js
+++ b/ambari-web/app/models/stack_service_component.js
@@ -212,3 +212,4 @@ App.StackServiceComponent.coHost = {
   'HIVE_METASTORE': 'HIVE_SERVER',
   'WEBHCAT_SERVER': 'HIVE_SERVER'
 };
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/9100e08a/ambari-web/app/utils/helper.js
--
diff --git a/ambari-web/app/utils/helper.js b/ambari-web/app/utils/helper.js
index efa5ce3..d9e6136 100644
--- a/ambari-web/app/utils/helper.js
+++ b/ambari-web/app/utils/helper.js
@@ -406,9 +406,10 @@ App.format = {
* @memberof App.format
* @method commandDetail
* @param {string} command_detail
+   * @param {string} request_inputs
* @return {string}
*/
-  commandDetail: function (command_detail) {
+  commandDetail: function (command_detail, request_inputs) {
 var detailArr = command_detail.split(' ');
 var self = this;
 var result = '';
@@ -417,9 +418,9 @@ App.format = {
   if (item.contains('/')) {
 item = item.split('/')[1];
   }
-  // ignore 'DECOMMISSION', command came from 'excluded/included'
   if (item == 'DECOMMISSION,') {
-item = '';
+// ignore text 'DECOMMISSION,'( command came from 
'excluded/included'), here get the component name from request_inputs
+item = (jQuery.parseJSON(request_inputs)) ? 
jQuery.parseJSON(request_inputs).slave_type : '';
   }
   if (self.components[item]) {
 result = result + ' ' + self.components[item];

http://git-wip-us.apache.org/repos/asf/ambari/blob/9100e08a/ambari-web/app/utils/host_progress_popup.js
--
diff --git a/ambari-web/app/utils/host_progress_popup.js 
b/ambari-web/app/utils/host_progress_popup.js
index 41dd17a..529b8bb 100644
--- a/ambari-web/app/utils/host_progress_popup.js
+++ b/ambari-web/app/utils/host_progress_popup.js
@@ -298,7 +298,7 @@ App.HostPopup = Em.Object.create({
   id: _task.Tasks.id,
   hostName: _task.Tasks.host_name,
   command: ( _task.Tasks.command.toLowerCase() != 

git commit: AMBARI-5937. Provide ability to refresh capacity scheduler queues.

2014-07-25 Thread mahadev
Repository: ambari
Updated Branches:
  refs/heads/trunk 9100e08a7 - d7c0d8ae6


AMBARI-5937. Provide ability to refresh capacity scheduler queues.


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

Branch: refs/heads/trunk
Commit: d7c0d8ae60c595891e038e3aa2ec77b6d1f50ffa
Parents: 9100e08
Author: Mahadev Konar maha...@apache.org
Authored: Fri Jul 25 16:47:21 2014 -0700
Committer: Mahadev Konar maha...@apache.org
Committed: Fri Jul 25 16:47:21 2014 -0700

--
 .../src/main/python/ambari_agent/ActionQueue.py |  12 +
 .../python/ambari_agent/ActualConfigHandler.py  |   8 +
 .../ambari/server/agent/ExecutionCommand.java   |  13 +
 .../server/api/util/StackExtensionHelper.java   |  30 ++-
 .../server/configuration/Configuration.java |   2 +-
 .../AmbariCustomCommandExecutionHelper.java |  26 +-
 .../ambari/server/state/ComponentInfo.java  |  16 ++
 .../ambari/server/state/ConfigHelper.java   |  15 +-
 .../apache/ambari/server/state/ServiceInfo.java |  33 ++-
 .../stacks/HDP/2.0.6/services/YARN/metainfo.xml |   4 +-
 .../services/YARN/package/scripts/service.py|   2 +-
 .../stacks/HDP/2.1/services/YARN/metainfo.xml   |   9 +-
 .../server/api/services/AmbariMetaInfoTest.java |   3 +-
 .../api/util/StackExtensionHelperTest.java  |   5 +-
 .../AmbariCustomCommandExecutionHelperTest.java | 225 ++
 .../AmbariManagementControllerTest.java |  14 +-
 ...hYarnCapacitySchedulerReleaseConfigTest.java | 237 +++
 .../stacks/HDP/2.0.5/services/YARN/metainfo.xml |   4 +-
 .../stacks/HDP/2.0.6/services/YARN/metainfo.xml |   5 +-
 .../stacks/HDP/2.0.7/services/YARN/metainfo.xml |   5 +-
 ambari-web/app/controllers/main/service/item.js |  44 
 ambari-web/app/messages.js  |   3 +
 ambari-web/app/utils/ajax/ajax.js   |  17 ++
 ambari-web/app/views/main/service/item.js   |   9 +
 24 files changed, 710 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d7c0d8ae/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py 
b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
index d023cde..58d3e75 100644
--- a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
+++ b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
@@ -194,6 +194,18 @@ class ActionQueue(threading.Thread):
 # let ambari know that configuration tags were applied
 if status == self.COMPLETED_STATUS:
   configHandler = ActualConfigHandler(self.config, self.configTags)
+  #update 
+  if command.has_key('forceRefreshConfigTags') and 
len(command['forceRefreshConfigTags'])  0  :
+
+forceRefreshConfigTags = command['forceRefreshConfigTags']
+logger.info(Got refresh additional component tags command)
+
+for configTag in forceRefreshConfigTags :
+  configHandler.update_component_tag(command['role'], configTag, 
command['configurationTags'][configTag])
+
+roleResult['customCommand'] = self.CUSTOM_COMMAND_RESTART # force 
restart for component to evict stale_config on server side
+command['configurationTags'] = 
configHandler.read_actual_component(command['role'])
+
   if command.has_key('configurationTags'):
 configHandler.write_actual(command['configurationTags'])
 roleResult['configurationTags'] = command['configurationTags']

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7c0d8ae/ambari-agent/src/main/python/ambari_agent/ActualConfigHandler.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/ActualConfigHandler.py 
b/ambari-agent/src/main/python/ambari_agent/ActualConfigHandler.py
index d8349ef..a038d8c 100644
--- a/ambari-agent/src/main/python/ambari_agent/ActualConfigHandler.py
+++ b/ambari-agent/src/main/python/ambari_agent/ActualConfigHandler.py
@@ -90,3 +90,11 @@ class ActualConfigHandler:
   self.configTags[componentName] = \
 self.read_file(componentName + _ + self.CONFIG_NAME)
 return self.configTags[componentName]
+  
+  def update_component_tag(self, componentName, tag, version):
+self.read_actual_component(componentName)
+self.configTags[componentName][tag] = version
+
+filename = componentName + _ + self.CONFIG_NAME
+self.write_file(filename, self.configTags[componentName])
+


git commit: AMBARI-6463. Installer wizard not showing service configs for selected services on renavigation. (jaimin)

2014-07-25 Thread jaimin
Repository: ambari
Updated Branches:
  refs/heads/trunk d7c0d8ae6 - cb2bb4dbc


AMBARI-6463. Installer wizard not showing service configs for selected services 
on renavigation. (jaimin)


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

Branch: refs/heads/trunk
Commit: cb2bb4dbcf132166aff05cb36d48278f9cb851ea
Parents: d7c0d8a
Author: Jaimin Jetly jai...@hortonworks.com
Authored: Fri Jul 25 17:05:55 2014 -0700
Committer: Jaimin Jetly jai...@hortonworks.com
Committed: Fri Jul 25 17:06:09 2014 -0700

--
 ambari-web/app/app.js  |  4 +++-
 ambari-web/app/controllers/wizard.js   | 12 +-
 ambari-web/app/mappers/stack_service_mapper.js | 24 +--
 ambari-web/app/utils/helper.js | 26 +
 4 files changed, 52 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/cb2bb4db/ambari-web/app/app.js
--
diff --git a/ambari-web/app/app.js b/ambari-web/app/app.js
index 55d7b46..47aa25b 100644
--- a/ambari-web/app/app.js
+++ b/ambari-web/app/app.js
@@ -28,7 +28,9 @@ module.exports = Em.Application.create({
 revision: 4,
 adapter: DS.FixtureAdapter.create({
   simulateRemoteResponse: false
-})
+}),
+typeMaps: {},
+recordCache: []
   }),
   isAdmin: false,
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb2bb4db/ambari-web/app/controllers/wizard.js
--
diff --git a/ambari-web/app/controllers/wizard.js 
b/ambari-web/app/controllers/wizard.js
index 2bd9ec5..860a782 100644
--- a/ambari-web/app/controllers/wizard.js
+++ b/ambari-web/app/controllers/wizard.js
@@ -517,20 +517,10 @@ App.WizardController = 
Em.Controller.extend(App.LocalStorage, {
   loadedServiceComponents: null,
 
   /**
-   * Clean store from already loaded data.
-   **/
-  clearStackModels: function () {
-if (App.StackService.find().get('content').length) {
-  App.StackServiceComponent.find().set('content', []);
-  App.StackService.find().set('content', []);
-}
-  },
-  /**
* Generate serviceComponents as pr the stack definition  and save it to 
localdata
* called form stepController step4WizardController
*/
   loadServiceComponents: function () {
-this.clearStackModels();
 return App.ajax.send({
   name: 'wizard.service_components',
   sender: this,
@@ -575,7 +565,7 @@ App.WizardController = 
Em.Controller.extend(App.LocalStorage, {
   }, this);
 }
 
-App.stackServiceMapper.map(jsonData);
+App.stackServiceMapper.mapStackServices(jsonData);
   },
 
   loadServiceComponentsErrorCallback: function (request, ajaxOptions, error) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb2bb4db/ambari-web/app/mappers/stack_service_mapper.js
--
diff --git a/ambari-web/app/mappers/stack_service_mapper.js 
b/ambari-web/app/mappers/stack_service_mapper.js
index 1577937..9960e14 100644
--- a/ambari-web/app/mappers/stack_service_mapper.js
+++ b/ambari-web/app/mappers/stack_service_mapper.js
@@ -55,6 +55,13 @@ App.stackServiceMapper = App.QuickDataMapper.create({
 }
   },
 
+  mapStackServices: function(json) {
+this.clearStackModels();
+App.resetDsStoreTypeMap(App.StackServiceComponent);
+App.resetDsStoreTypeMap(App.StackService);
+this.map(json);
+  },
+
   map: function (json) {
 var model = this.get('model');
 var result = [];
@@ -75,12 +82,25 @@ App.stackServiceMapper = App.QuickDataMapper.create({
 result.push(this.parseIt(stackService, this.get('config')));
   }
 }, this);
-if (!$.mocho)
-  App.store.commit();
 App.store.loadMany(this.get('component_model'), stackServiceComponents);
 App.store.loadMany(model, result);
   },
 
+  /**
+   * Clean store from already loaded data.
+   **/
+  clearStackModels: function () {
+var models = [App.StackServiceComponent, App.StackService];
+models.forEach(function (model) {
+  var records = App.get('store').findAll(model).filterProperty('id');
+  records.forEach(function (rec) {
+Ember.run(this, function () {
+  rec.deleteRecord();
+});
+  }, this);
+}, this);
+  },
+
   rearrangeServicesForDisplayOrder: function (array, displayOrderArray) {
 return array.sort(function (a, b) {
   var aValue = displayOrderArray.indexOf(a.StackServices.service_name) != 
-1 ? displayOrderArray.indexOf(a.StackServices.service_name) : array.length;