[2/2] ambari git commit: Revert "AMBARI-11575. hive-site.xml property "hive.security.metastore.authorization.manager" becomes invalid when switching values in "Choose Authorization" widget (srimanth)"

2015-06-02 Thread srimanth
Revert "AMBARI-11575. hive-site.xml property 
"hive.security.metastore.authorization.manager" becomes invalid when switching 
values in "Choose Authorization" widget (srimanth)"

This reverts commit 8db087af8f3358bbd795c4ae4643289429151400.

Conflicts:

ambari-server/src/main/resources/stacks/HDPWIN/2.3/services/HIVE/configuration/hive-site.xml


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

Branch: refs/heads/trunk
Commit: f259fd1d0e0f7ae1e0d9bd859bdbd7218b5fecc7
Parents: 8661bdf
Author: Srimanth Gunturi 
Authored: Tue Jun 2 23:16:46 2015 -0700
Committer: Srimanth Gunturi 
Committed: Tue Jun 2 23:16:46 2015 -0700

--
 .../services/HIVE/configuration/hive-site.xml   |   35 +-
 .../HIVE/configuration/hive-site.xml.orig   | 1691 ++
 .../HIVE/configuration/hiveserver2-site.xml |   86 +-
 .../HDP/2.2/services/HIVE/themes/theme.json |   16 +-
 .../stacks/HDP/2.2/services/stack_advisor.py|   43 +-
 .../services/HIVE/configuration/hive-site.xml   |   25 +-
 .../HIVE/configuration/hiveserver2-site.xml |  107 +-
 .../HDPWIN/2.2/services/HIVE/themes/theme.json  |   16 +-
 .../stacks/HDPWIN/2.2/services/stack_advisor.py |   43 +-
 .../stacks/2.2/common/test_stack_advisor.py |   36 +-
 10 files changed, 1894 insertions(+), 204 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/f259fd1d/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
index 73a2d03..5e5c64f 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
@@ -92,12 +92,6 @@ limitations under the License.
   The Hive client authorization manager class name. The user defined 
authorization class should implement
   interface 
org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider.
 
-
-  
-hive-env
-hive_security_authorization
-  
-
   
 
   
@@ -989,17 +983,11 @@ limitations under the License.
   hive client authenticator manager class name. The user defined 
authenticator should implement
   interface org.apache.hadoop.hive.ql.security.HiveAuthenticationProvider.
 
-
-  
-hive-env
-hive_security_authorization
-  
-
   
   
 hive.security.metastore.authorization.manager
 Hive Authorization Manager
-
org.apache.hadoop.hive.ql.security.authorization.StorageBasedAuthorizationProvider
+
org.apache.hadoop.hive.ql.security.authorization.StorageBasedAuthorizationProvider,org.apache.hadoop.hive.ql.security.authorization.MetaStoreAuthzAPIAuthorizerEmbedOnly
 
   authorization manager class name to be used in the metastore for 
authorization.
   The user defined authorization class should implement interface
@@ -1574,27 +1562,6 @@ limitations under the License.
   
 
   
-hive.server2.tez.default.queues
-Default query queues
-default
-
-  A list of comma separated values corresponding to YARN queues of the 
same name.
-  When HiveServer2 is launched in Tez mode, this configuration needs to be 
set
-  for multiple Tez sessions to run in parallel on the cluster.
-
-
-  combo
-  
-
-  default
-  Default
-
-  
-  1+
-
-  
-
-  
 hive.exec.orc.encoding.strategy
 SPEED
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/f259fd1d/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml.orig
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml.orig
 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml.orig
new file mode 100644
index 000..0da7b1c
--- /dev/null
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml.orig
@@ -0,0 +1,1691 @@
+
+
+
+
+
+
+  
+hive.cbo.enable
+true
+Flag to control enabling Cost Based Optimizations using 
Calcite framework.
+Enable Cost Based Optimizer
+
+  value-list
+  
+
+  true
+  On
+
+
+  false
+  Off
+
+  
+  1
+
+  
+

[1/2] ambari git commit: Revert "AMBARI-11575. hive-site.xml property "hive.security.metastore.authorization.manager" becomes invalid when switching values in "Choose Authorization" widget (srimanth)"

2015-06-02 Thread srimanth
Repository: ambari
Updated Branches:
  refs/heads/trunk 8661bdf06 -> f259fd1d0


http://git-wip-us.apache.org/repos/asf/ambari/blob/f259fd1d/ambari-server/src/main/resources/stacks/HDPWIN/2.2/services/HIVE/themes/theme.json
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDPWIN/2.2/services/HIVE/themes/theme.json
 
b/ambari-server/src/main/resources/stacks/HDPWIN/2.2/services/HIVE/themes/theme.json
index 98c9cde..c810f6d 100644
--- 
a/ambari-server/src/main/resources/stacks/HDPWIN/2.2/services/HIVE/themes/theme.json
+++ 
b/ambari-server/src/main/resources/stacks/HDPWIN/2.2/services/HIVE/themes/theme.json
@@ -196,15 +196,15 @@
   "subsection-name": "optimization-row1-col3"
 },
 {
-  "config": "hive-site/hive.server2.tez.default.queues",
+  "config": "hiveserver2-site/hive.server2.tez.default.queues",
   "subsection-name": "interactive-query-row1-col1"
 },
 {
-  "config": "hive-site/hive.server2.tez.initialize.default.sessions",
+  "config": 
"hiveserver2-site/hive.server2.tez.initialize.default.sessions",
   "subsection-name": "interactive-query-row1-col1"
 },
 {
-  "config": "hive-site/hive.server2.tez.sessions.per.default.queue",
+  "config": 
"hiveserver2-site/hive.server2.tez.sessions.per.default.queue",
   "subsection-name": "interactive-query-row1-col1"
 },
 {
@@ -216,7 +216,7 @@
   "subsection-name": "security-row1-col1"
 },
 {
-  "config": "hive-site/hive.server2.enable.doAs",
+  "config": "hiveserver2-site/hive.server2.enable.doAs",
   "subsection-name": "security-row1-col1"
 },
 {
@@ -345,13 +345,13 @@
 }
   },
   {
-"config": "hive-site/hive.server2.tez.initialize.default.sessions",
+"config": 
"hiveserver2-site/hive.server2.tez.initialize.default.sessions",
 "widget": {
   "type": "toggle"
 }
   },
   {
-"config": "hive-site/hive.server2.tez.sessions.per.default.queue",
+"config": 
"hiveserver2-site/hive.server2.tez.sessions.per.default.queue",
 "widget": {
   "type": "slider",
   "units": [
@@ -362,7 +362,7 @@
 }
   },
   {
-"config": "hive-site/hive.server2.enable.doAs",
+"config": "hiveserver2-site/hive.server2.enable.doAs",
 "widget": {
   "type": "toggle"
 }
@@ -397,7 +397,7 @@
 }
   },
   {
-"config": "hive-site/hive.server2.tez.default.queues",
+"config": "hiveserver2-site/hive.server2.tez.default.queues",
 "widget": {
   "type": "list"
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/f259fd1d/ambari-server/src/main/resources/stacks/HDPWIN/2.2/services/stack_advisor.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDPWIN/2.2/services/stack_advisor.py 
b/ambari-server/src/main/resources/stacks/HDPWIN/2.2/services/stack_advisor.py
index 3a81f2a..a46d230 100644
--- 
a/ambari-server/src/main/resources/stacks/HDPWIN/2.2/services/stack_advisor.py
+++ 
b/ambari-server/src/main/resources/stacks/HDPWIN/2.2/services/stack_advisor.py
@@ -371,68 +371,49 @@ class HDPWIN22StackAdvisor(HDPWIN21StackAdvisor):
 putHiveSiteProperty("hive.compute.query.using.stats", "true")
 
 # Interactive Query
-putHiveSiteProperty("hive.server2.tez.initialize.default.sessions", 
"false")
-putHiveSiteProperty("hive.server2.tez.sessions.per.default.queue", "1")
-putHiveSiteProperty("hive.server2.enable.doAs", "true")
+putHiveServerProperty("hive.server2.tez.initialize.default.sessions", 
"false")
+putHiveServerProperty("hive.server2.tez.sessions.per.default.queue", "1")
+putHiveServerProperty("hive.server2.enable.doAs", "true")
 putHiveServerProperty("tez.session.am.dag.submit.timeout.secs", "600")
 
 yarn_queues = "default"
 if "capacity-scheduler" in configurations and \
   "yarn.scheduler.capacity.root.queues" in 
configurations["capacity-scheduler"]["properties"]:
   yarn_queues = 
str(configurations["capacity-scheduler"]["properties"]["yarn.scheduler.capacity.root.queues"])
-putHiveSiteProperty("hive.server2.tez.default.queues", yarn_queues)
+putHiveServerProperty("hive.server2.tez.default.queues", yarn_queues)
 
 # Interactive Queues property attributes
 putHiveServerPropertyAttribute = self.putPropertyAttribute(configurations, 
"hiveserver2-site")
 entries = []
 for queue in yarn_queues.split(","):
   entries.append({"label": str(queue) + " queue", "value": queue})
-putHiveSitePropertyAttribute("hive.server2.tez.default.queues", "entries", 
entries)
+putHiveServerPropertyAttribute("hive.server2.tez.default.queues", 
"entries", entries)
 
 # Security
 

ambari git commit: AMBARI-11501. AMS HBase does not start after Kerberization in distributed mode. Syntax error fixed. (swagle)

2015-06-02 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 377693013 -> 8661bdf06


AMBARI-11501. AMS HBase does not start after Kerberization in distributed mode. 
Syntax error fixed. (swagle)


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

Branch: refs/heads/trunk
Commit: 8661bdf06919f60cfd3df76ee7dba56d9636265d
Parents: 3776930
Author: Siddharth Wagle 
Authored: Tue Jun 2 23:03:38 2015 -0700
Committer: Siddharth Wagle 
Committed: Tue Jun 2 23:04:32 2015 -0700

--
 .../AMBARI_METRICS/0.1.0/package/scripts/hbase_master.py   | 2 +-
 .../AMBARI_METRICS/0.1.0/package/scripts/hbase_regionserver.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/8661bdf0/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase_master.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase_master.py
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase_master.py
index e6fe8eb..b769a0d 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase_master.py
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase_master.py
@@ -34,7 +34,7 @@ class HbaseMaster(Script):
 import params
 env.set_params(params)
 
-hbase(name='master', action)
+hbase('master', action)
 
   def start(self, env):
 import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/8661bdf0/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase_regionserver.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase_regionserver.py
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase_regionserver.py
index e733f49..cf0efef 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase_regionserver.py
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase_regionserver.py
@@ -33,7 +33,7 @@ class HbaseRegionServer(Script):
 import params
 env.set_params(params)
 
-hbase(name='regionserver')
+hbase('regionserver', action)
   
   def start(self, env):
 import params



ambari git commit: AMBARI-11628. Ambari operator (non-admin) is not able to view service configs (srimanth)

2015-06-02 Thread srimanth
Repository: ambari
Updated Branches:
  refs/heads/trunk b7e1bcebf -> 377693013


AMBARI-11628. Ambari operator (non-admin) is not able to view service configs 
(srimanth)


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

Branch: refs/heads/trunk
Commit: 377693013263c03ae31d4fa129652584927b025b
Parents: b7e1bce
Author: Srimanth Gunturi 
Authored: Tue Jun 2 13:52:11 2015 -0700
Committer: Srimanth Gunturi 
Committed: Tue Jun 2 21:47:38 2015 -0700

--
 .../security/authorization/AmbariAuthorizationFilter.java   | 2 +-
 .../authorization/AmbariAuthorizationFilterTest.java| 9 +
 2 files changed, 10 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/37769301/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariAuthorizationFilter.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariAuthorizationFilter.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariAuthorizationFilter.java
index 9b867c0..d14cc78 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariAuthorizationFilter.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariAuthorizationFilter.java
@@ -50,7 +50,7 @@ public class AmbariAuthorizationFilter implements Filter {
 
   private static final String INTERNAL_TOKEN_HEADER = "X-Internal-Token";
 
-  private static final Pattern STACK_ADVISOR_REGEX = 
Pattern.compile("/api/v[0-9]+/stacks/[^/]+/versions/[^/]+/validations.*");
+  private static final Pattern STACK_ADVISOR_REGEX = 
Pattern.compile("/api/v[0-9]+/stacks/[^/]+/versions/[^/]+/(validations|recommendations).*");
 
   public static final String API_VERSION_PREFIX= "/api/v[0-9]+";
   public static final String VIEWS_CONTEXT_PATH_PREFIX = "/views/";

http://git-wip-us.apache.org/repos/asf/ambari/blob/37769301/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariAuthorizationFilterTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariAuthorizationFilterTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariAuthorizationFilterTest.java
index d974fd8..a5df47f 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariAuthorizationFilterTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariAuthorizationFilterTest.java
@@ -271,6 +271,15 @@ public class AmbariAuthorizationFilterTest {
 performGeneralDoFilterTest(null, new int[0], urlTests, true);
   }
 
+  @Test
+  public void testDoFilter_stackAdvisorCalls() throws Exception {
+final Table urlTests = HashBasedTable.create();
+urlTests.put("/api/v1/stacks/HDP/versions/2.3/validations", "POST", true);
+urlTests.put("/api/v1/stacks/HDP/versions/2.3/recommendations", "POST", 
true);
+performGeneralDoFilterTest("user1", new int[] { 
PermissionEntity.CLUSTER_OPERATE_PERMISSION }, urlTests, false);
+performGeneralDoFilterTest("admin", new int[] { 
PermissionEntity.AMBARI_ADMIN_PERMISSION }, urlTests, false);
+  }
+
   /**
* Creates mocks with given permissions and performs all given url tests.
*



ambari git commit: AMBARI-11630 - Falcon Server Seems To Have Hadoop 2.2 Paths After Upgrade (jonathanhurley)

2015-06-02 Thread jonathanhurley
Repository: ambari
Updated Branches:
  refs/heads/trunk 167baf39e -> b7e1bcebf


AMBARI-11630 - Falcon Server Seems To Have Hadoop 2.2 Paths After Upgrade 
(jonathanhurley)


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

Branch: refs/heads/trunk
Commit: b7e1bcebf8244a63ffc594928dbb278370261c68
Parents: 167baf3
Author: Jonathan Hurley 
Authored: Tue Jun 2 19:48:27 2015 -0400
Committer: Jonathan Hurley 
Committed: Tue Jun 2 20:53:30 2015 -0400

--
 .../FALCON/0.5.0.2.1/package/scripts/falcon.py  | 244 ++-
 .../0.5.0.2.1/package/scripts/falcon_server.py  |  21 +-
 .../0.5.0.2.1/package/scripts/params_linux.py   |   1 +
 .../stacks/2.1/FALCON/test_falcon_server.py |  54 ++--
 4 files changed, 178 insertions(+), 142 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b7e1bceb/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py
 
b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py
index b9821bf..db93e7d 100644
--- 
a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py
+++ 
b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py
@@ -17,177 +17,195 @@ limitations under the License.
 
 """
 
-from resource_management import *
 import os.path
+
+from resource_management.core.environment import Environment
+from resource_management.core.source import InlineTemplate
+from resource_management.core.source import Template
+from resource_management.core.resources import Execute
+from resource_management.core.resources.service import Service
+from resource_management.core.resources.service import ServiceConfig
+from resource_management.core.resources.system import Directory
+from resource_management.core.resources.system import File
+from resource_management.libraries.script import Script
+from resource_management.libraries.resources import PropertiesFile
+from resource_management.libraries.functions import format
+
 from ambari_commons import OSConst
 from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl
 
-@OsFamilyFuncImpl(os_family=OsFamilyImpl.DEFAULT)
+@OsFamilyFuncImpl(os_family = OsFamilyImpl.DEFAULT)
 def falcon(type, action = None):
   import params
+
   if action == 'config':
 Directory(params.falcon_pid_dir,
-  owner=params.falcon_user,
-  recursive=True
-)
+  owner = params.falcon_user,
+  recursive = True)
+
 Directory(params.falcon_log_dir,
-  owner=params.falcon_user,
-  recursive=True
-)
+  owner = params.falcon_user,
+  recursive = True)
+
 Directory(params.falcon_webapp_dir,
-  owner=params.falcon_user,
-  recursive=True
-)
+  owner = params.falcon_user,
+  recursive = True)
+
 Directory(params.falcon_home,
-  owner=params.falcon_user,
-  recursive=True
-)
+  owner = params.falcon_user,
+  recursive = True)
+
 Directory(params.etc_prefix_dir,
-  mode=0755,
-  recursive=True
-)
+  mode = 0755,
+  recursive = True)
+
 Directory(params.falcon_conf_dir,
-  owner=params.falcon_user,
-  recursive=True
-)
+  owner = params.falcon_user,
+  recursive = True)
+
 File(params.falcon_conf_dir + '/falcon-env.sh',
- content=InlineTemplate(params.falcon_env_sh_template),
- owner=params.falcon_user
-)
+  content = InlineTemplate(params.falcon_env_sh_template),
+  owner = params.falcon_user)
+
 File(params.falcon_conf_dir + '/client.properties',
- content=Template('client.properties.j2'),
- mode=0644,
- owner=params.falcon_user
-)
+  content = Template('client.properties.j2'),
+  mode = 0644,
+  owner = params.falcon_user)
+
 PropertiesFile(params.falcon_conf_dir + '/runtime.properties',
-   properties=params.falcon_runtime_properties,
-   mode=0644,
-   owner=params.falcon_user
-)
+  properties = params.falcon_runtime_properties,
+  mode = 0644,
+  owner = params.falcon_user)
+
 PropertiesFile(params.falcon_conf_dir + '/startup.properties',
-   properties=params.falcon_startup_properties,
-   mode=0644,
-   owner=params.falcon_user
-)
+  properties = par

ambari git commit: [WinTP2] Oozie Alert: Oozie Server Status alert fires on Windows (jluniya)

2015-06-02 Thread jluniya
Repository: ambari
Updated Branches:
  refs/heads/trunk 1f3745397 -> 167baf39e


[WinTP2] Oozie Alert: Oozie Server Status alert fires on Windows (jluniya)


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

Branch: refs/heads/trunk
Commit: 167baf39e9f1a2c09a9102ce7e850c32d6e15f4b
Parents: 1f37453
Author: Jayush Luniya 
Authored: Tue Jun 2 17:01:16 2015 -0700
Committer: Jayush Luniya 
Committed: Tue Jun 2 17:01:16 2015 -0700

--
 ambari-agent/src/main/python/ambari_agent/alerts/script_alert.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/167baf39/ambari-agent/src/main/python/ambari_agent/alerts/script_alert.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/alerts/script_alert.py 
b/ambari-agent/src/main/python/ambari_agent/alerts/script_alert.py
index fafecac..1263195 100644
--- a/ambari-agent/src/main/python/ambari_agent/alerts/script_alert.py
+++ b/ambari-agent/src/main/python/ambari_agent/alerts/script_alert.py
@@ -96,7 +96,7 @@ class ScriptAlert(BaseAlert):
 
   # try to get basedir for scripts
   # it's needed for server side scripts to properly use resource management
-  matchObj = re.match( r'((.*)services\/(.*)\/package\/)', 
self.path_to_script)
+  matchObj = re.match( r'((.*)services(.*)package)', self.path_to_script)
   if matchObj:
 basedir = matchObj.group(1)
 Logger.logger = logging.getLogger('resource_management')



ambari git commit: AMBARI-11635 [WinTP2] Zookeeper service check fails

2015-06-02 Thread fbarca
Repository: ambari
Updated Branches:
  refs/heads/trunk 216275d95 -> 1f3745397


AMBARI-11635 [WinTP2] Zookeeper service check fails

Fixed service check user context


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

Branch: refs/heads/trunk
Commit: 1f37453977488a855cbf5f0d7b2871930e0e4c92
Parents: 216275d
Author: Florian Barca 
Authored: Tue Jun 2 16:54:17 2015 -0700
Committer: Florian Barca 
Committed: Tue Jun 2 16:54:17 2015 -0700

--
 .../ZOOKEEPER/3.4.5.2.0/package/scripts/service_check.py   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/1f374539/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/service_check.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/service_check.py
 
b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/service_check.py
index 6ffe5f5..2d2b793 100644
--- 
a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/service_check.py
+++ 
b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/service_check.py
@@ -63,7 +63,7 @@ class ZookeeperServiceCheckWindows(ZookeeperServiceCheck):
 
 smoke_cmd = os.path.join(params.hdp_root,"Run-SmokeTests.cmd")
 service = "Zookeeper"
-Execute(format("cmd /C {smoke_cmd} {service}"), logoutput=True)
+Execute(format("cmd /C {smoke_cmd} {service}"), user=params.zk_user, 
logoutput=True)
 
 if __name__ == "__main__":
   ZookeeperServiceCheck().execute()



ambari git commit: AMBARI-11597 [WinTP2] Test Hive setup working with Tez

2015-06-02 Thread fbarca
Repository: ambari
Updated Branches:
  refs/heads/trunk 8d82fe45e -> 216275d95


AMBARI-11597 [WinTP2] Test Hive setup working with Tez

+Added Hive setup step when working with Tez.


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

Branch: refs/heads/trunk
Commit: 216275d9572461be8437296e12d980f0ec68eaf7
Parents: 8d82fe4
Author: Florian Barca 
Authored: Tue Jun 2 16:51:55 2015 -0700
Committer: Florian Barca 
Committed: Tue Jun 2 16:51:55 2015 -0700

--
 .../0.12.0.2.0/package/files/hiveTezSetup.cmd   | 58 
 .../HIVE/0.12.0.2.0/package/scripts/hive.py |  8 +++
 .../package/scripts/params_windows.py   |  2 +
 3 files changed, 68 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/216275d9/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/files/hiveTezSetup.cmd
--
diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/files/hiveTezSetup.cmd
 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/files/hiveTezSetup.cmd
new file mode 100644
index 000..10d6a1c
--- /dev/null
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/files/hiveTezSetup.cmd
@@ -0,0 +1,58 @@
+@echo off
+rem Licensed to the Apache Software Foundation (ASF) under one or more
+rem contributor license agreements.  See the NOTICE file distributed with
+rem this work for additional information regarding copyright ownership.
+rem The ASF licenses this file to You under the Apache License, Version 2.0
+rem (the "License"); you may not use this file except in compliance with
+rem the License.  You may obtain a copy of the License at
+rem
+rem http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing, software
+rem distributed under the License is distributed on an "AS IS" BASIS,
+rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem See the License for the specific language governing permissions and
+rem limitations under the License.
+
+if not defined HADOOP_HOME (
+  set EXITCODE=5
+  goto :errorexit
+)
+if not defined HIVE_HOME (
+  set EXITCODE=6
+  goto :errorexit
+)
+if not defined TEZ_HOME (
+  set EXITCODE=7
+  goto :errorexit
+)
+
+set EXITCODE=0
+
+if not exist %HIVE_HOME%\conf\hive-tez-configured (
+  %HADOOP_HOME%\bin\hadoop.cmd fs -mkdir /apps/tez
+  set EXITCODE=%ERRORLEVEL%
+  if %EXITCODE% neq 0 goto :errorexit
+
+  %HADOOP_HOME%\bin\hadoop.cmd fs -chmod -R 755 /apps/tez
+  set EXITCODE=%ERRORLEVEL%
+  if %EXITCODE% neq 0 goto :errorexit
+
+  %HADOOP_HOME%\bin\hadoop.cmd fs -chown -R hadoop:users /apps/tez
+  set EXITCODE=%ERRORLEVEL%
+  if %EXITCODE% neq 0 goto :errorexit
+
+  %HADOOP_HOME%\bin\hadoop.cmd fs -put %TEZ_HOME%\* /apps/tez
+  set EXITCODE=%ERRORLEVEL%
+  if %EXITCODE% neq 0 goto :errorexit
+
+  %HADOOP_HOME%\bin\hadoop.cmd fs -rm -r -skipTrash /apps/tez/conf
+  set EXITCODE=%ERRORLEVEL%
+  if %EXITCODE% neq 0 goto :errorexit
+
+  echo done > %HIVE_HOME%\conf\hive-tez-configured
+)
+goto :eof
+
+:errorexit
+exit /B %EXITCODE%

http://git-wip-us.apache.org/repos/asf/ambari/blob/216275d9/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
index f0aab9c..32edf71 100644
--- 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
@@ -87,6 +87,14 @@ def hive(name=None):
 logoutput=True
 )
 
+  if name == "hiveserver2":
+if params.hive_execution_engine == "tez":
+  # Init the tez app dir in hadoop
+  script_file = __file__.replace('/', os.sep)
+  cmd_file = os.path.normpath(os.path.join(os.path.dirname(script_file), 
"..", "files", "hiveTezSetup.cmd"))
+
+  Execute("cmd /c " + cmd_file, logoutput=True, user=params.hadoop_user)
+
 
 @OsFamilyFuncImpl(os_family=OsFamilyImpl.DEFAULT)
 def hive(name=None):

http://git-wip-us.apache.org/repos/asf/ambari/blob/216275d9/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_windows.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0

ambari git commit: AMBARI-11633 [WinTP2] Webhcat service check fails

2015-06-02 Thread fbarca
Repository: ambari
Updated Branches:
  refs/heads/trunk b6d9b9c4e -> 8d82fe45e


AMBARI-11633 [WinTP2] Webhcat service check fails

Circumvented the failing smoke tests by directly invoking the Webhcat url with 
the minimum amount of tests required.


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

Branch: refs/heads/trunk
Commit: 8d82fe45e13a9518e46bf2f058a4ef5c5026b64d
Parents: b6d9b9c
Author: Florian Barca 
Authored: Tue Jun 2 16:48:06 2015 -0700
Committer: Florian Barca 
Committed: Tue Jun 2 16:48:06 2015 -0700

--
 .../0.12.0.2.0/configuration/webhcat-site.xml   |  6 +++
 .../package/scripts/webhcat_service_check.py| 48 ++--
 .../HIVE/configuration/webhcat-site.xml | 36 +--
 .../stacks/HDPWIN/2.2/services/stack_advisor.py |  7 +++
 4 files changed, 70 insertions(+), 27 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/8d82fe45/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/configuration/webhcat-site.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/configuration/webhcat-site.xml
 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/configuration/webhcat-site.xml
index 3a81c60..33f7f21 100644
--- 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/configuration/webhcat-site.xml
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/configuration/webhcat-site.xml
@@ -54,6 +54,12 @@ limitations under the License.
   
 
   
+templeton.python
+${env.PYTHON_CMD}
+The path to the Python executable.
+  
+
+  
 templeton.pig.archive
 hdfs:///apps/webhcat/pig.tar.gz
 The path to the Pig archive.

http://git-wip-us.apache.org/repos/asf/ambari/blob/8d82fe45/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/webhcat_service_check.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/webhcat_service_check.py
 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/webhcat_service_check.py
index b22e631..99f52a5 100644
--- 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/webhcat_service_check.py
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/webhcat_service_check.py
@@ -17,6 +17,7 @@ See the License for the specific language governing 
permissions and
 limitations under the License.
 
 """
+import urllib2
 
 from resource_management import *
 from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl
@@ -25,10 +26,51 @@ import time
 
 @OsFamilyFuncImpl(os_family=OSConst.WINSRV_FAMILY)
 def webhcat_service_check():
+  Logger.info("Webhcat smoke test - service status")
+
   import params
-  smoke_cmd = os.path.join(params.hdp_root,"Run-SmokeTests.cmd")
-  service = "WEBHCAT"
-  Execute(format("cmd /C {smoke_cmd} {service}"), user=params.hcat_user, 
logoutput=True)
+  # AMBARI-11633 [WinTP2] Webhcat service check fails
+  # Hive doesn't pass the environment variables correctly to child processes, 
which fails the smoke test.
+  # Reducing the amount of URLs checked to the minimum required.
+  #smoke_cmd = os.path.join(params.hdp_root,"Run-SmokeTests.cmd")
+  #service = "WEBHCAT"
+  #Execute(format("cmd /C {smoke_cmd} {service}"), user=params.hcat_user, 
logoutput=True)
+
+  url_tests = [
+"status",
+#These are the failing ones:
+#"ddl/database?user.name=hadoop",
+#"ddl/database/default/table?user.name=hadoop"
+  ]
+
+
+  import socket
+
+  url_host = socket.getfqdn()
+  url_port = params.config["configurations"]["webhcat-site"]["templeton.port"]
+
+  for url_test in url_tests:
+url_request = "http://{0}:{1}/templeton/v1/{2}".format(url_host, url_port, 
url_test)
+url_response = None
+
+try:
+  # execute the query for the JSON that includes WebHCat status
+  url_response = urllib2.urlopen(url_request, timeout=30)
+
+  status = url_response.getcode()
+  response = url_response.read()
+
+  if status != 200:
+Logger.warning("Webhcat service check status: {0}".format(status))
+  Logger.info("Webhcat service check response: {0}".format(response))
+except urllib2.HTTPError as he:
+  raise Fail("Webhcat check {0} failed: {1}".format(url_request, he.msg))
+finally:
+  if url_response is not None:
+try:
+  url_response.close()
+except:
+  pass
 
 
 @OsFamilyFuncImpl(os_fam

ambari git commit: AMBARI-11531. Can't download client configs for Spark (Gautam Borad via alejandro)

2015-06-02 Thread alejandro
Repository: ambari
Updated Branches:
  refs/heads/trunk 2d0d5022f -> b6d9b9c4e


AMBARI-11531. Can't download client configs for Spark (Gautam Borad via 
alejandro)


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

Branch: refs/heads/trunk
Commit: b6d9b9c4e6b499b324c3d285648a54043189a939
Parents: 2d0d502
Author: Alejandro Fernandez 
Authored: Tue Jun 2 15:37:10 2015 -0700
Committer: Alejandro Fernandez 
Committed: Tue Jun 2 15:37:10 2015 -0700

--
 .../SPARK/1.2.0.2.2/metainfo.xml| 22 
 .../SPARK/1.3.1.2.3/metainfo.xml| 22 
 2 files changed, 44 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b6d9b9c4/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/metainfo.xml 
b/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/metainfo.xml
index 344d9c4..b6eaa5b 100644
--- 
a/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/metainfo.xml
+++ 
b/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/metainfo.xml
@@ -101,6 +101,28 @@
 PYTHON
 600
   
+  
+
+  env
+  spark-log4j.properties
+  spark-log4j-properties
+
+
+  env
+  spark-env.sh
+  spark-env
+
+
+  env
+  spark-metrics.properties
+  spark-metrics-properties
+
+
+  properties
+  spark-defaults.conf
+  spark-defaults
+
+  
 
   
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/b6d9b9c4/ambari-server/src/main/resources/common-services/SPARK/1.3.1.2.3/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/SPARK/1.3.1.2.3/metainfo.xml 
b/ambari-server/src/main/resources/common-services/SPARK/1.3.1.2.3/metainfo.xml
index cc3f7af..3f391a4 100644
--- 
a/ambari-server/src/main/resources/common-services/SPARK/1.3.1.2.3/metainfo.xml
+++ 
b/ambari-server/src/main/resources/common-services/SPARK/1.3.1.2.3/metainfo.xml
@@ -95,6 +95,28 @@
 PYTHON
 600
   
+  
+
+  env
+  spark-log4j.properties
+  spark-log4j-properties
+
+
+  env
+  spark-env.sh
+  spark-env
+
+
+  env
+  spark-metrics.properties
+  spark-metrics-properties
+
+
+  properties
+  spark-defaults.conf
+  spark-defaults
+
+  
 
   
 



ambari git commit: AMBARI-11600 Move Accumulo widgets to HDP 2.3 stack (billie)

2015-06-02 Thread billie
Repository: ambari
Updated Branches:
  refs/heads/trunk df12905a4 -> 2d0d5022f


AMBARI-11600 Move Accumulo widgets to HDP 2.3 stack (billie)


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

Branch: refs/heads/trunk
Commit: 2d0d5022f776e4cf347602d0ec6815a234341758
Parents: df12905
Author: Billie Rinaldi 
Authored: Tue Jun 2 12:48:49 2015 -0700
Committer: Billie Rinaldi 
Committed: Tue Jun 2 12:48:56 2015 -0700

--
 .../ACCUMULO/1.6.1.2.2.0/widgets.json   | 155 ---
 .../HDP/2.3/services/ACCUMULO/widgets.json  | 155 +++
 2 files changed, 155 insertions(+), 155 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/2d0d5022/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/widgets.json
--
diff --git 
a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/widgets.json
 
b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/widgets.json
deleted file mode 100644
index 8bdbc22..000
--- 
a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/widgets.json
+++ /dev/null
@@ -1,155 +0,0 @@
-{
-  "layouts": [
-{
-  "layout_name": "default_accumulo_dashboard",
-  "display_name": "Standard Accumulo Dashboard",
-  "section_name": "ACCUMULO_SUMMARY",
-  "widgetLayoutInfo": [
-{
-  "widget_name": "Accumulo Entries",
-  "description": "Number of key/value pairs stored in Accumulo.",
-  "widget_type": "GRAPH",
-  "is_visible": true,
-  "metrics": [
-{
-  "name": "tserver.general.entries._sum",
-  "metric_path": "metrics/tserver/general/entries._sum",
-  "service_name": "ACCUMULO",
-  "component_name": "ACCUMULO_TSERVER"
-}
-  ],
-  "values": [
-{
-  "name": "Entries",
-  "value": "${tserver.general.entries._sum}"
-}
-  ],
-  "properties": {
-"graph_type": "LINE",
-"time_range": "1"
-  }
-},
-{
-  "widget_name": "Accumulo Queries",
-  "description": "Number of queries running against Accumulo.",
-  "widget_type": "GRAPH",
-  "is_visible": true,
-  "metrics": [
-{
-  "name": "tserver.general.queries._sum",
-  "metric_path": "metrics/tserver/general/queries._sum",
-  "service_name": "ACCUMULO",
-  "component_name": "ACCUMULO_TSERVER"
-}
-  ],
-  "values": [
-{
-  "name": "Queries",
-  "value": "${tserver.general.queries._sum}"
-}
-  ],
-  "properties": {
-"graph_type": "LINE",
-"time_range": "1"
-  }
-},
-{
-  "widget_name": "Accumulo MinCs",
-  "description": "Number of minor compactions running in Accumulo.",
-  "widget_type": "GRAPH",
-  "is_visible": true,
-  "metrics": [
-{
-  "name": "tserver.general.queuedMinCs._sum",
-  "metric_path": "metrics/tserver/general/queued_mincs._sum",
-  "service_name": "ACCUMULO",
-  "component_name": "ACCUMULO_TSERVER"
-},
-{
-  "name": "tserver.general.activeMinCs._sum",
-  "metric_path": "metrics/tserver/general/active_mincs._sum",
-  "service_name": "ACCUMULO",
-  "component_name": "ACCUMULO_TSERVER"
-}
-  ],
-  "values": [
-{
-  "name": "Queued MinCs",
-  "value": "${tserver.general.queuedMinCs._sum}"
-},
-{
-  "name": "Active MinCs",
-  "value": "${tserver.general.activeMinCs._sum}"
-}
-  ],
-  "properties": {
-"display_unit": "compactions",
-"graph_type": "LINE",
-"time_range": "1"
-  }
-},
-{
-  "widget_name": "Accumulo MajCs",
-  "description": "Number of major compactions running in Accumulo.",
-  "widget_type": "GRAPH",
-  "is_visible": true,
-  "metrics": [
-{
-  "name": "tserver.general.queuedMajCs._sum",
-  "metric_path": "metrics/tserver/general/queued_majcs._sum",
-  "service_name": "ACCUMULO",
-  "component_name": "ACCUMULO_TSERVER"
-},
-{
-   

ambari git commit: AMBARI-11604: [WinTP2]: Hive Enhanced Configs not loading on Windows (jluniya)

2015-06-02 Thread jluniya
Repository: ambari
Updated Branches:
  refs/heads/trunk 79437ef2b -> df12905a4


AMBARI-11604: [WinTP2]: Hive Enhanced Configs not loading on Windows (jluniya)


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

Branch: refs/heads/trunk
Commit: df12905a44300e2bf9107a0f408f54aeaba10eca
Parents: 79437ef
Author: Jayush Luniya 
Authored: Tue Jun 2 12:02:43 2015 -0700
Committer: Jayush Luniya 
Committed: Tue Jun 2 12:02:43 2015 -0700

--
 ambari-server/conf/windows/log4j.properties |   2 +-
 .../python/ambari_server/serverConfiguration.py |   2 +-
 .../services/HIVE/configuration/hive-site.xml   | 238 ---
 .../app/controllers/wizard/step7_controller.js  |   2 +-
 4 files changed, 3 insertions(+), 241 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/df12905a/ambari-server/conf/windows/log4j.properties
--
diff --git a/ambari-server/conf/windows/log4j.properties 
b/ambari-server/conf/windows/log4j.properties
index 4b5232f..607cdf9 100644
--- a/ambari-server/conf/windows/log4j.properties
+++ b/ambari-server/conf/windows/log4j.properties
@@ -18,7 +18,7 @@
 
 # Define some default values that can be overridden by system properties
 ambari.root.logger=INFO,DRFA
-ambari.log.dir=\\var\\log\\ambari-server-1.3.0-SNAPSHOT\\
+ambari.log.dir=\\var\\log\\ambari-server\\
 ambari.log.file=ambari-server.log
 ambari.config-changes.file=ambari-config-changes.log
 ambari.alerts.file=ambari-alerts.log

http://git-wip-us.apache.org/repos/asf/ambari/blob/df12905a/ambari-server/src/main/python/ambari_server/serverConfiguration.py
--
diff --git a/ambari-server/src/main/python/ambari_server/serverConfiguration.py 
b/ambari-server/src/main/python/ambari_server/serverConfiguration.py
index fec54e9..b12228a 100644
--- a/ambari-server/src/main/python/ambari_server/serverConfiguration.py
+++ b/ambari-server/src/main/python/ambari_server/serverConfiguration.py
@@ -369,7 +369,7 @@ def get_conf_dir():
 return conf_dir
   except KeyError:
 default_conf_dir = configDefaults.DEFAULT_CONF_DIR
-print AMBARI_CONF_VAR + " is not set, using default " + default_conf_dir
+print_info_msg(AMBARI_CONF_VAR + " is not set, using default " + 
default_conf_dir)
 return default_conf_dir
 
 def find_properties_file():

http://git-wip-us.apache.org/repos/asf/ambari/blob/df12905a/ambari-server/src/main/resources/stacks/HDPWIN/2.3/services/HIVE/configuration/hive-site.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDPWIN/2.3/services/HIVE/configuration/hive-site.xml
 
b/ambari-server/src/main/resources/stacks/HDPWIN/2.3/services/HIVE/configuration/hive-site.xml
deleted file mode 100644
index 1aaacb8..000
--- 
a/ambari-server/src/main/resources/stacks/HDPWIN/2.3/services/HIVE/configuration/hive-site.xml
+++ /dev/null
@@ -1,238 +0,0 @@
-
-
-
-
-
-
-  
-hive.cbo.enable
-true
-Flag to control enabling Cost Based Optimizations using 
Calcite framework.
-  
-
-  
-hive.exec.reducers.bytes.per.reducer
-67108864
-Defines the size per reducer. For example, if it is set to 
64M, given 256M input size, 4 reducers will be used.
-  
-
-  
-hive.exec.dynamic.partition.mode
-nonstrict
-
-  In strict mode, the user must specify at least one static partition
-  in case the user accidentally overwrites all partitions.
-  NonStrict allows all partitions of a table to be dynamic.
-
-  
-
-  
-hive.exec.orc.default.stripe.size
-67108864
-Define the default ORC stripe size
-  
-
-  
-hive.exec.orc.default.compress
-ZLIB
-Define the default compression codec for ORC 
file
-  
-
-  
-hive.tez.log.level
-INFO
-
-  The log level to use for tasks executing as part of the DAG.
-  Used only if hive.tez.java.opts is used to configure Java options.
-
-  
-  
-hive.enforce.bucketing
-true
-Whether bucketing is enforced. If true, while inserting into 
the table, bucketing is enforced.
-  
-
-  
-hive.optimize.sort.dynamic.partition
-false
-
-  When enabled dynamic partitioning column will be globally sorted.
-  This way we can keep only one record writer open for each partition value
-  in the reducer thereby reducing the memory pressure on reducers.
-
-  
-
-  
-hive.stats.fetch.partition.stats
-true
-
-  Annotation of operator tree with statistics information requires 
partition level basic
-  statistics like number of ro

ambari git commit: AMBARI-11548. DN Decommission does not work when default file system is not hdfs (smohanty)

2015-06-02 Thread smohanty
Repository: ambari
Updated Branches:
  refs/heads/trunk 8dcade74e -> 79437ef2b


AMBARI-11548. DN Decommission does not work when default file system is not 
hdfs (smohanty)


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

Branch: refs/heads/trunk
Commit: 79437ef2b9a6a85f5f7f5e9c0839e50c5cfe883c
Parents: 8dcade7
Author: Sumit Mohanty 
Authored: Tue Jun 2 11:54:05 2015 -0700
Committer: Sumit Mohanty 
Committed: Tue Jun 2 11:54:05 2015 -0700

--
 .../HDFS/2.1.0.2.0/package/scripts/hdfs_namenode.py  | 2 +-
 ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/79437ef2/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_namenode.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_namenode.py
 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_namenode.py
index 2ab3178..874cc6a 100644
--- 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_namenode.py
+++ 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_namenode.py
@@ -335,7 +335,7 @@ def decommission():
   # need to execute each command scoped to a particular namenode
   nn_refresh_cmd = format('dfsadmin -fs hdfs://{namenode_rpc} 
-refreshNodes')
 else:
-  nn_refresh_cmd = format('dfsadmin -refreshNodes')
+  nn_refresh_cmd = format('dfsadmin -fs {namenode_address} -refreshNodes')
 ExecuteHadoop(nn_refresh_cmd,
   user=hdfs_user,
   conf_dir=conf_dir,

http://git-wip-us.apache.org/repos/asf/ambari/blob/79437ef2/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
--
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py 
b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
index e9f7829..ddab048 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
@@ -780,7 +780,7 @@ class TestNamenode(RMFTestCase):
   group = 'hadoop',
   )
 self.assertResourceCalled('Execute', '', user = 'hdfs')
-self.assertResourceCalled('ExecuteHadoop', 'dfsadmin -refreshNodes',
+self.assertResourceCalled('ExecuteHadoop', 'dfsadmin -fs 
hdfs://c6401.ambari.apache.org:8020 -refreshNodes',
   user = 'hdfs',
   conf_dir = '/etc/hadoop/conf',
   bin_dir = '/usr/bin',
@@ -841,7 +841,7 @@ class TestNamenode(RMFTestCase):
 self.assertResourceCalled('Execute', '/usr/bin/kinit -kt 
/etc/security/keytabs/nn.service.keytab 
nn/c6401.ambari.apache@example.com;',
 user = 'hdfs',
 )
-self.assertResourceCalled('ExecuteHadoop', 'dfsadmin -refreshNodes',
+self.assertResourceCalled('ExecuteHadoop', 'dfsadmin -fs 
hdfs://c6401.ambari.apache.org:8020 -refreshNodes',
 bin_dir = '/usr/bin',
 conf_dir = '/etc/hadoop/conf',
 kinit_override = True,



ambari git commit: AMBARI-11627. Default Map memory should be less than default reduce memory (srimanth)

2015-06-02 Thread srimanth
Repository: ambari
Updated Branches:
  refs/heads/trunk b40d808d3 -> 8dcade74e


AMBARI-11627. Default Map memory should be less than default reduce memory 
(srimanth)


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

Branch: refs/heads/trunk
Commit: 8dcade74e2c669f0ec15e5562232fe12d51ca57e
Parents: b40d808
Author: Srimanth Gunturi 
Authored: Tue Jun 2 09:50:16 2015 -0700
Committer: Srimanth Gunturi 
Committed: Tue Jun 2 11:12:56 2015 -0700

--
 .../stacks/HDP/2.2/services/stack_advisor.py   |  6 --
 .../stacks/HDPWIN/2.2/services/stack_advisor.py| 17 +
 .../python/stacks/2.2/common/test_stack_advisor.py | 10 +-
 3 files changed, 22 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/8dcade74/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
index 1e31662..3ea3167 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
@@ -634,14 +634,16 @@ class HDP22StackAdvisor(HDP21StackAdvisor):
   nodemanagerMinRam = min(nodemanager["Hosts"]["total_mem"]/1024, 
nodemanagerMinRam)
 putMapredProperty('yarn.app.mapreduce.am.resource.mb', 
configurations["yarn-site"]["properties"]["yarn.scheduler.minimum-allocation-mb"])
 putMapredProperty('yarn.app.mapreduce.am.command-opts', "-Xmx" + 
str(int(0.8 * 
int(configurations["mapred-site"]["properties"]["yarn.app.mapreduce.am.resource.mb"])))
 + "m" + " -Dhdp.version=${hdp.version}")
-putMapredProperty('mapreduce.reduce.memory.mb', 
min(2*int(configurations["yarn-site"]["properties"]["yarn.scheduler.minimum-allocation-mb"]),
 int(nodemanagerMinRam)))
 servicesList = [service["StackServices"]["service_name"] for service in 
services["services"]]
 min_mapreduce_map_memory_mb = 0
+min_mapreduce_reduce_memory_mb = 0
 min_mapreduce_map_java_opts = 0
 if ("PIG" in servicesList):
-  min_mapreduce_map_memory_mb = 1500
+  min_mapreduce_map_memory_mb = 1536
+  min_mapreduce_reduce_memory_mb = 1536
   min_mapreduce_map_java_opts = 1024
 putMapredProperty('mapreduce.map.memory.mb', 
max(min_mapreduce_map_memory_mb, 
int(configurations["yarn-site"]["properties"]["yarn.scheduler.minimum-allocation-mb"])))
+putMapredProperty('mapreduce.reduce.memory.mb', 
max(min_mapreduce_reduce_memory_mb, 
min(2*int(configurations["yarn-site"]["properties"]["yarn.scheduler.minimum-allocation-mb"]),
 int(nodemanagerMinRam
 mapredMapXmx = 
int(0.8*int(configurations["mapred-site"]["properties"]["mapreduce.map.memory.mb"]));
 putMapredProperty('mapreduce.map.java.opts', "-Xmx" + 
str(max(min_mapreduce_map_java_opts, mapredMapXmx)) + "m")
 putMapredProperty('mapreduce.reduce.java.opts', "-Xmx" + 
str(int(0.8*int(configurations["mapred-site"]["properties"]["mapreduce.reduce.memory.mb"])))
 + "m")

http://git-wip-us.apache.org/repos/asf/ambari/blob/8dcade74/ambari-server/src/main/resources/stacks/HDPWIN/2.2/services/stack_advisor.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDPWIN/2.2/services/stack_advisor.py 
b/ambari-server/src/main/resources/stacks/HDPWIN/2.2/services/stack_advisor.py
index 3b7c948..058b618 100644
--- 
a/ambari-server/src/main/resources/stacks/HDPWIN/2.2/services/stack_advisor.py
+++ 
b/ambari-server/src/main/resources/stacks/HDPWIN/2.2/services/stack_advisor.py
@@ -230,11 +230,20 @@ class HDPWIN22StackAdvisor(HDPWIN21StackAdvisor):
 putMapredProperty = self.putProperty(configurations, "mapred-site", 
services)
 putMapredProperty('yarn.app.mapreduce.am.resource.mb', 
configurations["yarn-site"]["properties"]["yarn.scheduler.minimum-allocation-mb"])
 putMapredProperty('yarn.app.mapreduce.am.command-opts', "-Xmx" + 
str(int(0.8 * 
int(configurations["mapred-site"]["properties"]["yarn.app.mapreduce.am.resource.mb"])))
 + "m" + " -Dhdp.version=${hdp.version}")
-putMapredProperty('mapreduce.map.memory.mb', 
int(configurations["yarn-site"]["properties"]["yarn.scheduler.minimum-allocation-mb"]))
-putMapredProperty('mapreduce.reduce.memory.mb', 
int(2*int(configurations["yarn-site"]["properties"]["yarn.scheduler.minimum-allocation-mb"])))
-putMapredProperty('mapreduce.map.java.opts', "-Xmx" + 
str(int(0.8*int(configurations["mapred-site"]["p

ambari git commit: AMBARI-11624 - Datanode Shutdown Retries During Upgrade Are Too Long (jonathanhurley)

2015-06-02 Thread jonathanhurley
Repository: ambari
Updated Branches:
  refs/heads/trunk b6c115ba2 -> b40d808d3


AMBARI-11624 - Datanode Shutdown Retries During Upgrade Are Too Long 
(jonathanhurley)


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

Branch: refs/heads/trunk
Commit: b40d808d3a4ee9c7855532e555d89dd5910301f3
Parents: b6c115b
Author: Jonathan Hurley 
Authored: Tue Jun 2 10:29:53 2015 -0400
Committer: Jonathan Hurley 
Committed: Tue Jun 2 13:48:03 2015 -0400

--
 .../package/scripts/datanode_upgrade.py | 13 --
 .../python/stacks/2.0.6/HDFS/test_datanode.py   | 27 
 2 files changed, 38 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b40d808d/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/datanode_upgrade.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/datanode_upgrade.py
 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/datanode_upgrade.py
index 529ca4438..29af5bd 100644
--- 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/datanode_upgrade.py
+++ 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/datanode_upgrade.py
@@ -62,18 +62,27 @@ def post_upgrade_check():
   _check_datanode_startup()
 
 
-@retry(times=12, sleep_time=10, err_class=Fail)
+@retry(times=24, sleep_time=5, err_class=Fail)
 def _check_datanode_shutdown():
   """
   Checks that a DataNode is down by running "hdfs dfsamin getDatanodeInfo"
   several times, pausing in between runs. Once the DataNode stops responding
   this method will return, otherwise it will raise a Fail(...) and retry
   automatically.
+  The stack defaults for retrying for HDFS are also way too slow for this
+  command; they are set to wait about 45 seconds between client retries. As
+  a result, a single execution of dfsadmin will take 45 seconds to retry and
+  the DataNode may be marked as dead, causing problems with HBase.
+  https://issues.apache.org/jira/browse/HDFS-8510 tracks reducing the
+  times for ipc.client.connect.retry.interval. In the meantime, override them
+  here, but only for RU.
   :return:
   """
   import params
 
-  command = format('hdfs dfsadmin -getDatanodeInfo {dfs_dn_ipc_address}')
+  # override stock retry timeouts since after 30 seconds, the datanode is
+  # marked as dead and can affect HBase during RU
+  command = format('hdfs dfsadmin -D ipc.client.connect.max.retries=5 -D 
ipc.client.connect.retry.interval=1000 -getDatanodeInfo {dfs_dn_ipc_address}')
 
   try:
 Execute(command, user=params.hdfs_user, tries=1)

http://git-wip-us.apache.org/repos/asf/ambari/blob/b40d808d/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_datanode.py
--
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_datanode.py 
b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_datanode.py
index a310bf4..2440145 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_datanode.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_datanode.py
@@ -544,6 +544,33 @@ class TestDatanode(RMFTestCase):
   self.assertTrue(mocks_dict['call'].called)
   self.assertEqual(mocks_dict['call'].call_count,12)
 
+
+  @patch('time.sleep')
+  def test_stop_during_upgrade(self, time_mock):
+config_file = 
self.get_src_folder()+"/test/python/stacks/2.0.6/configs/default.json"
+with open(config_file, "r") as f:
+  json_content = json.load(f)
+
+version = '2.2.1.0-3242'
+json_content['commandParams']['version'] = version
+
+try:
+  self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/datanode.py",
+classname = "DataNode",
+command = "stop",
+config_dict = json_content,
+hdp_stack_version = self.STACK_VERSION,
+target = RMFTestCase.TARGET_COMMON_SERVICES,
+command_args=[True])
+
+  raise Fail("Expected a fail since datanode didn't report a shutdown")
+except:
+  pass
+
+self.assertResourceCalled('Execute', 'hdfs dfsadmin -shutdownDatanode 
0.0.0.0:8010 upgrade', user="hdfs", tries=1)
+self.assertResourceCalled('Execute', 'hdfs dfsadmin -D 
ipc.client.connect.max.retries=5 -D ipc.client.connect.retry.interval=1000 
-getDatanodeInfo 0.0.0.0:8010', user="hdfs", tries=1)
+
+
   
@patch("resource_management.libraries.functions.security_commons.build_expectations")
   
@patch("resource_management.libraries.functions.security_commons.

ambari git commit: AMBARI-11605. Restarting HistoryServer fails during RU because NameNode is in safemode (alejandro)

2015-06-02 Thread alejandro
Repository: ambari
Updated Branches:
  refs/heads/trunk 25191edf3 -> b6c115ba2


AMBARI-11605. Restarting HistoryServer fails during RU because NameNode is in 
safemode (alejandro)


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

Branch: refs/heads/trunk
Commit: b6c115ba2487d16101e253f034e91ae686edb755
Parents: 25191ed
Author: Alejandro Fernandez 
Authored: Sat May 30 14:27:18 2015 -0700
Committer: Alejandro Fernandez 
Committed: Tue Jun 2 10:18:06 2015 -0700

--
 .../2.1.0.2.0/package/scripts/hdfs_namenode.py  | 78 ++--
 .../HDFS/2.1.0.2.0/package/scripts/namenode.py  | 23 --
 .../HDFS/2.1.0.2.0/package/scripts/utils.py | 21 --
 .../python/stacks/2.0.6/HDFS/test_namenode.py   | 56 --
 4 files changed, 95 insertions(+), 83 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b6c115ba/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_namenode.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_namenode.py
 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_namenode.py
index d8666b3..2ab3178 100644
--- 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_namenode.py
+++ 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_namenode.py
@@ -18,12 +18,24 @@ limitations under the License.
 """
 import os.path
 
-from resource_management import *
-from resource_management.core.logger import Logger
-from resource_management.core.exceptions import ComponentIsNotRunning
+
+from resource_management.core import shell
+from resource_management.core.source import Template
+from resource_management.core.resources.system import File, Execute, Directory
+from resource_management.core.resources.service import Service
+from resource_management.libraries.functions.format import format
 from resource_management.libraries.functions.check_process_status import 
check_process_status
+from resource_management.libraries.resources.execute_hadoop import 
ExecuteHadoop
+from ambari_commons import OSCheck, OSConst
 from ambari_commons.os_family_impl import OsFamilyImpl, OsFamilyFuncImpl
-from ambari_commons import OSConst
+
+if OSCheck.is_windows_family():
+  from resource_management.libraries.functions.windows_service_utils import 
check_windows_service_status
+
+from resource_management.core.shell import as_user
+from resource_management.core.exceptions import Fail
+from resource_management.core.logger import Logger
+
 from utils import service, safe_zkfc_op
 from setup_ranger_hdfs import setup_ranger_hdfs
 
@@ -77,24 +89,40 @@ def namenode(action=None, do_format=True, 
rolling_restart=False, env=None):
   Execute(format("{kinit_path_local} -kt {hdfs_user_keytab} 
{hdfs_principal_name}"),
   user = params.hdfs_user)
 
+is_namenode_safe_mode_off = format("hadoop dfsadmin -fs {namenode_address} 
-safemode get | grep 'Safe mode is OFF'")
+is_active_namenode_cmd = as_user(format("hdfs --config {hadoop_conf_dir} 
haadmin -getServiceState {namenode_id} | grep active"), params.hdfs_user, 
env={'PATH':params.hadoop_bin_dir})
+
+# During normal operations, if HA is enabled and it is in standby, then 
stay in current state, otherwise, leave safemode.
+# During Rolling Upgrade, both namenodes must leave safemode.
+
+# ___Scenario_|_Expected safemode state___|_Wait for safemode 
OFF|
+# 1 (HA and active)   | ON -> OFF | Yes
  |
+# 2 (HA and standby)  | no change (yes during RU) | no check (yes during 
RU) |
+# 3 (no-HA)   | ON -> OFF | Yes
  |
+leave_safe_mode = False
+msg = ""
 if params.dfs_ha_enabled:
-  dfs_check_nn_status_cmd = as_user(format("hdfs --config 
{hadoop_conf_dir} haadmin -getServiceState {namenode_id} | grep active"), 
params.hdfs_user, env={'PATH':params.hadoop_bin_dir})
+  code, out = shell.call(is_active_namenode_cmd, logoutput=True) # If 
active NN, code will be 0
+  if code == 0: # active
+leave_safe_mode = True
+msg = "Must leave safemode since High Availability is enabled and this 
is the Active NameNode."
+  elif rolling_restart:
+leave_safe_mode = True
+msg = "Must leave safemode since High Availability is enabled during a 
Rolling Upgrade"
 else:
-  dfs_check_nn_status_cmd = None
+  msg = "Must leave safemode since High Availability is not enabled."
+  

ambari git commit: AMBARI-11530. Spark Stack Installer should remove dependency on Tez (Gautam Borad via alejandro)

2015-06-02 Thread alejandro
Repository: ambari
Updated Branches:
  refs/heads/trunk 82e2ac39e -> 25191edf3


AMBARI-11530. Spark Stack Installer should remove dependency on Tez (Gautam 
Borad via alejandro)


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

Branch: refs/heads/trunk
Commit: 25191edf385963a3392c8e1789598065d1b285a5
Parents: 82e2ac3
Author: Alejandro Fernandez 
Authored: Tue Jun 2 10:14:57 2015 -0700
Committer: Alejandro Fernandez 
Committed: Tue Jun 2 10:14:57 2015 -0700

--
 .../resources/common-services/SPARK/1.3.1.2.3/metainfo.xml| 7 ---
 1 file changed, 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/25191edf/ambari-server/src/main/resources/common-services/SPARK/1.3.1.2.3/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/SPARK/1.3.1.2.3/metainfo.xml 
b/ambari-server/src/main/resources/common-services/SPARK/1.3.1.2.3/metainfo.xml
index 7929bf6..cc3f7af 100644
--- 
a/ambari-server/src/main/resources/common-services/SPARK/1.3.1.2.3/metainfo.xml
+++ 
b/ambari-server/src/main/resources/common-services/SPARK/1.3.1.2.3/metainfo.xml
@@ -34,13 +34,6 @@
   true
   
 
-  TEZ/TEZ_CLIENT
-  host
-  
-true
-  
-
-
   HDFS/HDFS_CLIENT
   host
   



ambari git commit: AMBARI-11607: STORM service does not start (jluniya)

2015-06-02 Thread jluniya
Repository: ambari
Updated Branches:
  refs/heads/trunk 62898b3d4 -> 82e2ac39e


AMBARI-11607: STORM service does not start (jluniya)


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

Branch: refs/heads/trunk
Commit: 82e2ac39e5f3c1fe242ab2a637f122e0badd9d8b
Parents: 62898b3
Author: Jayush Luniya 
Authored: Tue Jun 2 09:41:21 2015 -0700
Committer: Jayush Luniya 
Committed: Tue Jun 2 09:41:21 2015 -0700

--
 .../FALCON/0.5.0.2.1/package/scripts/params_windows.py |  3 ++-
 .../KNOX/0.5.0.2.2/package/scripts/knox.py |  2 +-
 .../STORM/0.9.1.2.1/package/scripts/params_windows.py  | 13 +
 3 files changed, 16 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/82e2ac39/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/params_windows.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/params_windows.py
 
b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/params_windows.py
index a5e23f2..9136957 100644
--- 
a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/params_windows.py
+++ 
b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/params_windows.py
@@ -34,7 +34,8 @@ falcon_data_dir = "."
 falcon_home = None
 falcon_log_dir = "."
 
-hdp_root = os.path.abspath(os.path.join(os.environ["HADOOP_HOME"], ".."))
+if os.environ.has_key("HADOOP_HOME"):
+  hdp_root = os.path.abspath(os.path.join(os.environ["HADOOP_HOME"], ".."))
 
 if os.environ.has_key("FALCON_CONF_DIR"):
   falcon_conf_dir = os.environ["FALCON_CONF_DIR"]

http://git-wip-us.apache.org/repos/asf/ambari/blob/82e2ac39/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/knox.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/knox.py
 
b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/knox.py
index 302e49c..055b76e 100644
--- 
a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/knox.py
+++ 
b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/knox.py
@@ -18,7 +18,7 @@ limitations under the License.
 """
 
 import os
-
+from resource_management.libraries.script.script import Script
 from resource_management.libraries.resources.xml_config import XmlConfig
 from resource_management.core.resources.service import ServiceConfig
 from resource_management.libraries.functions.format import format

http://git-wip-us.apache.org/repos/asf/ambari/blob/82e2ac39/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_windows.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_windows.py
 
b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_windows.py
index 2c7f041..688b1d9 100644
--- 
a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_windows.py
+++ 
b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_windows.py
@@ -32,6 +32,19 @@ hadoop_user = 
config["configurations"]["cluster-env"]["hadoop.user.name"]
 storm_user = hadoop_user
 
 security_enabled = config['configurations']['cluster-env']['security_enabled']
+default_topology_max_replication_wait_time_sec = 
default('/configurations/storm-site/topology.max.replication.wait.time.sec.default',
 None)
+actual_topology_max_replication_wait_time_sec = 
default('/configurations/storm-site/topology.max.replication.wait.time.sec', 
None)
+nimbus_hosts = default("/clusterHostInfo/nimbus_hosts", [])
+actual_topology_min_replication_count = 
default('/configurations/storm-site/topology.min.replication.count', None)
+default_topology_min_replication_count = 
default('/configurations/storm-site/topology.min.replication.count.default', 
None)
+
+#Calculate topology.max.replication.wait.time.sec and 
topology.min.replication.count
+if len(nimbus_hosts) > 1:
+  actual_topology_max_replication_wait_time_sec = -1
+  actual_topology_min_replication_count = 2
+else:
+  actual_topology_max_replication_wait_time_sec = 
default_topology_max_replication_wait_time_sec
+  actual_topology_min_replication_count = 
default_topology_min_replication_count
 
 if stack_is_hdp23_or_further:
   if security_enabled:



ambari git commit: AMBARI-11615 Service Dashboard widget graphs do not show unit (not readily apparent what graphs represent). (atkach)

2015-06-02 Thread atkach
Repository: ambari
Updated Branches:
  refs/heads/trunk ed5558742 -> 62898b3d4


AMBARI-11615 Service Dashboard widget graphs do not show unit (not readily 
apparent what graphs represent). (atkach)


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

Branch: refs/heads/trunk
Commit: 62898b3d4a29024719ae0086420cdf226398bb89
Parents: ed55587
Author: Andrii Tkach 
Authored: Tue Jun 2 16:30:11 2015 +0300
Committer: Andrii Tkach 
Committed: Tue Jun 2 18:46:21 2015 +0300

--
 .../app/views/common/chart/linear_time.js   | 40 +++-
 .../views/common/widget/graph_widget_view.js|  9 +
 2 files changed, 31 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/62898b3d/ambari-web/app/views/common/chart/linear_time.js
--
diff --git a/ambari-web/app/views/common/chart/linear_time.js 
b/ambari-web/app/views/common/chart/linear_time.js
index 8487f82..dbffe4b 100644
--- a/ambari-web/app/views/common/chart/linear_time.js
+++ b/ambari-web/app/views/common/chart/linear_time.js
@@ -497,24 +497,14 @@ App.ChartLinearTimeView = Ember.View.extend({
   }
 }
 
-if (displayUnit) {
-  displayUnit = " " + (displayUnit.length > 3 ? 
displayUnit.substr(0, 3) + '...' : displayUnit);
-  series.name = string_utils.pad(series.name.length > 36 ? 
series.name.substr(0, 36) + '...' : series.name, 40, ' ', 2) + '| ' +
-  string_utils.pad('min', 5, ' ', 3) +
-  string_utils.pad(self.get('yAxisFormatter')(min) + displayUnit, 12, 
' ', 3) +
-  string_utils.pad('avg', 5, ' ', 3) +
-  
string_utils.pad(self.get('yAxisFormatter')(avg/series.data.compact().length) + 
displayUnit, 12, ' ', 3) +
-  string_utils.pad('max', 12, ' ', 3) +
-  string_utils.pad(self.get('yAxisFormatter')(max) + displayUnit, 5, 
' ', 3);
-} else {
-  series.name = string_utils.pad(series.name.length > 36 ? 
series.name.substr(0, 36) + '...' : series.name, 40, ' ', 2) + '| ' +
-  string_utils.pad('min', 5, ' ', 3) +
-  string_utils.pad(self.get('yAxisFormatter')(min), 12, ' ', 3) +
-  string_utils.pad('avg', 5, ' ', 3) +
-  
string_utils.pad(self.get('yAxisFormatter')(avg/series.data.compact().length), 
12, ' ', 3) +
-  string_utils.pad('max', 12, ' ', 3) +
-  string_utils.pad(self.get('yAxisFormatter')(max), 5, ' ', 3);
-}
+
+series.name = string_utils.pad(series.name.length > 36 ? 
series.name.substr(0, 36) + '...' : series.name, 40, ' ', 2) + '| ' +
+string_utils.pad('min', 5, ' ', 3) +
+string_utils.pad(self.get('yAxisFormatter')(min), 12, ' ', 3) +
+string_utils.pad('avg', 5, ' ', 3) +
+string_utils.pad(self.get('yAxisFormatter')(avg / 
series.data.compact().length), 12, ' ', 3) +
+string_utils.pad('max', 12, ' ', 3) +
+string_utils.pad(self.get('yAxisFormatter')(max), 5, ' ', 3);
   }
   if (series.data.length < series_min_length) {
 series_min_length = series.data.length;
@@ -885,6 +875,20 @@ App.ChartLinearTimeView.PercentageFormatter = function 
(percentage) {
 };
 
 /**
+ * A formatter which will turn a number into percentage display like '42%'
+ *
+ * @type {Function}
+ */
+App.ChartLinearTimeView.DisplayUnitFormatter = function (value, displayUnit) {
+  if (!value || value.length === 0) {
+value = '0 ' + displayUnit;
+  } else {
+value = value.toFixed(3).replace(/0+$/, '').replace(/\.$/, '') + " " + 
displayUnit;
+  }
+  return value;
+};
+
+/**
  * A formatter which will turn elapsed time into display time like '50 ms',
  * '5s', '10 m', '3 hr' etc. Time is expected to be provided in milliseconds.
  * 

http://git-wip-us.apache.org/repos/asf/ambari/blob/62898b3d/ambari-web/app/views/common/widget/graph_widget_view.js
--
diff --git a/ambari-web/app/views/common/widget/graph_widget_view.js 
b/ambari-web/app/views/common/widget/graph_widget_view.js
index 7b124ab..b5abc96 100644
--- a/ambari-web/app/views/common/widget/graph_widget_view.js
+++ b/ambari-web/app/views/common/widget/graph_widget_view.js
@@ -225,6 +225,14 @@ App.GraphWidgetView = Em.View.extend(App.WidgetMixin, {
 displayUnit: function () {
   return this.get('parentView.content.properties.display_unit');
 }.property('parentView.content.properties.display_unit'),
+setYAxisFormatter: function () {
+  var self = this;
+  if (this.get('displayUnit')) {
+this.set('yAxisFormatter',  function (value) {
+

[1/2] ambari git commit: AMBARI-11613. With multiple KMS instances, hadoop.security.key.provider.path and dfs.encryption.key.provider.uri are set to an incorrect value. (akovalenko)

2015-06-02 Thread akovalenko
Repository: ambari
Updated Branches:
  refs/heads/trunk dfe0dfebe -> 19f18f577


AMBARI-11613. With multiple KMS instances, hadoop.security.key.provider.path 
and dfs.encryption.key.provider.uri are set to an incorrect value. (akovalenko)


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

Branch: refs/heads/trunk
Commit: 1208fc5385296d89ca4513948ce06147e1f5476f
Parents: dfe0dfe
Author: Aleksandr Kovalenko 
Authored: Tue Jun 2 15:29:38 2015 +0300
Committer: Aleksandr Kovalenko 
Committed: Tue Jun 2 18:10:16 2015 +0300

--
 ambari-web/app/controllers/main/host/details.js |  7 +-
 .../test/controllers/main/host/details_test.js  | 76 
 2 files changed, 78 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/1208fc53/ambari-web/app/controllers/main/host/details.js
--
diff --git a/ambari-web/app/controllers/main/host/details.js 
b/ambari-web/app/controllers/main/host/details.js
index 8ebb6d6..144465b 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -916,11 +916,8 @@ App.MainHostDetailsController = Em.Controller.extend({
   }
 ];
 
-for (var i = 0; i < rkmsHosts.length; i++) {
-  rkmsHosts[i] = rkmsHosts[i] + ':' + rkmsPort;
-}
-coreSiteConfigs.properties['hadoop.security.key.provider.path'] = 
'kms://http@' + rkmsHosts.join(',') + '/kms';
-hdfsSiteConfigs.properties['dfs.encryption.key.provider.uri'] = 
'kms://http@' + rkmsHosts.join(',') + '/kms';
+coreSiteConfigs.properties['hadoop.security.key.provider.path'] = 
'kms://http@' + rkmsHosts.join(';') + ':' + rkmsPort + '/kms';
+hdfsSiteConfigs.properties['dfs.encryption.key.provider.uri'] = 
'kms://http@' + rkmsHosts.join(';') + ':' + rkmsPort + '/kms';
 this.saveConfigsBatch(groups, 'RANGER_KMS_SERVER', hostToInstall);
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/1208fc53/ambari-web/test/controllers/main/host/details_test.js
--
diff --git a/ambari-web/test/controllers/main/host/details_test.js 
b/ambari-web/test/controllers/main/host/details_test.js
index 15f7231..4023a0e 100644
--- a/ambari-web/test/controllers/main/host/details_test.js
+++ b/ambari-web/test/controllers/main/host/details_test.js
@@ -2564,4 +2564,80 @@ describe('App.MainHostDetailsController', function () {
 });
 
   });
+
+  describe('#onLoadRangerConfigs()', function () {
+
+var cases = [
+  {
+'kmsHosts': ['host1'],
+'kmsPort': 'port',
+'title': 'single host',
+'hostToInstall': undefined,
+'result': [
+  {
+properties: {
+  'core-site': {'hadoop.security.key.provider.path': 
'kms://http@host1:port/kms'},
+  'hdfs-site': {'dfs.encryption.key.provider.uri': 
'kms://http@host1:port/kms'}
+},
+properties_attributes: {
+  'core-site': undefined,
+  'hdfs-site': undefined
+}
+  }
+]
+  },
+  {
+'kmsHosts': ['host1', 'host2'],
+'kmsPort': 'port',
+'title': 'two hosts',
+'hostToInstall': 'host2',
+'result': [
+  {
+properties: {
+  'core-site': {'hadoop.security.key.provider.path': 
'kms://http@host1;host2:port/kms'},
+  'hdfs-site': {'dfs.encryption.key.provider.uri': 
'kms://http@host1;host2:port/kms'}
+},
+properties_attributes: {
+  'core-site': undefined,
+  'hdfs-site': undefined
+}
+  }
+]
+  }
+];
+
+beforeEach(function () {
+  sinon.spy(controller, 'saveConfigsBatch')
+});
+
+afterEach(function () {
+  controller.saveConfigsBatch.restore();
+});
+
+cases.forEach(function (item) {
+  it(item.title, function () {
+controller.set('rangerKMSServerHost', item.hostToInstall);
+sinon.stub(controller, 
'getRangerKMSServerHosts').returns(item.kmsHosts);
+var data = {
+  items: [
+{
+  type: 'kms-env',
+  properties: {'kms_port': item.kmsPort}
+},
+{
+  type: 'core-site',
+  properties: {}
+},
+{
+  type: 'hdfs-site',
+  properties: {}
+}
+  ]
+};
+controller.onLoadRangerConfigs(data);
+expect(controller.saveConfigsBatch.calledWith(item.result, 
'RANGER_KMS_SERVER', item.ho

ambari git commit: AMBARI-11590. Kerberos: provide option to set test account name (rlevas)

2015-06-02 Thread rlevas
Repository: ambari
Updated Branches:
  refs/heads/trunk 19f18f577 -> ed5558742


AMBARI-11590. Kerberos: provide option to set test account name (rlevas)


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

Branch: refs/heads/trunk
Commit: ed5558742e4b8b88e495e0190ec1cbe04683ffe1
Parents: 19f18f5
Author: Robert Levas 
Authored: Tue Jun 2 11:15:33 2015 -0400
Committer: Robert Levas 
Committed: Tue Jun 2 11:15:42 2015 -0400

--
 .../server/controller/AmbariManagementControllerImpl.java   | 8 
 .../apache/ambari/server/controller/KerberosHelperImpl.java | 9 +++--
 .../KERBEROS/1.10.3-10/configuration/kerberos-env.xml   | 8 
 .../services/KERBEROS/configuration/kerberos-env.xml| 7 +++
 .../apache/ambari/server/controller/KerberosHelperTest.java | 7 +--
 5 files changed, 27 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ed555874/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 d327d96..af62dd4 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
@@ -3235,14 +3235,6 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
 List stages = rg.getStages();
 
 if (stages != null && !stages.isEmpty()) {
-  // If this is a Kerberos service check, set the service check stage(s) 
to be skip-able so that
-  // the clean up stages will still be triggered in the event of a failure.
-  if (kerberosServiceCheck) {
-for (Stage s : stages) {
-  s.setSkippable(true);
-}
-  }
-
   requestStageContainer.addStages(stages);
 }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed555874/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
index dc5fc75..70d08ba 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
@@ -103,9 +103,11 @@ import org.slf4j.LoggerFactory;
 
 import java.io.File;
 import java.io.IOException;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -1200,14 +1202,14 @@ public class KerberosHelperImpl implements 
KerberosHelper {
   put("principal",
   new HashMap() {
 {
-  put("value", 
"${cluster-env/smokeuser}_${service_check_id}@${realm}");
+  put("value", 
"${kerberos-env/service_check_principal_name}@${realm}");
   put("type", "user");
 }
   });
   put("keytab",
   new HashMap() {
 {
-  put("file", 
"${keytab_dir}/kerberos.service_check.${service_check_id}.keytab");
+  put("file", 
"${keytab_dir}/kerberos.service_check.${short_date}.keytab");
 
   put("owner", new HashMap() {{
 put("name", "${cluster-env/smokeuser}");
@@ -1246,6 +1248,9 @@ public class KerberosHelperImpl implements KerberosHelper 
{
 // Set the unique service check identifier
 configurations.get("").put("service_check_id", serviceCheckId);
 
+// Add a short date value
+configurations.get("").put("short_date", new 
SimpleDateFormat("MMddyy").format(new Date()));
+
 // Iterate over the components installed on the current host 
to get the service and
 // component-level Kerberos descriptors in order to determine 
which principals,
 // keytab files, and configurations need to be created or 
updated.

http://git-wip-us.apache.org/repos/asf/amb

[2/2] ambari git commit: AMBARI-11616. Wrong cursor over activated final button on configs page (akovalenko)

2015-06-02 Thread akovalenko
AMBARI-11616. Wrong cursor over activated final button on configs page 
(akovalenko)


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

Branch: refs/heads/trunk
Commit: 19f18f5772ce42c10307405df92d82151c6601b6
Parents: 1208fc5
Author: Aleksandr Kovalenko 
Authored: Tue Jun 2 16:49:17 2015 +0300
Committer: Aleksandr Kovalenko 
Committed: Tue Jun 2 18:10:17 2015 +0300

--
 ambari-web/app/styles/application.less | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/19f18f57/ambari-web/app/styles/application.less
--
diff --git a/ambari-web/app/styles/application.less 
b/ambari-web/app/styles/application.less
index 347553e..3cfbddf 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -1215,12 +1215,12 @@ h1 {
 }
 .btn-final .icon-lock{
   color: #a6a6a6;
+  cursor: inherit;
 }
 .btn-final.active .icon-lock {
   color: blue;
 }
-.btn-final.active,
-.btn-final.active[disabled] { //copied from Bootstrap .btn.active
+.btn-final.active { //copied from Bootstrap .btn.active
   background-color: #e6e6e6;
   background-color: #d9d9d9 \9;
   background-image: none;
@@ -1228,6 +1228,8 @@ h1 {
   -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px 
rgba(0, 0, 0, 0.05);
   -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 
0, 0, 0.05);
   box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 
0.05);
+}
+.btn-final.active[disabled] {
   cursor: not-allowed;
 }
 a.accordion-toggle:hover {



ambari git commit: AMBARI-11625. Ambari upgrade hangs.(vbrodetskyi)

2015-06-02 Thread vbrodetskyi
Repository: ambari
Updated Branches:
  refs/heads/trunk 7f3945548 -> dfe0dfebe


AMBARI-11625. Ambari upgrade hangs.(vbrodetskyi)


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

Branch: refs/heads/trunk
Commit: dfe0dfebe4b90efc0eca2ed66da654a2e890c3df
Parents: 7f39455
Author: Vitaly Brodetskyi 
Authored: Tue Jun 2 13:12:19 2015 +0300
Committer: Vitaly Brodetskyi 
Committed: Tue Jun 2 13:12:44 2015 +0300

--
 .../server/upgrade/UpgradeCatalog210.java   | 37 +---
 1 file changed, 25 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/dfe0dfeb/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
index a79d7f3..e331475 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
@@ -44,6 +44,8 @@ import 
org.eclipse.persistence.internal.databaseaccess.FieldTypeDefinition;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.text.MessageFormat;
@@ -910,9 +912,9 @@ public class UpgradeCatalog210 extends 
AbstractUpgradeCatalog {
   if (clusterMap != null && !clusterMap.isEmpty()) {
 for (final Cluster cluster : clusterMap.values()) {
 
-  for (String metricName : metricAlerts) {
+  for (String alertName : metricAlerts) {
 AlertDefinitionEntity alertDefinitionEntity =  
alertDefinitionDAO.findByName(cluster.getClusterId(),
-metricName);
+alertName);
 if (alertDefinitionEntity != null) {
   String source = alertDefinitionEntity.getSource();
   JsonObject rootJson = new 
JsonParser().parse(source).getAsJsonObject();
@@ -920,14 +922,13 @@ public class UpgradeCatalog210 extends 
AbstractUpgradeCatalog {
 "{{hdfs-site/dfs.web.authentication.kerberos.keytab}}");
   
rootJson.get("uri").getAsJsonObject().addProperty("kerberos_principal",
 "{{hdfs-site/dfs.web.authentication.kerberos.principal}}");
-  alertDefinitionEntity.setSource(rootJson.toString());
-  alertDefinitionDAO.merge(alertDefinitionEntity);
+  updateAlertDefinitionEntitySource(alertName, 
rootJson.toString());
 }
   }
 
-  for (String metricName : mapredAlerts) {
+  for (String alertName : mapredAlerts) {
 AlertDefinitionEntity alertDefinitionEntity =  
alertDefinitionDAO.findByName(cluster.getClusterId(),
-metricName);
+alertName);
 if (alertDefinitionEntity != null) {
   String source = alertDefinitionEntity.getSource();
   JsonObject rootJson = new 
JsonParser().parse(source).getAsJsonObject();
@@ -935,14 +936,13 @@ public class UpgradeCatalog210 extends 
AbstractUpgradeCatalog {
 
"{{mapred-site/mapreduce.jobhistory.webapp.spnego-keytab-file}}");
   
rootJson.get("uri").getAsJsonObject().addProperty("kerberos_principal",
 
"{{mapred-site/mapreduce.jobhistory.webapp.spnego-principal}}");
-  alertDefinitionEntity.setSource(rootJson.toString());
-  alertDefinitionDAO.merge(alertDefinitionEntity);
+  updateAlertDefinitionEntitySource(alertName, 
rootJson.toString());
 }
   }
 
-  for (String metricName : rmAlerts) {
+  for (String alertName : rmAlerts) {
 AlertDefinitionEntity alertDefinitionEntity =  
alertDefinitionDAO.findByName(cluster.getClusterId(),
-metricName);
+alertName);
 if (alertDefinitionEntity != null) {
   String source = alertDefinitionEntity.getSource();
   JsonObject rootJson = new 
JsonParser().parse(source).getAsJsonObject();
@@ -950,8 +950,7 @@ public class UpgradeCatalog210 extends 
AbstractUpgradeCatalog {
 
"{{yarn-site/yarn.resourcemanager.webapp.spnego-keytab-file}}");
   
rootJson.get("uri").getAsJsonObject().addProperty("kerberos_principal",
 
"{{yarn-site/yarn.resourcemanager.webapp.spne

ambari git commit: AMBARI-11611. Delete incorrect Storm-HA configs. Fix unit tests (dlysnichenko)

2015-06-02 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 9e75a7370 -> 7f3945548


AMBARI-11611. Delete incorrect Storm-HA configs. Fix unit tests (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 7f3945548e419099a17a72d86a4ff6a236f5519d
Parents: 9e75a73
Author: Lisnichenko Dmitro 
Authored: Tue Jun 2 17:51:23 2015 +0300
Committer: Lisnichenko Dmitro 
Committed: Tue Jun 2 17:58:16 2015 +0300

--
 .../STORM/0.9.1.2.1/package/scripts/params_linux.py   | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7f394554/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_linux.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_linux.py
 
b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_linux.py
index 6c3078b..4e49e2f 100644
--- 
a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_linux.py
+++ 
b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_linux.py
@@ -104,8 +104,11 @@ else:
   actual_topology_max_replication_wait_time_sec = 
default_topology_max_replication_wait_time_sec
   actual_topology_min_replication_count = 
default_topology_min_replication_count 
   
-del 
config['configurations']['storm-site']['topology.max.replication.wait.time.sec.default']
-del 
config['configurations']['storm-site']['topology.min.replication.count.default']
+if default_topology_max_replication_wait_time_sec:
+  del 
config['configurations']['storm-site']['topology.max.replication.wait.time.sec.default']
+if default_topology_min_replication_count:  
+  del 
config['configurations']['storm-site']['topology.min.replication.count.default']
+
 rest_api_port = "8745"
 rest_api_admin_port = "8746"
 rest_api_conf_file = format("{conf_dir}/config.yaml")



[2/3] ambari git commit: AMBARI-11623. UI typo (alexantonenko)

2015-06-02 Thread alexantonenko
AMBARI-11623. UI typo (alexantonenko)


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

Branch: refs/heads/trunk
Commit: abb7028956c328a98cdeccb6f2a7e63b0f45f55e
Parents: 9614eb6
Author: Alex Antonenko 
Authored: Tue Jun 2 17:36:59 2015 +0300
Committer: Alex Antonenko 
Committed: Tue Jun 2 17:50:51 2015 +0300

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


http://git-wip-us.apache.org/repos/asf/ambari/blob/abb70289/ambari-web/app/messages.js
--
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 37717b1..ee2117d 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -269,8 +269,8 @@ Em.I18n.translations = {
   'common.removed': 'Removed',
   'common.testing': 'Testing',
 
-  'models.alert_instance.tiggered.verbose': "Occured on {0}  Checked on 
{1}",
-  'models.alert_definition.triggered.verbose': "Occured on {0}",
+  'models.alert_instance.tiggered.verbose': "Occurred on {0}  Checked on 
{1}",
+  'models.alert_definition.triggered.verbose': "Occurred on {0}",
   'models.alert_definition.triggered.checked': "Status Changed: {0}\nLast 
Checked: {1}",
 
   'passiveState.turnOn':'Turn On Maintenance Mode',



[3/3] ambari git commit: AMBARI-11622. Ambari UI: adjust Metrics area on Service pages (alexantonenko)

2015-06-02 Thread alexantonenko
AMBARI-11622. Ambari UI: adjust Metrics area on Service pages (alexantonenko)


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

Branch: refs/heads/trunk
Commit: 9614eb6a2344be89beffeba5cd1230d8f3f76ee2
Parents: 9fa9c75
Author: Alex Antonenko 
Authored: Tue Jun 2 17:35:34 2015 +0300
Committer: Alex Antonenko 
Committed: Tue Jun 2 17:50:51 2015 +0300

--
 ambari-web/app/assets/test/tests.js |  1 +
 ambari-web/app/messages.js  |  4 +-
 .../app/mixins/common/widgets/widget_section.js |  3 +
 ambari-web/app/styles/application.less  |  3 +
 .../app/templates/main/charts/linear_time.hbs   |  2 +-
 .../app/templates/main/service/info/summary.hbs | 68 +++-
 .../app/views/common/chart/linear_time.js   | 23 +--
 .../views/common/widget/graph_widget_view.js|  5 +-
 ambari-web/app/views/main/dashboard/widget.js   |  5 +-
 .../common/widgets/widget_section_test.js   | 63 ++
 10 files changed, 137 insertions(+), 40 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9614eb6a/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 177d871..1be092c 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -136,6 +136,7 @@ var files = ['test/init_model_test',
   'test/mixins/common/configs/enhanced_configs_test',
   'test/mixins/common/configs/configs_saver_test',
   'test/mixins/common/chart/storm_linear_time_test',
+  'test/mixins/common/widgets/widget_section_test',
   'test/mixins/common/localStorage_test',
   'test/mixins/common/reload_popup_test',
   'test/mixins/common/serverValidator_test',

http://git-wip-us.apache.org/repos/asf/ambari/blob/9614eb6a/ambari-web/app/messages.js
--
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 2b97242..37717b1 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -383,7 +383,8 @@ Em.I18n.translations = {
   'titlebar.alerts.noAlerts': 'No Alerts',
 
   'graphs.noData.title': 'No Data',
-  'graphs.noData.message': 'There was no data available. Possible reasons 
include inaccessible/unsupported metrics service.',
+  'graphs.noData.message': 'No Data Available',
+  'graphs.noData.tooltip.title': 'No Data Available. The Ambari Metrics 
service may be not installed or inaccessible',
   'graphs.noDataAtTime.message': 'No available data for the time period.',
   'graphs.error.title': 'Error',
   'graphs.error.message': 'There was a problem getting data for the chart 
({0}: {1})',
@@ -395,6 +396,7 @@ Em.I18n.translations = {
   'graphs.timeRange.week': 'Last 1 week',
   'graphs.timeRange.month': 'Last 1 month',
   'graphs.timeRange.year': 'Last 1 year',
+  'graphs.tooltip.title': 'Click to zoom',
 
   'users.userName.validationFail': 'Only lowercase letters and numbers are 
recommended; must start with a letter',
   'host.spacesValidation': 'Cannot contain whitespace',

http://git-wip-us.apache.org/repos/asf/ambari/blob/9614eb6a/ambari-web/app/mixins/common/widgets/widget_section.js
--
diff --git a/ambari-web/app/mixins/common/widgets/widget_section.js 
b/ambari-web/app/mixins/common/widgets/widget_section.js
index 2a22854..e486d66 100644
--- a/ambari-web/app/mixins/common/widgets/widget_section.js
+++ b/ambari-web/app/mixins/common/widgets/widget_section.js
@@ -96,6 +96,9 @@ App.WidgetSectionMixin = Ember.Mixin.create({
 return [];
   }.property('isWidgetsLoaded', 'activeWidgetLayout.widgets'),
 
+  isAmbariMetricsInstalled: function () {
+return App.Service.find().someProperty('serviceName', 'AMBARI_METRICS');
+  }.property('App.router.mainServiceController.content.length'),
 
   /**
* load widgets defined by user

http://git-wip-us.apache.org/repos/asf/ambari/blob/9614eb6a/ambari-web/app/styles/application.less
--
diff --git a/ambari-web/app/styles/application.less 
b/ambari-web/app/styles/application.less
index 4de2aae..347553e 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -547,6 +547,9 @@ h1 {
   max-width: 400px;
   overflow-wrap: break-word;
   white-space:pre-wrap;
+  &.graph-tooltip {
+max-width: 200px;
+  }
 }
 
 .popover {

http://git-wip-us.apache.org/repos/asf/ambari/blob/9614eb6a/ambari-web/app/templates/main/charts/linear_time.hbs
---

[1/3] ambari git commit: AMBARI-11626. Views: display name not update on views top menu (alexantonenko)

2015-06-02 Thread alexantonenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 9fa9c756e -> 9e75a7370


AMBARI-11626. Views: display name not update on views top menu (alexantonenko)


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

Branch: refs/heads/trunk
Commit: 9e75a73704d2965bea3de033fe4dcb230dcad895
Parents: abb7028
Author: Alex Antonenko 
Authored: Tue Jun 2 17:43:57 2015 +0300
Committer: Alex Antonenko 
Committed: Tue Jun 2 17:50:51 2015 +0300

--
 .../controllers/ambariViews/CreateViewInstanceCtrl.js |  3 ++-
 .../scripts/controllers/ambariViews/ViewsEditCtrl.js  |  2 ++
 .../ui/admin-web/app/scripts/controllers/mainCtrl.js  | 14 +++---
 3 files changed, 15 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9e75a737/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/CreateViewInstanceCtrl.js
--
diff --git 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/CreateViewInstanceCtrl.js
 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/CreateViewInstanceCtrl.js
index ddda59e..02b7aa9 100644
--- 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/CreateViewInstanceCtrl.js
+++ 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/CreateViewInstanceCtrl.js
@@ -135,6 +135,7 @@ angular.module('ambariAdminConsole')
 $location.path('/views/' + $scope.instance.view_name + 
'/versions/' + $scope.instance.version + '/instances/' + 
$scope.instance.instance_name + '/edit');
   }
 $scope.form.instanceCreateForm.isSaving = false;
+$scope.$root.$emit('instancesUpdate');
 })
 .catch(function (data) {
   var errorMessage = data.message;
@@ -154,7 +155,7 @@ angular.module('ambariAdminConsole')
   });
 
   if (showGeneralError) {
-$scope.form.instanceCreateForm.generalValidationError = 
errorMessage;  
+$scope.form.instanceCreateForm.generalValidationError = 
errorMessage;
   }
 } catch (e) {
   console.error('Unable to parse error message:', data.message);

http://git-wip-us.apache.org/repos/asf/ambari/blob/9e75a737/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsEditCtrl.js
--
diff --git 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsEditCtrl.js
 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsEditCtrl.js
index e7f80ee..2404dc0 100644
--- 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsEditCtrl.js
+++ 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsEditCtrl.js
@@ -196,6 +196,7 @@ angular.module('ambariAdminConsole')
 $scope.cluster = $scope.clusters[0];
   });
 
+
   $scope.saveSettings = function(callback) {
 if( $scope.settingsForm.$valid ){
   var data = {
@@ -241,6 +242,7 @@ angular.module('ambariAdminConsole')
   };
   return View.updateInstance($routeParams.viewId, $routeParams.version, 
$routeParams.instanceId, data)
   .success(function() {
+$scope.$root.$emit('instancesUpdate');
 if( callback ){
   callback();
 } else {

http://git-wip-us.apache.org/repos/asf/ambari/blob/9e75a737/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/mainCtrl.js
--
diff --git 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/mainCtrl.js
 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/mainCtrl.js
index b740a6a..e2b3a50 100644
--- 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/mainCtrl.js
+++ 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/mainCtrl.js
@@ -71,12 +71,20 @@ angular.module('ambariAdminConsole')
   loadAmbariVersion();
 
   $scope.viewInstances = [];
-  View.getAllVisibleInstance().then(function(instances) {
-$scope.viewInstances = instances;
-  });
+
+  $scope.updateInstances = function () {
+View.getAllVisibleInstance().then(function(instances) {
+  $scope.viewInstances = instances;
+});
+  };
 
   $scope.gotoViewsDashboard =function() {
 window.location = '/#/main/views';
   };
 
+  $scope.$root.$on('instancesUpdate', function (event, data) {
+$scope.

ambari git commit: AMBARI-11621. Upgrade failed from 2.0 to 2.1 with build # 1890.(vbrodetskyi)

2015-06-02 Thread vbrodetskyi
Repository: ambari
Updated Branches:
  refs/heads/trunk e30a1c829 -> 9fa9c756e


AMBARI-11621. Upgrade failed from 2.0 to 2.1 with build # 1890.(vbrodetskyi)


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

Branch: refs/heads/trunk
Commit: 9fa9c756e8994ad374a897dbd6c6167aef94a492
Parents: e30a1c8
Author: Vitaly Brodetskyi 
Authored: Tue Jun 2 13:01:18 2015 +0300
Committer: Vitaly Brodetskyi 
Committed: Tue Jun 2 13:01:18 2015 +0300

--
 .../server/upgrade/UpgradeCatalog210.java   | 42 +++-
 1 file changed, 24 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9fa9c756/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
index abbee4e..a79d7f3 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
@@ -913,40 +913,46 @@ public class UpgradeCatalog210 extends 
AbstractUpgradeCatalog {
   for (String metricName : metricAlerts) {
 AlertDefinitionEntity alertDefinitionEntity =  
alertDefinitionDAO.findByName(cluster.getClusterId(),
 metricName);
-String source = alertDefinitionEntity.getSource();
-JsonObject rootJson = new 
JsonParser().parse(source).getAsJsonObject();
-
rootJson.get("uri").getAsJsonObject().addProperty("kerberos_keytab",
+if (alertDefinitionEntity != null) {
+  String source = alertDefinitionEntity.getSource();
+  JsonObject rootJson = new 
JsonParser().parse(source).getAsJsonObject();
+  
rootJson.get("uri").getAsJsonObject().addProperty("kerberos_keytab",
 "{{hdfs-site/dfs.web.authentication.kerberos.keytab}}");
-
rootJson.get("uri").getAsJsonObject().addProperty("kerberos_principal",
+  
rootJson.get("uri").getAsJsonObject().addProperty("kerberos_principal",
 "{{hdfs-site/dfs.web.authentication.kerberos.principal}}");
-alertDefinitionEntity.setSource(rootJson.toString());
-alertDefinitionDAO.merge(alertDefinitionEntity);
+  alertDefinitionEntity.setSource(rootJson.toString());
+  alertDefinitionDAO.merge(alertDefinitionEntity);
+}
   }
 
   for (String metricName : mapredAlerts) {
 AlertDefinitionEntity alertDefinitionEntity =  
alertDefinitionDAO.findByName(cluster.getClusterId(),
 metricName);
-String source = alertDefinitionEntity.getSource();
-JsonObject rootJson = new 
JsonParser().parse(source).getAsJsonObject();
-
rootJson.get("uri").getAsJsonObject().addProperty("kerberos_keytab",
+if (alertDefinitionEntity != null) {
+  String source = alertDefinitionEntity.getSource();
+  JsonObject rootJson = new 
JsonParser().parse(source).getAsJsonObject();
+  
rootJson.get("uri").getAsJsonObject().addProperty("kerberos_keytab",
 
"{{mapred-site/mapreduce.jobhistory.webapp.spnego-keytab-file}}");
-
rootJson.get("uri").getAsJsonObject().addProperty("kerberos_principal",
+  
rootJson.get("uri").getAsJsonObject().addProperty("kerberos_principal",
 
"{{mapred-site/mapreduce.jobhistory.webapp.spnego-principal}}");
-alertDefinitionEntity.setSource(rootJson.toString());
-alertDefinitionDAO.merge(alertDefinitionEntity);
+  alertDefinitionEntity.setSource(rootJson.toString());
+  alertDefinitionDAO.merge(alertDefinitionEntity);
+}
   }
 
   for (String metricName : rmAlerts) {
 AlertDefinitionEntity alertDefinitionEntity =  
alertDefinitionDAO.findByName(cluster.getClusterId(),
 metricName);
-String source = alertDefinitionEntity.getSource();
-JsonObject rootJson = new 
JsonParser().parse(source).getAsJsonObject();
-
rootJson.get("uri").getAsJsonObject().addProperty("kerberos_keytab",
+if (alertDefinitionEntity != null) {
+  String source = alertDefinitionEntity.getSource();
+  JsonObject rootJson = new 
JsonParser().parse(source).getAsJsonObject();
+  
rootJson.get(

ambari git commit: AMBARI-11579. Add installation of atlas hive hook (Jon Maron via smohanty)

2015-06-02 Thread smohanty
Repository: ambari
Updated Branches:
  refs/heads/trunk eb2cae7bc -> e30a1c829


AMBARI-11579. Add installation of atlas hive hook (Jon Maron via smohanty)


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

Branch: refs/heads/trunk
Commit: e30a1c82908349b2621a1600e6d4c1e03e88a5ec
Parents: eb2cae7
Author: Sumit Mohanty 
Authored: Tue Jun 2 07:27:52 2015 -0700
Committer: Sumit Mohanty 
Committed: Tue Jun 2 07:27:52 2015 -0700

--
 .../package/scripts/atlas_plugin_utils.py   | 39 
 .../0.12.0.2.0/package/scripts/hcat_client.py   |  3 ++
 .../HIVE/0.12.0.2.0/package/scripts/hive.py | 12 +-
 .../0.12.0.2.0/package/scripts/hive_client.py   |  4 +-
 .../package/scripts/hive_metastore.py   |  4 ++
 .../0.12.0.2.0/package/scripts/hive_server.py   |  4 ++
 .../0.12.0.2.0/package/scripts/params_linux.py  | 37 +++
 .../package/scripts/webhcat_server.py   |  4 ++
 .../stacks/HDP/2.3/services/HIVE/metainfo.xml   |  3 ++
 .../stacks/2.0.6/HIVE/test_hive_server.py   |  2 +
 10 files changed, 109 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e30a1c82/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/atlas_plugin_utils.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/atlas_plugin_utils.py
 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/atlas_plugin_utils.py
new file mode 100644
index 000..d057c27
--- /dev/null
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/atlas_plugin_utils.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+"""
+from resource_management import Script
+from resource_management.core import logger
+
+
+def configure_for_plugin(command_data_file):
+import json
+savedConfig = Script.get_config()
+if savedConfig['hostLevelParams'].get('custom_command', '') == 'RESTART':
+try:
+with open(command_data_file) as f:
+pass
+Script.config = json.load(f)
+Script.config['hostLevelParams']['package_list'] = \
+"[{\"name\":\"atlas-metadata*-hive-plugin\"}]"
+
+except IOError:
+logger.exception("Can not read json file with command parameters: 
")
+
+return savedConfig
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/e30a1c82/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hcat_client.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hcat_client.py
 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hcat_client.py
index 79096e4..46ed31b 100644
--- 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hcat_client.py
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hcat_client.py
@@ -23,12 +23,15 @@ from resource_management import *
 from hcat import hcat
 from ambari_commons import OSConst
 from ambari_commons.os_family_impl import OsFamilyImpl
+from atlas_plugin_utils import configure_for_plugin
 
 
 class HCatClient(Script):
   def install(self, env):
 import params
+savedConfig = configure_for_plugin(self.command_data_file)
 self.install_packages(env, exclude_packages=params.hive_exclude_packages)
+Script.config = savedConfig
 self.configure(env)
 
   def configure(self, env):

http://git-wip-us.apache.org/repos/asf/ambari/blob/e30a1c82/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
--

ambari git commit: AMBARI-11551. Additional patch for AMBARI-11473 to address review comment (Hitesh Shah via rlevas)

2015-06-02 Thread rlevas
Repository: ambari
Updated Branches:
  refs/heads/trunk d4a26a8fe -> eb2cae7bc


AMBARI-11551. Additional patch for AMBARI-11473 to address review comment 
(Hitesh Shah via rlevas)


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

Branch: refs/heads/trunk
Commit: eb2cae7bc64aa496a10ef74228b88f12f2d80185
Parents: d4a26a8
Author: Hitesh Shah 
Authored: Tue Jun 2 10:14:49 2015 -0400
Committer: Robert Levas 
Committed: Tue Jun 2 10:14:49 2015 -0400

--
 .../tez/src/main/java/org/apache/ambari/view/tez/ProxyServlet.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/eb2cae7b/contrib/views/tez/src/main/java/org/apache/ambari/view/tez/ProxyServlet.java
--
diff --git 
a/contrib/views/tez/src/main/java/org/apache/ambari/view/tez/ProxyServlet.java 
b/contrib/views/tez/src/main/java/org/apache/ambari/view/tez/ProxyServlet.java
index edc647d..8354e89 100644
--- 
a/contrib/views/tez/src/main/java/org/apache/ambari/view/tez/ProxyServlet.java
+++ 
b/contrib/views/tez/src/main/java/org/apache/ambari/view/tez/ProxyServlet.java
@@ -120,8 +120,8 @@ public class ProxyServlet extends HttpServlet {
 }
 
 response.setStatus(responseCode);
-PrintWriter writer = response.getWriter();
 if (result != null) {
+  PrintWriter writer = response.getWriter();
   writer.print(result);
 }
   }



ambari git commit: AMBARI-11608 Install Wizard: Merge calls for service stack configs into single. (atkach)

2015-06-02 Thread atkach
Repository: ambari
Updated Branches:
  refs/heads/trunk e83125106 -> d4a26a8fe


AMBARI-11608 Install Wizard: Merge calls for service stack configs into single. 
(atkach)


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

Branch: refs/heads/trunk
Commit: d4a26a8fe78cc8d18b4bb0899711dd4fa08f8c88
Parents: e831251
Author: Andrii Tkach 
Authored: Tue Jun 2 12:40:06 2015 +0300
Committer: Andrii Tkach 
Committed: Tue Jun 2 16:23:15 2015 +0300

--
 ambari-web/app/controllers/wizard.js   | 44 ++---
 ambari-web/app/utils/ajax/ajax.js  |  4 +++
 ambari-web/app/utils/config.js | 44 +
 ambari-web/test/controllers/wizard_test.js | 18 +-
 4 files changed, 76 insertions(+), 34 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d4a26a8f/ambari-web/app/controllers/wizard.js
--
diff --git a/ambari-web/app/controllers/wizard.js 
b/ambari-web/app/controllers/wizard.js
index 8a3c15c..1177272 100644
--- a/ambari-web/app/controllers/wizard.js
+++ b/ambari-web/app/controllers/wizard.js
@@ -827,39 +827,31 @@ App.WizardController = 
Em.Controller.extend(App.LocalStorage, App.ThemesMappingM
*/
   loadAdvancedConfigs: function (dependentController) {
 var self = this;
-var loadServiceConfigsFn = function(clusterProperties) {
+var loadServiceConfigsFn = function (clusterProperties) {
   var stackServices = self.get('content.services').filter(function 
(service) {
 return service.get('isInstalled') || service.get('isSelected');
   });
-  var counter = stackServices.length;
   var loadAdvancedConfigResult = [];
   dependentController.set('isAdvancedConfigLoaded', false);
-  stackServices.forEach(function (service) {
-var serviceName = service.get('serviceName');
-App.config.loadAdvancedConfig(serviceName, function (properties) {
-  var supportsFinal = 
App.config.getConfigTypesInfoFromService(service).supportsFinal;
 
-  function shouldSupportFinal(filename) {
-var matchingConfigType = supportsFinal.find(function (configType) {
-  return filename.startsWith(configType);
-});
-return !!matchingConfigType;
-  }
+  
App.config.loadAdvancedConfigAll(stackServices.mapProperty('serviceName'), 
function (configMap) {
+stackServices.forEach(function (service) {
+  var serviceName = service.get('serviceName');
+  var properties = configMap[serviceName];
+  var supportsFinal = 
App.config.getConfigTypesInfoFromService(service).supportsFinal;
 
   properties.forEach(function (property) {
-property.supportsFinal = shouldSupportFinal(property.filename);
+property.supportsFinal = Boolean(supportsFinal.find(function 
(configType) {
+  return property.filename.startsWith(configType);
+}));
   });
   loadAdvancedConfigResult.pushObjects(properties);
-  counter--;
-  //pass configs to controller after last call is completed
-  if (counter === 0) {
-loadAdvancedConfigResult.pushObjects(clusterProperties);
-self.set('content.advancedServiceConfig', 
loadAdvancedConfigResult);
-self.setDBProperty('advancedServiceConfig', 
loadAdvancedConfigResult);
-dependentController.set('isAdvancedConfigLoaded', true);
-  }
 });
-  }, this);
+loadAdvancedConfigResult.pushObjects(clusterProperties);
+self.set('content.advancedServiceConfig', loadAdvancedConfigResult);
+self.setDBProperty('advancedServiceConfig', loadAdvancedConfigResult);
+dependentController.set('isAdvancedConfigLoaded', true);
+  });
 };
 App.config.loadClusterConfig(loadServiceConfigsFn);
   },
@@ -1227,16 +1219,16 @@ App.WizardController = 
Em.Controller.extend(App.LocalStorage, App.ThemesMappingM
* @method loadConfigThemes
* @return {$.Deferred}
*/
-   loadConfigThemes: function() {
+  loadConfigThemes: function () {
 var self = this;
 var dfd = $.Deferred();
 if (App.get('isClusterSupportsEnhancedConfigs') && 
!this.get('stackConfigsLoaded')) {
-  var serviceNames = App.StackService.find().filter(function(s) {
+  var serviceNames = App.StackService.find().filter(function (s) {
 return s.get('isSelected') || s.get('isInstalled');
   }).mapProperty('serviceName');
   // Load stack configs before loading themes
-  App.config.loadConfigsFromStack(serviceNames).done(function() {

ambari git commit: AMBARI-11526. White Label Stack Definition (echekanskiy via dlysnichenko)

2015-06-02 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk cc0d68b98 -> e83125106


AMBARI-11526. White Label Stack Definition (echekanskiy via dlysnichenko)


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

Branch: refs/heads/trunk
Commit: e83125106fdc5815cff12913708f65304dd9c8cc
Parents: cc0d68b
Author: Lisnichenko Dmitro 
Authored: Tue Jun 2 16:21:57 2015 +0300
Committer: Lisnichenko Dmitro 
Committed: Tue Jun 2 16:22:45 2015 +0300

--
 .../white_labeling/WhiteLabelStackDefinition.py | 274 +++
 .../src/main/python/white_labeling/__init__.py  |  18 ++
 .../src/main/python/white_labeling/test.json|  61 +
 3 files changed, 353 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e8312510/ambari-common/src/main/python/white_labeling/WhiteLabelStackDefinition.py
--
diff --git 
a/ambari-common/src/main/python/white_labeling/WhiteLabelStackDefinition.py 
b/ambari-common/src/main/python/white_labeling/WhiteLabelStackDefinition.py
new file mode 100644
index 000..c85020f
--- /dev/null
+++ b/ambari-common/src/main/python/white_labeling/WhiteLabelStackDefinition.py
@@ -0,0 +1,274 @@
+#!/usr/bin/env python
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+"""
+
+import sys
+import getopt
+import json
+import os
+import shutil
+import xml.etree.ElementTree as ET
+import re
+
+
+class _named_dict(dict):
+  """
+  Allow to get dict items using attribute notation, eg dict.attr == 
dict['attr']
+  """
+
+  def __init__(self, _dict):
+
+def repl_list(_list):
+  for i, e in enumerate(_list):
+if isinstance(e, list):
+  _list[i] = repl_list(e)
+if isinstance(e, dict):
+  _list[i] = _named_dict(e)
+  return _list
+
+dict.__init__(self, _dict)
+for key, value in self.iteritems():
+  if isinstance(value, dict):
+self[key] = _named_dict(value)
+  if isinstance(value, list):
+self[key] = repl_list(value)
+
+  def __getattr__(self, item):
+if item in self:
+  return self[item]
+else:
+  dict.__getattr__(self, item)
+
+
+def copy_tree(src, dest, exclude=None, post_copy=None):
+  """
+  Copy files form src to dest.
+
+  :param src: source folder
+  :param dest: destination folder
+  :param exclude: list for excluding, eg [".xml"] will exclude all xml files
+  :param post_copy: callable that accepts source and target paths and will be 
called after copying
+  """
+  for item in os.listdir(src):
+if exclude and item in exclude:
+  continue
+
+_src = os.path.join(src, item)
+_dest = os.path.join(dest, item)
+
+if os.path.isdir(_src):
+  if not os.path.exists(_dest):
+os.makedirs(_dest)
+  copy_tree(_src, _dest, exclude, post_copy)
+else:
+  _dest_dirname = os.path.dirname(_dest)
+  if not os.path.exists(_dest_dirname):
+os.makedirs(_dest_dirname)
+  shutil.copy(_src, _dest)
+
+if post_copy:
+  post_copy(_src, _dest)
+
+
+def process_metainfo(file_path, config_data, stack_version_changes):
+  tree = ET.parse(file_path)
+  root = tree.getroot()
+
+  if root.find('versions') is not None or root.find('services') is None:
+# process stack metainfo.xml
+extends_tag = root.find('extends')
+if extends_tag is not None:
+  version = extends_tag.text
+  if version in stack_version_changes:
+extends_tag.text = stack_version_changes[version]
+tree.write(file_path)
+
+current_version = file_path.split(os.sep)[-2]
+modify_active_tag = False
+active_tag_value = None
+for stack in config_data.versions:
+  if stack.version == current_version and 'active' in stack:
+modify_active_tag = True
+active_tag_value = stack.active
+break
+
+if modify_active_tag:
+  versions_tag = root.find('versions')
+  if versions_tag is None:
+versions_

ambari git commit: AMBARI-11594 - Hadoop Home Directory Should Be Chosen Correctly During An Upgrade (part2) (jonathanhurley)

2015-06-02 Thread jonathanhurley
Repository: ambari
Updated Branches:
  refs/heads/trunk 1bb0a8dad -> cc0d68b98


AMBARI-11594 - Hadoop Home Directory Should Be Chosen Correctly During An 
Upgrade (part2) (jonathanhurley)


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

Branch: refs/heads/trunk
Commit: cc0d68b98ffd54589b7c157e55a91260decaa34b
Parents: 1bb0a8d
Author: Jonathan Hurley 
Authored: Tue Jun 2 09:20:07 2015 -0400
Committer: Jonathan Hurley 
Committed: Tue Jun 2 09:20:47 2015 -0400

--
 .../ACCUMULO/1.6.1.2.2.0/package/scripts/params.py  | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/cc0d68b9/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/params.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/params.py
 
b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/params.py
index 76f1581..45fa367 100644
--- 
a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/params.py
+++ 
b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/params.py
@@ -18,14 +18,13 @@ limitations under the License.
 
 """
 from resource_management.libraries.functions import conf_select
+from resource_management.libraries.functions import hdp_select
 from resource_management.libraries.resources.hdfs_resource import HdfsResource
 from resource_management.libraries.functions import format
 from resource_management.libraries.functions.version import 
format_hdp_stack_version
 from resource_management.libraries.functions.default import default
 from resource_management.libraries.script.script import Script
 
-
-
 import status_params
 
 # server configurations
@@ -36,6 +35,8 @@ exec_tmp_dir = status_params.tmp_dir
 security_enabled = status_params.security_enabled
 
 # hdp version
+stack_name = default("/hostLevelParams/stack_name", None)
+version = default("/commandParams/version", None)
 stack_version_unformatted = str(config['hostLevelParams']['stack_version'])
 hdp_stack_version = format_hdp_stack_version(stack_version_unformatted)
 
@@ -48,8 +49,8 @@ conf_dir = status_params.conf_dir
 server_conf_dir = status_params.server_conf_dir
 
 # service locations
-hadoop_prefix = "/usr/hdp/current/hadoop-client"
-hadoop_bin_dir = conf_select.get_hadoop_dir("bin")
+hadoop_prefix = hdp_select.get_hadoop_dir("home")
+hadoop_bin_dir = hdp_select.get_hadoop_dir("bin")
 zookeeper_home = "/usr/hdp/current/zookeeper-client"
 
 # the configuration direction for HDFS/YARN/MapR is the hadoop config



[1/2] ambari git commit: AMBARI-11612. Changing only 'final' flag for a config not being persisted by API (dlysnichenko)

2015-06-02 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk f4a6b76b6 -> 1bb0a8dad


AMBARI-11612. Changing only 'final' flag for a config not being persisted by 
API (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 3bb7a6dc3a8fa45b589c171b0fe54a1beb0bd8a1
Parents: f4a6b76
Author: Lisnichenko Dmitro 
Authored: Tue Jun 2 16:02:57 2015 +0300
Committer: Lisnichenko Dmitro 
Committed: Tue Jun 2 16:02:57 2015 +0300

--
 .../AmbariManagementControllerImpl.java | 49 
 .../AmbariManagementControllerTest.java | 22 +
 2 files changed, 71 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/3bb7a6dc/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 ad76ffa..d327d96 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
@@ -1285,14 +1285,22 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
 if (request.getDesiredConfig() != null) {
   for (ConfigurationRequest desiredConfig : request.getDesiredConfig()) {
 Map requestConfigProperties = 
desiredConfig.getProperties();
+Map> requestConfigAttributes = 
desiredConfig.getPropertiesAttributes();
 Config clusterConfig = 
cluster.getDesiredConfigByType(desiredConfig.getType());
 Map clusterConfigProperties = null;
+Map> clusterConfigAttributes = null;
 if (clusterConfig != null) {
   clusterConfigProperties = clusterConfig.getProperties();
+  clusterConfigAttributes = clusterConfig.getPropertiesAttributes();
+  if (!isAttributeMapsEqual(requestConfigAttributes, 
clusterConfigAttributes)){
+isConfigurationCreationNeeded = true;
+break;
+  }
 } else {
   isConfigurationCreationNeeded = true;
   break;
 }
+
 if (requestConfigProperties == null || 
requestConfigProperties.isEmpty()) {
   Config existingConfig = cluster.getConfig(desiredConfig.getType(), 
desiredConfig.getVersionTag());
   if (existingConfig != null) {
@@ -1491,6 +1499,47 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
   }
 
   /**
+   * Comparison of two attributes maps 
+   * @param requestConfigAttributes - attribute map sent from API
+   * @param clusterConfigAttributes - existed attribute map
+   * @return true if maps is equal (have the same attributes and their values) 
+   */
+  public boolean isAttributeMapsEqual(Map> 
requestConfigAttributes,
+  Map> clusterConfigAttributes) {
+boolean isAttributesEqual = true;
+if ((requestConfigAttributes != null && clusterConfigAttributes == null)
+|| (requestConfigAttributes == null && clusterConfigAttributes != 
null)
+|| (requestConfigAttributes != null && clusterConfigAttributes != 
null 
+&& 
!requestConfigAttributes.keySet().equals(clusterConfigAttributes.keySet( {
+  return false;
+} else if (clusterConfigAttributes != null && requestConfigAttributes != 
null) {
+  for (Entry> ClusterEntrySet : 
clusterConfigAttributes.entrySet()) {
+Map clusterMapAttributes = ClusterEntrySet.getValue();
+Map requestMapAttributes = 
requestConfigAttributes.get(ClusterEntrySet.getKey());
+if ((requestMapAttributes != null && clusterMapAttributes == null)
+|| (requestMapAttributes == null && clusterMapAttributes != 
null)
+|| (requestMapAttributes != null && clusterMapAttributes != 
null 
+&& 
!requestMapAttributes.keySet().equals(clusterMapAttributes.keySet( {
+  return false;
+} else if (requestMapAttributes != null && clusterMapAttributes != 
null) {
+  for (Entry requestPropertyEntrySet : 
requestMapAttributes.entrySet()) {
+String requestPropertyValue = requestPropertyEntrySet.getValue();
+String clusterPropertyValue = 
clusterMapAttributes.get(requestPropertyEntrySet.getKey());
+if ((requestPropertyValue != null && clusterPropertyValue == null)
+|| 

[2/2] ambari git commit: AMBARI-11611. Delete incorrect Storm-HA configs (dlysnichenko)

2015-06-02 Thread dmitriusan
AMBARI-11611. Delete incorrect Storm-HA configs (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 1bb0a8dad6da296dd06cc3b998c974389b2e765f
Parents: 3bb7a6d
Author: Lisnichenko Dmitro 
Authored: Tue Jun 2 16:03:25 2015 +0300
Committer: Lisnichenko Dmitro 
Committed: Tue Jun 2 16:03:25 2015 +0300

--
 .../STORM/0.9.1.2.1/package/scripts/params_linux.py| 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/1bb0a8da/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_linux.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_linux.py
 
b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_linux.py
index fa31f04..6c3078b 100644
--- 
a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_linux.py
+++ 
b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_linux.py
@@ -102,8 +102,10 @@ if len(nimbus_hosts) > 1:
   actual_topology_min_replication_count = 2
 else:
   actual_topology_max_replication_wait_time_sec = 
default_topology_max_replication_wait_time_sec
-  actual_topology_min_replication_count = 
default_topology_min_replication_count  
-
+  actual_topology_min_replication_count = 
default_topology_min_replication_count 
+  
+del 
config['configurations']['storm-site']['topology.max.replication.wait.time.sec.default']
+del 
config['configurations']['storm-site']['topology.min.replication.count.default']
 rest_api_port = "8745"
 rest_api_admin_port = "8746"
 rest_api_conf_file = format("{conf_dir}/config.yaml")



ambari git commit: AMBARI-11610. action "Update Rack" should not be available for user with read-only access (onechiporenko)

2015-06-02 Thread onechiporenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 46bf5cb13 -> f4a6b76b6


AMBARI-11610. action "Update Rack" should not be available for user with 
read-only access (onechiporenko)


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

Branch: refs/heads/trunk
Commit: f4a6b76b63f35a8e52dfea5c443c1edd27e165a8
Parents: 46bf5cb
Author: Oleg Nechiporenko 
Authored: Tue Jun 2 15:02:56 2015 +0300
Committer: Oleg Nechiporenko 
Committed: Tue Jun 2 15:02:56 2015 +0300

--
 ambari-web/app/templates/main/host/summary.hbs | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/f4a6b76b/ambari-web/app/templates/main/host/summary.hbs
--
diff --git a/ambari-web/app/templates/main/host/summary.hbs 
b/ambari-web/app/templates/main/host/summary.hbs
index 28f2989..517aef3 100644
--- a/ambari-web/app/templates/main/host/summary.hbs
+++ b/ambari-web/app/templates/main/host/summary.hbs
@@ -135,7 +135,11 @@
    {{view.content.ip}}
 
 {{t common.rack}}:
- {{view.content.rack}} 
+ {{view.content.rack}}
+  {{#isAccessible MANAGER}}
+
+  {{/isAccessible}}
+
 
 {{t common.os}}:
    {{view.content.osType}} ({{view.content.osArch}})



ambari git commit: AMBARI-11609. User with Read-Only access can't visit service configs page (onechiporenko)

2015-06-02 Thread onechiporenko
Repository: ambari
Updated Branches:
  refs/heads/trunk ad5b54524 -> 46bf5cb13


AMBARI-11609. User with Read-Only access can't visit service configs page 
(onechiporenko)


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

Branch: refs/heads/trunk
Commit: 46bf5cb1377db5168f6c99e79f436030d9531ab5
Parents: ad5b545
Author: Oleg Nechiporenko 
Authored: Tue Jun 2 14:10:28 2015 +0300
Committer: Oleg Nechiporenko 
Committed: Tue Jun 2 14:10:28 2015 +0300

--
 .../controllers/main/service/info/configs.js| 31 +---
 .../app/views/main/host/configs_service.js  |  8 +++--
 .../main/service/info/config_test.js| 26 
 3 files changed, 53 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/46bf5cb1/ambari-web/app/controllers/main/service/info/configs.js
--
diff --git a/ambari-web/app/controllers/main/service/info/configs.js 
b/ambari-web/app/controllers/main/service/info/configs.js
index c5bcf9f..007b610 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -135,7 +135,7 @@ App.MainServiceInfoConfigsController = 
Em.Controller.extend(App.ServerValidatorM
* @type {boolean}
*/
   canEdit: function () {
-return this.get('isCurrentSelected') && !this.get('isCompareMode');
+return this.get('isCurrentSelected') && !this.get('isCompareMode') && 
App.isAccessible('MANAGER');
   }.property('isCurrentSelected', 'isCompareMode'),
 
   serviceConfigs: function () {
@@ -851,15 +851,26 @@ App.MainServiceInfoConfigsController = 
Em.Controller.extend(App.ServerValidatorM
 if (!App.Service.find().someProperty('serviceName', 'RANGER')) {
   App.config.removeRangerConfigs(this.get('stepConfigs'));
 }
-this.getRecommendationsForDependencies(null, true, function() {
-  self.setProperties({
-dataIsLoaded: true,
-versionLoaded: true,
-isInit: false
-  });
-  Em.run.next(function(){
- self.set('hash', self.getHash())
-  });
+if (App.isAccessible('MANAGER')) {
+  this.getRecommendationsForDependencies(null, true, 
self._onLoadComplete.bind(self));
+}
+else {
+  self._onLoadComplete();
+}
+  },
+
+  /**
+   * @method _getRecommendationsForDependenciesCallback
+   */
+  _onLoadComplete: function () {
+var self = this;
+this.setProperties({
+  dataIsLoaded: true,
+  versionLoaded: true,
+  isInit: false
+});
+Em.run.next(function(){
+  self.set('hash', self.getHash());
 });
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/46bf5cb1/ambari-web/app/views/main/host/configs_service.js
--
diff --git a/ambari-web/app/views/main/host/configs_service.js 
b/ambari-web/app/views/main/host/configs_service.js
index 3415125..3026f25 100644
--- a/ambari-web/app/views/main/host/configs_service.js
+++ b/ambari-web/app/views/main/host/configs_service.js
@@ -18,13 +18,17 @@
 var App = require('app');
 
 App.MainHostServiceConfigsView = Em.View.extend({
+
   templateName: require('templates/main/host/configs_service'),
+
   didInsertElement: function () {
-var controller = this.get('controller');
-controller.loadStep();
+this.get('controller').loadStep();
   },
+
   isConfigsEditable: false,
+
   content: function () {
 return App.router.get('mainHostDetailsController.content');
   }.property('App.router.mainHostDetailsController.content')
+
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/46bf5cb1/ambari-web/test/controllers/main/service/info/config_test.js
--
diff --git a/ambari-web/test/controllers/main/service/info/config_test.js 
b/ambari-web/test/controllers/main/service/info/config_test.js
index 0fedc6d..10affac 100644
--- a/ambari-web/test/controllers/main/service/info/config_test.js
+++ b/ambari-web/test/controllers/main/service/info/config_test.js
@@ -1253,4 +1253,30 @@ describe("App.MainServiceInfoConfigsController", 
function () {
 
   });
 
+  describe('#_onLoadComplete', function () {
+
+beforeEach(function () {
+  sinon.stub(Em.run, 'next', Em.K);
+  mainServiceInfoConfigsController.setProperties({
+dataIsLoaded: false,
+versionLoaded: false,
+isInit: true
+  });
+});
+
+afterEach(function () {
+  Em.run.next.restore();
+});
+
+it('should update flags', function () {
+
+  mainServiceInfoConfigsController._onLoadC