You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2017/02/13 21:03:35 UTC

[01/50] [abbrv] ambari git commit: AMBARI-19951. Set "yarn.scheduler.capacity.ordering-policy.priority-utilization.underutilized-preemption.enabled" property value during RU/EU to HDP2.6 (dgrinenko via dlysnichenko)

Repository: ambari
Updated Branches:
  refs/heads/branch-dev-patch-upgrade d222f572e -> a8fb4c6d4


AMBARI-19951. Set "yarn.scheduler.capacity.ordering-policy.priority-utilization.underutilized-preemption.enabled" property value during RU/EU to HDP2.6 (dgrinenko via dlysnichenko)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: fc9788af1d5c9533de5961e5bc97cf46b2a98b44
Parents: 41034aa
Author: Lisnichenko Dmitro <dl...@hortonworks.com>
Authored: Fri Feb 10 15:16:53 2017 +0200
Committer: Lisnichenko Dmitro <dl...@hortonworks.com>
Committed: Fri Feb 10 15:16:53 2017 +0200

----------------------------------------------------------------------
 .../main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml | 7 +++++++
 .../stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml        | 6 ++++++
 .../main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml    | 1 +
 .../main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml | 7 +++++++
 .../stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml        | 7 +++++++
 .../main/resources/stacks/HDP/2.4/upgrades/upgrade-2.6.xml    | 1 +
 .../main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml | 7 +++++++
 .../stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml        | 7 +++++++
 .../main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml    | 1 +
 9 files changed, 44 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/fc9788af/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml
index eac318e..478f9b4 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml
@@ -511,6 +511,13 @@
             <type>yarn-env</type>
             <insert key="content" value="{% if rm_security_opts is defined %} YARN_OPTS=&quot;{{rm_security_opts}} $YARN_OPTS&quot; {% endif %}" insert-type="append" newline-before="true" newline-after="true" />
           </definition>
+          <definition xsi:type="configure" id="hdp_2_6_0_0_yarn_priority_utilization_underutilized_preemption">
+            <type>yarn-site</type>
+            <transfer operation="copy"
+                      from-key="yarn.resourcemanager.scheduler.monitor.enable"
+                      to-key="yarn.scheduler.capacity.ordering-policy.priority-utilization.underutilized-preemption.enabled"
+                      default-value="false"/>
+          </definition>
         </changes>
       </component>
     </service>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fc9788af/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml
index 8da11ff..0d4e3b8 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml
@@ -319,6 +319,12 @@
         </task>
       </execute-stage>
 
+      <execute-stage service="YARN" component="RESOURCEMANAGER" title="Apply config changes for Resource Manager">
+        <task xsi:type="configure" id="hdp_2_6_0_0_yarn_priority_utilization_underutilized_preemption">
+          <summary>Updating underutilized_preemption setting</summary>
+        </task>
+      </execute-stage>
+
       <execute-stage service="MAPREDUCE2" component="MAPREDUCE2_CLIENT" title="Apply config changes for Mapreduce2 client">
         <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.FixLzoCodecPath">
           <summary>Verifying LZO codec path for mapreduce</summary>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fc9788af/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml
index 01fc102..58db4a9 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml
@@ -762,6 +762,7 @@
           <task xsi:type="configure" id="hdp_2_5_0_0_remove_ranger_yarn_audit_db" />
           <task xsi:type="configure" id="yarn_log4j_parameterize" />
           <task xsi:type="configure" id="yarn_env_security_opts" />
+          <task xsi:type="configure" id="hdp_2_6_0_0_yarn_priority_utilization_underutilized_preemption" />
         </pre-upgrade>
         <pre-downgrade /> <!--  no-op to prevent config changes on downgrade -->
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/fc9788af/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml
index cc50ac5..18f5fa1 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml
@@ -297,6 +297,13 @@
             <type>yarn-env</type>
             <insert key="content" value="{% if rm_security_opts is defined %} YARN_OPTS=&quot;{{rm_security_opts}} $YARN_OPTS&quot; {% endif %}" insert-type="append" newline-before="true" newline-after="true" />
           </definition>
+          <definition xsi:type="configure" id="hdp_2_6_0_0_yarn_priority_utilization_underutilized_preemption">
+            <type>yarn-site</type>
+            <transfer operation="copy"
+                      from-key="yarn.resourcemanager.scheduler.monitor.enable"
+                      to-key="yarn.scheduler.capacity.ordering-policy.priority-utilization.underutilized-preemption.enabled"
+                      default-value="false"/>
+          </definition>
         </changes>
       </component>
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/fc9788af/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml
index 046904b..eedf98c 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml
@@ -293,6 +293,13 @@
         <task xsi:type="configure" id="hdp_2_5_0_0_add_spark2_yarn_shuffle"/>
       </execute-stage>
 
+      <!--Yarn-->
+      <execute-stage service="YARN" component="RESOURCEMANAGER" title="Apply config changes for Resource Manager">
+        <task xsi:type="configure" id="hdp_2_6_0_0_yarn_priority_utilization_underutilized_preemption">
+          <summary>Updating underutilized_preemption setting</summary>
+        </task>
+      </execute-stage>
+
       <!--TEZ-->
       <execute-stage service="TEZ" component="TEZ_CLIENT" title="Verify LZO codec path for Tez">
         <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.FixLzoCodecPath">

http://git-wip-us.apache.org/repos/asf/ambari/blob/fc9788af/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.6.xml
index 70bb2ca..392e0fa 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.6.xml
@@ -767,6 +767,7 @@
           <task xsi:type="configure" id="hdp_2_5_0_0_remove_ranger_yarn_audit_db" />
           <task xsi:type="configure" id="yarn_log4j_parameterize" />
           <task xsi:type="configure" id="yarn_env_security_opts" />
+          <task xsi:type="configure" id="hdp_2_6_0_0_yarn_priority_utilization_underutilized_preemption" />
         </pre-upgrade>
         <pre-downgrade /> <!--  no-op to prevent config changes on downgrade -->
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/fc9788af/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml
index a5bfcf6..100df8f 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml
@@ -139,6 +139,13 @@
           <type>yarn-env</type>
           <insert key="content" value="{% if rm_security_opts is defined %} YARN_OPTS=&quot;{{rm_security_opts}} $YARN_OPTS&quot; {% endif %}" insert-type="append" newline-before="true" newline-after="true" />
         </definition>
+        <definition xsi:type="configure" id="hdp_2_6_0_0_yarn_priority_utilization_underutilized_preemption">
+          <type>yarn-site</type>
+          <transfer operation="copy"
+                    from-key="yarn.resourcemanager.scheduler.monitor.enable"
+                    to-key="yarn.scheduler.capacity.ordering-policy.priority-utilization.underutilized-preemption.enabled"
+                    default-value="false"/>
+        </definition>
       </changes>
     </component>
   </service>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fc9788af/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml
index 5b8351b..6e92141 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml
@@ -298,6 +298,13 @@
         </task>
       </execute-stage>
 
+      <!--Yarn-->
+      <execute-stage service="YARN" component="RESOURCEMANAGER" title="Apply config changes for Resource Manager">
+        <task xsi:type="configure" id="hdp_2_6_0_0_yarn_priority_utilization_underutilized_preemption">
+          <summary>Updating underutilized_preemption setting</summary>
+        </task>
+      </execute-stage>
+
       <!--TEZ-->
       <execute-stage service="TEZ" component="TEZ_CLIENT" title="Verify LZO codec path for Tez">
         <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.FixLzoCodecPath">

http://git-wip-us.apache.org/repos/asf/ambari/blob/fc9788af/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml
index 2f07c97..bc68754 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml
@@ -669,6 +669,7 @@
         <pre-upgrade>
           <task xsi:type="configure" id="yarn_log4j_parameterize" />
           <task xsi:type="configure" id="yarn_env_security_opts" />
+          <task xsi:type="configure" id="hdp_2_6_0_0_yarn_priority_utilization_underutilized_preemption" />
         </pre-upgrade>
         <pre-downgrade />
         <upgrade>


[40/50] [abbrv] ambari git commit: AMBARI-19799. Optimize DB initialization for Ambari Server Unit Tests. Fix imports for checkstyle. (mpapirkovskyy)

Posted by nc...@apache.org.
AMBARI-19799. Optimize DB initialization for Ambari Server Unit Tests. Fix imports for checkstyle. (mpapirkovskyy)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 40f8ee94056e83c1aa1e124bff4f38ba20ea0474
Parents: 2d7276e
Author: Myroslav Papirkovskyi <mp...@hortonworks.com>
Authored: Fri Feb 3 20:32:56 2017 +0200
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Mon Feb 13 15:45:35 2017 -0500

----------------------------------------------------------------------
 .../server/upgrade/UpgradeCatalog250.java       | 31 +++++----
 .../apache/ambari/server/H2DatabaseCleaner.java |  9 ---
 .../server/upgrade/UpgradeCatalog250Test.java   | 73 ++++++++++----------
 3 files changed, 54 insertions(+), 59 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/40f8ee94/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
index 1e36a3c..18e9744 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
@@ -17,8 +17,20 @@
  */
 package org.apache.ambari.server.upgrade;
 
-import com.google.inject.Inject;
-import com.google.inject.Injector;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicLong;
+
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.actionmanager.CommandExecutionType;
 import org.apache.ambari.server.configuration.Configuration;
@@ -34,19 +46,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.jdbc.support.JdbcUtils;
 
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicLong;
+import com.google.inject.Inject;
+import com.google.inject.Injector;
 
 /**
  * Upgrade catalog for version 2.5.0.

http://git-wip-us.apache.org/repos/asf/ambari/blob/40f8ee94/ambari-server/src/test/java/org/apache/ambari/server/H2DatabaseCleaner.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/H2DatabaseCleaner.java b/ambari-server/src/test/java/org/apache/ambari/server/H2DatabaseCleaner.java
index 493e88b..190e54f 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/H2DatabaseCleaner.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/H2DatabaseCleaner.java
@@ -18,19 +18,12 @@
 
 package org.apache.ambari.server;
 
-import static org.eclipse.persistence.config.PersistenceUnitProperties.DEFAULT_CREATE_JDBC_FILE_NAME;
-
-import java.io.IOException;
-import java.nio.charset.Charset;
-import java.nio.file.Files;
-import java.nio.file.Paths;
 import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.PreparedStatement;
 import java.sql.SQLException;
 import java.sql.Statement;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 
 import javax.persistence.EntityManager;
@@ -39,8 +32,6 @@ import javax.persistence.metamodel.EntityType;
 
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.orm.DBAccessorImpl;
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.lang.StringUtils;
 
 import com.google.inject.Injector;
 import com.google.inject.persist.PersistService;

http://git-wip-us.apache.org/repos/asf/ambari/blob/40f8ee94/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
index b950594..4dffea8 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
@@ -18,15 +18,35 @@
 
 package org.apache.ambari.server.upgrade;
 
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Maps;
-import com.google.gson.Gson;
-import com.google.inject.Binder;
-import com.google.inject.Guice;
-import com.google.inject.Injector;
-import com.google.inject.Module;
-import com.google.inject.Provider;
-import junit.framework.AssertionFailedError;
+import static org.easymock.EasyMock.anyObject;
+import static org.easymock.EasyMock.anyString;
+import static org.easymock.EasyMock.capture;
+import static org.easymock.EasyMock.createMockBuilder;
+import static org.easymock.EasyMock.createNiceMock;
+import static org.easymock.EasyMock.eq;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.expectLastCall;
+import static org.easymock.EasyMock.newCapture;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.reset;
+import static org.easymock.EasyMock.verify;
+import static org.junit.Assert.assertTrue;
+
+import java.lang.reflect.Method;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.persistence.EntityManager;
+
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.actionmanager.ActionManager;
 import org.apache.ambari.server.configuration.Configuration;
@@ -58,33 +78,16 @@ import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import javax.persistence.EntityManager;
-import java.lang.reflect.Method;
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Maps;
+import com.google.gson.Gson;
+import com.google.inject.Binder;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+import com.google.inject.Module;
+import com.google.inject.Provider;
 
-import static org.easymock.EasyMock.anyObject;
-import static org.easymock.EasyMock.anyString;
-import static org.easymock.EasyMock.capture;
-import static org.easymock.EasyMock.createMockBuilder;
-import static org.easymock.EasyMock.createNiceMock;
-import static org.easymock.EasyMock.eq;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.expectLastCall;
-import static org.easymock.EasyMock.newCapture;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.reset;
-import static org.easymock.EasyMock.verify;
-import static org.junit.Assert.assertTrue;
+import junit.framework.AssertionFailedError;
 
 /**
  * {@link UpgradeCatalog250} unit tests.


[28/50] [abbrv] ambari git commit: AMBARI-19981. Hive View 2.0: Enable Notifications. (dipayanb)

Posted by nc...@apache.org.
AMBARI-19981. Hive View 2.0: Enable Notifications. (dipayanb)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 6c4cbc4f7efddd55e063dbff470fa04eee2e68bf
Parents: a6445ac
Author: Dipayan Bhowmick <di...@gmail.com>
Authored: Mon Feb 13 18:59:11 2017 +0530
Committer: Dipayan Bhowmick <di...@gmail.com>
Committed: Mon Feb 13 18:59:54 2017 +0530

----------------------------------------------------------------------
 .../resources/ui/app/components/create-table.js |  6 +++-
 .../resources/ui/app/configs/file-format.js     |  4 ++-
 .../resources/ui/app/controllers/messages.js    | 30 ++++++++++++++++
 .../ui/app/controllers/messages/message.js      | 31 ++++++++++++++++
 .../app/helpers/alert-message-context-class.js  | 27 ++++++++++++++
 .../ui/app/helpers/alert-message-icon-class.js  | 37 ++++++++++++++++++++
 .../resources/ui/app/helpers/shorten-text.js    | 32 +++++++++++++++++
 .../main/resources/ui/app/mixins/ui-logger.js   | 15 ++++++++
 .../main/resources/ui/app/routes/databases.js   | 12 ++++---
 .../databases/database/tables/new-database.js   | 15 ++++----
 .../app/routes/databases/database/tables/new.js |  8 +++--
 .../routes/databases/database/tables/table.js   |  8 +++--
 .../databases/database/tables/table/edit.js     | 16 ++++-----
 .../databases/database/tables/table/rename.js   | 15 ++++----
 .../src/main/resources/ui/app/routes/jobs.js    |  3 --
 .../main/resources/ui/app/routes/settings.js    | 10 +++---
 .../resources/ui/app/services/alert-messages.js | 13 ++++---
 .../ui/app/templates/databases-loading.hbs      | 21 +++++++++++
 .../databases/database/tables-loading.hbs       | 24 +++++++++++++
 .../databases/database/tables/table-loading.hbs | 21 +++++++++++
 .../resources/ui/app/templates/jobs-loading.hbs | 20 +++++++++++
 .../resources/ui/app/templates/messages.hbs     | 14 +++-----
 .../ui/app/templates/messages/message.hbs       |  6 ++--
 .../ui/app/templates/savedqueries-loading.hbs   | 21 +++++++++++
 .../ui/app/templates/settings-loading.hbs       | 21 +++++++++++
 .../resources/ui/app/templates/udfs-loading.hbs | 21 +++++++++++
 .../src/main/resources/ui/config/environment.js |  2 +-
 27 files changed, 387 insertions(+), 66 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6c4cbc4f/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js b/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js
index f31d37f..670ebd7 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js
@@ -18,13 +18,17 @@
 
 import Ember from 'ember';
 import Helper from '../configs/helpers';
+import FileFormats from '../configs/file-format';
 
 export default Ember.Component.extend({
   init() {
     this._super(...arguments);
+    let defaultFileFormat = FileFormats.findBy('default', true);
     this.set('columns', Ember.A());
     this.set('properties', []);
-    this.set('settings', {});
+    this.set('settings', {
+      fileFormat: { type: defaultFileFormat.name}
+    });
     this.set('shouldAddBuckets', null);
     this.set('settingErrors', []);
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c4cbc4f/contrib/views/hive20/src/main/resources/ui/app/configs/file-format.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/configs/file-format.js b/contrib/views/hive20/src/main/resources/ui/app/configs/file-format.js
index 4042b63..afcba6e 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/configs/file-format.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/configs/file-format.js
@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-export default [
+let fileFormats = [
   {name: "SEQUENCEFILE", default: false, custom: false},
   {name: "TEXTFILE", default: false, custom: false},
   {name: "RCFILE", default: false, custom: false},
@@ -24,3 +24,5 @@ export default [
   {name: "AVRO", default: false, custom: false},
   {name: "CUSTOM SerDe", default: false, custom: true},
 ];
+
+export default fileFormats;

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c4cbc4f/contrib/views/hive20/src/main/resources/ui/app/controllers/messages.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/controllers/messages.js b/contrib/views/hive20/src/main/resources/ui/app/controllers/messages.js
new file mode 100644
index 0000000..10aa612
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/controllers/messages.js
@@ -0,0 +1,30 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+
+export default Ember.Controller.extend({
+  isExpanded: true,
+  shortenLength: Ember.computed('isExpanded', function() {
+    if(this.get('isExpanded') === true) {
+      return 200;
+    } else {
+      return 100;
+    }
+  })
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c4cbc4f/contrib/views/hive20/src/main/resources/ui/app/controllers/messages/message.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/controllers/messages/message.js b/contrib/views/hive20/src/main/resources/ui/app/controllers/messages/message.js
new file mode 100644
index 0000000..d46c1f6
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/controllers/messages/message.js
@@ -0,0 +1,31 @@
+/**
+ * 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 Ember from 'ember';
+
+export default Ember.Controller.extend({
+
+  showStatus: Ember.computed('model', function() {
+    return this.get('model.status') !== -1;
+  }),
+
+  displayBody: Ember.computed('model', function() {
+    return !(Ember.isBlank(this.get('model.responseMessage'))
+      && Ember.isBlank(this.get('model.trace')));
+  })
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c4cbc4f/contrib/views/hive20/src/main/resources/ui/app/helpers/alert-message-context-class.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/helpers/alert-message-context-class.js b/contrib/views/hive20/src/main/resources/ui/app/helpers/alert-message-context-class.js
new file mode 100644
index 0000000..28a5a8d
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/helpers/alert-message-context-class.js
@@ -0,0 +1,27 @@
+/**
+ * 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 Ember from 'ember';
+
+export function alertMessageContextClass(params) {
+  let messageType = params[0];
+  let prefix = params[1];
+  return `${prefix}${messageType}`;
+}
+
+export default Ember.Helper.helper(alertMessageContextClass);

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c4cbc4f/contrib/views/hive20/src/main/resources/ui/app/helpers/alert-message-icon-class.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/helpers/alert-message-icon-class.js b/contrib/views/hive20/src/main/resources/ui/app/helpers/alert-message-icon-class.js
new file mode 100644
index 0000000..707f2d1
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/helpers/alert-message-icon-class.js
@@ -0,0 +1,37 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+
+export function alertMessageIconClass(params) {
+  let type = params[0];
+  switch (type) {
+    case 'success':
+      return 'check';
+    case 'info':
+      return 'info';
+    case 'warning':
+      return 'exclamation';
+    case 'danger':
+      return 'times';
+    default:
+      return 'check';
+  }
+}
+
+export default Ember.Helper.helper(alertMessageIconClass);

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c4cbc4f/contrib/views/hive20/src/main/resources/ui/app/helpers/shorten-text.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/helpers/shorten-text.js b/contrib/views/hive20/src/main/resources/ui/app/helpers/shorten-text.js
new file mode 100644
index 0000000..c50b5ca
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/helpers/shorten-text.js
@@ -0,0 +1,32 @@
+/**
+ * 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 Ember from 'ember';
+
+export function shortenText(params) {
+  let text = params[0];
+  let length = params[1];
+  if (text.length < length) {
+    return text;
+  } else {
+    return text.substring(0, length - 3) + '...';
+  }
+
+}
+
+export default Ember.Helper.helper(shortenText);

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c4cbc4f/contrib/views/hive20/src/main/resources/ui/app/mixins/ui-logger.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/mixins/ui-logger.js b/contrib/views/hive20/src/main/resources/ui/app/mixins/ui-logger.js
new file mode 100644
index 0000000..fb252d2
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/mixins/ui-logger.js
@@ -0,0 +1,15 @@
+import Ember from 'ember';
+
+export default Ember.Mixin.create({
+  logger: Ember.inject.service('alert-messages'),
+
+  extractError(error) {
+    if (Ember.isArray(error.errors) && (error.errors.length >= 0)) {
+      return error.errors[0];
+    } else if(!Ember.isEmpty(error.errors)) {
+      return error.errors;
+    } else {
+      return error;
+    }
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c4cbc4f/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js
index 123a93f..6b0eab2 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js
@@ -17,8 +17,9 @@
  */
 
 import Ember from 'ember';
+import UILoggerMixin from '../mixins/ui-logger';
 
-export default Ember.Route.extend({
+export default Ember.Route.extend(UILoggerMixin, {
   tableOperations: Ember.inject.service(),
 
   model() {
@@ -93,7 +94,8 @@ export default Ember.Route.extend({
           this.controller.set('deleteDatabaseMessage', 'Waiting for the database to be deleted');
           this.get('tableOperations').waitForJobToComplete(job.get('id'), 5 * 1000)
             .then((status) => {
-              this.controller.set('deleteDatabaseMessage', "Successfully Deleted table");
+              this.controller.set('deleteDatabaseMessage', "Successfully deleted database");
+              this.get('logger').success(`Successfully deleted database '${databaseModel.get('name')}'`);
               Ember.run.later(() => {
                 this.store.unloadRecord(databaseModel);
                 this.controller.set('showDeleteDatabaseModal', false);
@@ -102,16 +104,16 @@ export default Ember.Route.extend({
                 this.refresh();
               }, 2 * 1000);
             }, (error) => {
-              // TODO: handle error
+              this.get('logger').danger(`Failed to delete database '${databaseModel.get('name')}'`, this.extractError(error));
               Ember.run.later(() => {
                 this.controller.set('showDeleteDatabaseModal', false);
                 this.controller.set('deleteDatabaseMessage');
                 this.replaceWith('databases');
                 this.refresh();
-              }, 2 * 1000);
+              }, 1 * 1000);
             });
         }, (error) => {
-          console.log("Error encountered", error);
+          this.get('logger').danger(`Failed to delete database '${databaseModel.get('name')}'`, this.extractError(error));
           this.controller.set('showDeleteDatabaseModal', false);
         });
     },

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c4cbc4f/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/new-database.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/new-database.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/new-database.js
index b421bdc..ad7fc99 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/new-database.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/new-database.js
@@ -17,8 +17,9 @@
  */
 
 import Ember from 'ember';
+import UILoggerMixin from '../../../../mixins/ui-logger';
 
-export default Ember.Route.extend({
+export default Ember.Route.extend(UILoggerMixin, {
 
   tableOperations: Ember.inject.service(),
 
@@ -40,10 +41,10 @@ export default Ember.Route.extend({
     }).then((status) => {
       this._modalStatus(true, 'Successfully created database');
       this._transitionToDatabases(newDatabaseName);
+      this.get('logger').success(`Successfully created database '${newDatabaseName}'`);
     }).catch((err) => {
-      this._modalStatus(true, 'Failed to create database');
-      this._alertMessage('Failed to create database', err);
-      this._transitionToDatabases();
+      this._modalStatus(false);
+      this.get('logger').danger(`Failed to create database '${newDatabaseName}'`, this.extractError(err));
     });
   },
 
@@ -59,10 +60,6 @@ export default Ember.Route.extend({
       this._modalStatus(false);
       this.transitionTo('databases');
     }, 2000);
-  },
-
-  _alertMessage(message, err) {
-    console.log(message, err);
-    // TODO: user alert message here
   }
+
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c4cbc4f/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/new.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/new.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/new.js
index c8ad239..b29d863 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/new.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/new.js
@@ -18,8 +18,9 @@
 
 import Ember from 'ember';
 import tabs from '../../../../configs/create-table-tabs';
+import UILoggerMixin from '../../../../mixins/ui-logger';
 
-export default Ember.Route.extend({
+export default Ember.Route.extend(UILoggerMixin, {
   tableOperations: Ember.inject.service(),
 
   setupController(controller, model) {
@@ -44,6 +45,7 @@ export default Ember.Route.extend({
         return this.get('tableOperations').waitForJobToComplete(job.get('id'), 5 * 1000)
           .then((status) => {
             this.controller.set('createTableMessage', "Successfully created table");
+            this.get('logger').success(`Successfully created table '${settings.name}'`);
             Ember.run.later(() => {
             this.controller.set('showCreateTableModal', false);
             this.controller.set('createTableMessage');
@@ -55,7 +57,7 @@ export default Ember.Route.extend({
             }, 2 * 1000);
             return Ember.RSVP.Promise.resolve(job);
           }, (error) => {
-            // TODO: handle error
+            this.get('logger').danger(`Failed to create table '${settings.name}'`, this.extractError(error));
             Ember.run.later(() => {
               this.controller.set('showCreateTableModal', false);
               this.controller.set('createTableMessage');
@@ -67,7 +69,7 @@ export default Ember.Route.extend({
             return Ember.RSVP.Promise.reject(error);
           });
       }, (error) => {
-        console.log("Error encountered", error);
+        this.get('logger').danger(`Failed to create table '${settings.name}'`, this.extractError(error));
         this.controller.set('showCreateTableModal', true);
         throw error;
       });

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c4cbc4f/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table.js
index 1066bc1..6ee8100 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table.js
@@ -18,8 +18,9 @@
 
 import Ember from 'ember';
 import tabs from '../../../../configs/table-level-tabs';
+import UILoggerMixin from '../../../../mixins/ui-logger';
 
-export default Ember.Route.extend({
+export default Ember.Route.extend(UILoggerMixin, {
   tableOperations: Ember.inject.service(),
   model(params) {
     let database = this.modelFor('databases.database').get('name');
@@ -65,6 +66,7 @@ export default Ember.Route.extend({
         this.get('tableOperations').waitForJobToComplete(job.get('id'), 5 * 1000)
           .then((status) => {
             this.controller.set('deleteTableMessage', "Successfully Deleted table");
+            this.get('logger').success(`Successfully deleted table '${tableInfo.get('table')}'`);
             Ember.run.later(() => {
               this.controller.set('showDeleteTableModal', false);
               this.controller.set('deleteTableMessage');
@@ -73,7 +75,7 @@ export default Ember.Route.extend({
               this.transitionTo('databases.database', databaseModel.get('name'));
             }, 2 * 1000);
           }, (error) => {
-            // TODO: handle error
+            this.get('logger').danger(`Failed to delete table '${tableInfo.get('table')}'`, this.extractError(error));
             Ember.run.later(() => {
               this.controller.set('showDeleteTableModal', false);
               this.controller.set('deleteTableMessage');
@@ -81,7 +83,7 @@ export default Ember.Route.extend({
             }, 2 * 1000);
           });
       }, (error) => {
-        console.log("Error encountered", error);
+        this.get('logger').danger(`Failed to delete table '${tableInfo.get('table')}'`, this.extractError(error));
         this.controller.set('showDeleteTableModal', true);
       });
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c4cbc4f/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/edit.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/edit.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/edit.js
index 47340ba..d9f80e1 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/edit.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/edit.js
@@ -18,8 +18,9 @@
 
 import TableMetaRouter from './table-meta-router';
 import tabs from '../../../../../configs/edit-table-tabs';
+import UILoggerMixin from '../../../../../mixins/ui-logger';
 
-export default TableMetaRouter.extend({
+export default TableMetaRouter.extend(UILoggerMixin, {
 
   tableOperations: Ember.inject.service(),
 
@@ -51,12 +52,12 @@ export default TableMetaRouter.extend({
         this._modalStatus(true, 'Waiting for the table edit job to complete');
         return this.get('tableOperations').waitForJobToComplete(job.get('id'), 5 * 1000);
       }).then((status) => {
-        this._modalStatus(true, 'Successfully edited the table');
+        this._modalStatus(true, 'Successfully altered table');
+        this.get('logger').success(`Successfully altered table '${settings.table}'`);
         this._transitionToTables();
       }).catch((err) => {
-        this._modalStatus(true, 'Failed to edit table');
-        this._alertMessage('Failed to edit table', err);
-        this._transitionToTables();
+        this._modalStatus(false, 'Failed to edit table');
+        this.get('logger').danger(`Failed to  altered table '${settings.table}'`, this.extractError(err));
       });
     }
 
@@ -75,11 +76,6 @@ export default TableMetaRouter.extend({
       this.send('refreshTableInfo');
       this.transitionTo('databases.database.tables.table');
     }, 2000);
-  },
-
-  _alertMessage(message, err) {
-    console.log(message, err);
-    // TODO: user alert message here
   }
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c4cbc4f/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/rename.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/rename.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/rename.js
index cac471e..30ebfc9 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/rename.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/rename.js
@@ -16,9 +16,11 @@
  * limitations under the License.
  */
 
+import Ember from 'ember';
 import TableMetaRouter from './table-meta-router';
+import UILoggerMixin from '../../../../../mixins/ui-logger';
 
-export default TableMetaRouter.extend({
+export default TableMetaRouter.extend(UILoggerMixin, {
 
   tableOperations: Ember.inject.service(),
 
@@ -52,11 +54,11 @@ export default TableMetaRouter.extend({
       return this.get('tableOperations').waitForJobToComplete(job.get('id'), 5 * 1000);
     }).then((status) => {
       this._modalStatus(true, 'Successfully renamed table');
+      this.get('logger').success(`Successfully renamed table '${oldTableName}' to '${newTableName}'`);
       this._transitionToTables();
     }).catch((err) => {
-      this._modalStatus(true, 'Failed to rename table');
-      this._alertMessage('Failed to rename table', err);
-      this._transitionToTables();
+      this._modalStatus(false, 'Failed to rename table');
+      this.get('logger').danger(`Failed to rename table '${oldTableName}' to '${newTableName}'`, this.extractError(err));
     });
   },
 
@@ -72,11 +74,6 @@ export default TableMetaRouter.extend({
       this._modalStatus(false);
       this.transitionTo('databases');
     }, 2000);
-  },
-
-  _alertMessage(message, err) {
-    console.log(message, err);
-    // TODO: user alert message here
   }
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c4cbc4f/contrib/views/hive20/src/main/resources/ui/app/routes/jobs.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/jobs.js b/contrib/views/hive20/src/main/resources/ui/app/routes/jobs.js
index 419fd07..c27c74d 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/routes/jobs.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/routes/jobs.js
@@ -63,9 +63,6 @@ export default Ember.Route.extend({
       this.controller.set('startTime', this.get('moment').moment(startTime, 'YYYY-MM-DD').startOf('day').valueOf())
       this.controller.set('endTime', this.get('moment').moment(endTime, 'YYYY-MM-DD').endOf('day').valueOf())
       this.refresh();
-    },
-    hideDatePicker() {
-      console.log("Hiddennnnn");
     }
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c4cbc4f/contrib/views/hive20/src/main/resources/ui/app/routes/settings.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/settings.js b/contrib/views/hive20/src/main/resources/ui/app/routes/settings.js
index 1ce5116..affc126 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/routes/settings.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/routes/settings.js
@@ -17,9 +17,10 @@
  */
 
 import Ember from 'ember';
-import hiveParams from '../configs/hive-parameters'
+import hiveParams from '../configs/hive-parameters';
+import UILoggerMixin from '../mixins/ui-logger';
 
-export default Ember.Route.extend({
+export default Ember.Route.extend(UILoggerMixin, {
   model() {
     return this.store.findAll('setting').then(settings => settings.toArray());
   },
@@ -63,16 +64,15 @@ export default Ember.Route.extend({
         let model = this.get('controller.model');
         model.removeObject(data);
       }, err => {
-        console.log('error in deletion');
+        this.get('logger').danger(`Failed to delete setting with key: '${setting.get('key')}`, this.extractError(err));
       })
     },
 
     updateAction(newSetting) {
       newSetting.save().then(data => {
-        console.log('saved', data);
         data.set('editMode', false);
       }, error => {
-        console.log('error', err);
+        this.get('logger').danger(`Failed to update setting with key: '${setting.get('key')}`, this.extractError(error));
       })
     },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c4cbc4f/contrib/views/hive20/src/main/resources/ui/app/services/alert-messages.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/services/alert-messages.js b/contrib/views/hive20/src/main/resources/ui/app/services/alert-messages.js
index ed4cff1..a05fc7a 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/services/alert-messages.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/services/alert-messages.js
@@ -69,6 +69,10 @@ export default Ember.Service.extend({
     this._processMessage('danger', message, options, alertOptions);
   },
 
+  error: function() {
+    this.danger(...arguments);
+  },
+
   clearMessages: function() {
     this.get('flashMessages').clearMessages();
   },
@@ -82,13 +86,13 @@ export default Ember.Service.extend({
     }
     switch (type) {
       case 'success':
-        this.get('flashMessages').success(message, this._getOptions(alertOptions));
+        this.get('flashMessages').success(message, this._getOptions(Ember.merge(alertOptions, {sticky: false})));
         break;
       case 'warn':
-        this.get('flashMessages').warning(message, this._getOptions(alertOptions));
+        this.get('flashMessages').warning(message, this._getOptions(Ember.merge(alertOptions, {sticky: false})));
         break;
       case 'info':
-        this.get('flashMessages').info(message, this._getOptions(alertOptions));
+        this.get('flashMessages').info(message, this._getOptions(Ember.merge(alertOptions, {sticky: false})));
         break;
       case 'danger':
         this.get('flashMessages').danger(message, this._getOptions(alertOptions));
@@ -126,7 +130,8 @@ export default Ember.Service.extend({
     var defaultOptions = {
       priority: 100,
       showProgress: true,
-      timeout: 6000
+      timeout: 6000,
+      sticky: true
     };
     return Ember.merge(defaultOptions, options);
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c4cbc4f/contrib/views/hive20/src/main/resources/ui/app/templates/databases-loading.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/databases-loading.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/databases-loading.hbs
new file mode 100644
index 0000000..d0592ed
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/databases-loading.hbs
@@ -0,0 +1,21 @@
+{{!
+* 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.
+}}
+
+<div class="alert alert-info text-center">
+  <p class="lead">Loading Databases. Please wait. {{fa-icon "refresh" spin=true}}</p>
+</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c4cbc4f/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables-loading.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables-loading.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables-loading.hbs
new file mode 100644
index 0000000..58c36e9
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables-loading.hbs
@@ -0,0 +1,24 @@
+{{!
+* 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.
+}}
+
+<div class="alert alert-info text-center">
+  <p class="lead">Loading Tables. Please wait. {{fa-icon "refresh" spin=true}}</p>
+</div>
+
+
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c4cbc4f/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table-loading.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table-loading.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table-loading.hbs
new file mode 100644
index 0000000..536d025
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table-loading.hbs
@@ -0,0 +1,21 @@
+{{!
+* 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.
+}}
+
+<div class="alert alert-info text-center">
+  <p class="lead">Loading Table Information. Please wait. {{fa-icon "refresh" spin=true}}</p>
+</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c4cbc4f/contrib/views/hive20/src/main/resources/ui/app/templates/jobs-loading.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/jobs-loading.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/jobs-loading.hbs
new file mode 100644
index 0000000..f679709
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/jobs-loading.hbs
@@ -0,0 +1,20 @@
+{{!
+* 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.
+}}
+<div class="alert alert-info text-center">
+  <p class="lead">Loading Jobs. Please wait. {{fa-icon "refresh" spin=true}}</p>
+</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c4cbc4f/contrib/views/hive20/src/main/resources/ui/app/templates/messages.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/messages.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/messages.hbs
index b856c20..52e8d98 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/templates/messages.hbs
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/messages.hbs
@@ -17,12 +17,9 @@
 }}
 
 <div class="row">
-  <div class="col-md-12 messages-header">
-    <div class="col-md-1">
-      {{!--#link-to "files" (query-params path=currentBrowserPath) class="btn btn-primary"}}{{fa-icon "arrow-left"}} Browser{{/link-to--}}
-    </div>
-    <div class="col-md-2 col-md-offset-4 text-center">
-      <span class="messages-title">{{fa-icon "comment"}} Messages</span>
+  <div class="col-md-12 messages-header text-center">
+    <div class="alert alert-info">
+      <p class="lead">{{fa-icon "comment" size="lg" }} Notification Messages</p>
     </div>
   </div>
 </div>
@@ -30,7 +27,8 @@
   <div class={{if isExpanded "col-md-12" "col-md-4"}}>
     <div class="list-group">
       {{#each model as |message|}}
-        {{#link-to 'messages.message' message class=(alert-message-context-class message.type "list-group-item list-group-item-")}}
+        {{#link-to 'messages.message' message
+                   class=(alert-message-context-class message.type "list-group-item list-group-item-")}}
           <h4 class="list-group-item-heading wrap-message">
             {{#fa-stack}}
               {{fa-icon "circle-thin" stack=2}}
@@ -39,8 +37,6 @@
             {{{message.message}}}</h4>
           <p class="list-group-item-text wrap-message">{{shorten-text message.responseMessage shortenLength}}</p>
         {{/link-to}}
-      {{else}}
-        No messages present
       {{/each}}
     </div>
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c4cbc4f/contrib/views/hive20/src/main/resources/ui/app/templates/messages/message.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/messages/message.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/messages/message.hbs
index 0c69d58..5b82333 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/templates/messages/message.hbs
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/messages/message.hbs
@@ -27,18 +27,18 @@
   {{#if displayBody}}
     <div class="panel-body">
       {{#if showStatus}}
-        <p><strong>Server status:</strong> {{model.status}}</p>
+        <p><strong>Status:</strong> {{model.status}}</p>
         <hr/>
       {{/if}}
       {{#if model.responseMessage}}
-        {{alert-message-display title="Server Message:"
+        {{alert-message-display title="Message:"
         value=model.responseMessage
         shorten=true
         length=200}}
         <hr/>
       {{/if}}
       {{#if model.trace}}
-        {{alert-message-display title="Error trace:"
+        {{alert-message-display title="Trace:"
         value=model.trace
         shorten=true
         length=500}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c4cbc4f/contrib/views/hive20/src/main/resources/ui/app/templates/savedqueries-loading.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/savedqueries-loading.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/savedqueries-loading.hbs
new file mode 100644
index 0000000..571466b
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/savedqueries-loading.hbs
@@ -0,0 +1,21 @@
+{{!
+* 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.
+}}
+
+<div class="alert alert-info text-center">
+  <p class="lead">Loading Saved Queries. Please wait. {{fa-icon "refresh" spin=true}}</p>
+</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c4cbc4f/contrib/views/hive20/src/main/resources/ui/app/templates/settings-loading.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/settings-loading.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/settings-loading.hbs
new file mode 100644
index 0000000..253bbb1
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/settings-loading.hbs
@@ -0,0 +1,21 @@
+{{!
+* 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.
+}}
+
+<div class="alert alert-info text-center">
+  <p class="lead">Loading Settings. Please wait. {{fa-icon "refresh" spin=true}}</p>
+</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c4cbc4f/contrib/views/hive20/src/main/resources/ui/app/templates/udfs-loading.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/udfs-loading.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/udfs-loading.hbs
new file mode 100644
index 0000000..3b74db8
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/udfs-loading.hbs
@@ -0,0 +1,21 @@
+{{!
+* 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.
+}}
+
+<div class="alert alert-info text-center">
+  <p class="lead">Loading Udfs. Please wait. {{fa-icon "refresh" spin=true}}</p>
+</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c4cbc4f/contrib/views/hive20/src/main/resources/ui/config/environment.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/config/environment.js b/contrib/views/hive20/src/main/resources/ui/config/environment.js
index 3714eb9..411ee99 100644
--- a/contrib/views/hive20/src/main/resources/ui/config/environment.js
+++ b/contrib/views/hive20/src/main/resources/ui/config/environment.js
@@ -48,7 +48,7 @@ module.exports = function(environment) {
 
     // Change the value to false to prevent the service checks. This is required in development mode
     // as service checks take up time and hence increase the overall development time.
-    ENV.APP.SHOULD_PERFORM_SERVICE_CHECK = true;
+    ENV.APP.SHOULD_PERFORM_SERVICE_CHECK = false;
   }
 
   if (environment === 'test') {


[36/50] [abbrv] ambari git commit: AMBARI-19799. Optimize DB initialization for Ambari Server Unit Tests. Additional fixes 2. (mpapirkovskyy)

Posted by nc...@apache.org.
AMBARI-19799. Optimize DB initialization for Ambari Server Unit Tests. Additional fixes 2. (mpapirkovskyy)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 2d7276e2d1338bc318273ab9ce13312966d1eb7f
Parents: 4b0c93e
Author: Myroslav Papirkovskyi <mp...@hortonworks.com>
Authored: Thu Feb 2 02:03:00 2017 +0200
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Mon Feb 13 15:45:35 2017 -0500

----------------------------------------------------------------------
 .../server/controller/ControllerModule.java     | 18 ++--
 .../apache/ambari/server/H2DatabaseCleaner.java | 91 ++++++++++++++------
 .../ambari/server/orm/dao/CrudDAOTest.java      |  5 +-
 .../ambari/server/orm/dao/UpgradeDAOTest.java   | 16 ++--
 .../ComponentVersionCheckActionTest.java        | 29 +++++--
 .../upgrades/UpgradeActionTest.java             | 74 +++++++++++-----
 .../ambari/server/state/ConfigHelperTest.java   | 14 ++-
 .../state/cluster/AlertDataManagerTest.java     |  1 +
 pom.xml                                         |  4 +
 9 files changed, 175 insertions(+), 77 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2d7276e2/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
index b634a62..8646e51 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
@@ -214,14 +214,6 @@ public class ControllerModule extends AbstractModule {
     DatabaseType databaseType = configuration.getDatabaseType();
     LOG.info("Detected {} as the database type from the JDBC URL", databaseType);
 
-    // custom jdbc driver properties
-    Properties customDatabaseDriverProperties = configuration.getDatabaseCustomProperties();
-    properties.putAll(customDatabaseDriverProperties);
-
-    // custom persistence properties
-    Properties customPersistenceProperties = configuration.getPersistenceCustomProperties();
-    properties.putAll(customPersistenceProperties);
-
     switch (configuration.getPersistenceType()) {
       case IN_MEMORY:
         properties.setProperty(JDBC_URL, Configuration.JDBC_IN_MEMORY_URL);
@@ -229,7 +221,6 @@ public class ControllerModule extends AbstractModule {
         properties.setProperty(JDBC_USER, Configuration.JDBC_IN_MEMORY_USER);
         properties.setProperty(JDBC_PASSWORD, Configuration.JDBC_IN_MEMORY_PASSWORD);
         properties.setProperty(DDL_GENERATION, CREATE_ONLY);
-        properties.setProperty(DDL_GENERATION_MODE, DDL_BOTH_GENERATION);
         properties.setProperty(THROW_EXCEPTIONS, "true");
         break;
       case REMOTE:
@@ -242,6 +233,15 @@ public class ControllerModule extends AbstractModule {
         break;
     }
 
+    //allow to override values above
+    // custom jdbc driver properties
+    Properties customDatabaseDriverProperties = configuration.getDatabaseCustomProperties();
+    properties.putAll(customDatabaseDriverProperties);
+
+    // custom persistence properties
+    Properties customPersistenceProperties = configuration.getPersistenceCustomProperties();
+    properties.putAll(customPersistenceProperties);
+
     // determine the type of pool to use
     boolean isConnectionPoolingExternal = false;
     ConnectionPoolType connectionPoolType = configuration.getConnectionPoolType();

http://git-wip-us.apache.org/repos/asf/ambari/blob/2d7276e2/ambari-server/src/test/java/org/apache/ambari/server/H2DatabaseCleaner.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/H2DatabaseCleaner.java b/ambari-server/src/test/java/org/apache/ambari/server/H2DatabaseCleaner.java
index 91477eb..493e88b 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/H2DatabaseCleaner.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/H2DatabaseCleaner.java
@@ -26,6 +26,7 @@ import java.nio.file.Files;
 import java.nio.file.Paths;
 import java.sql.Connection;
 import java.sql.DriverManager;
+import java.sql.PreparedStatement;
 import java.sql.SQLException;
 import java.sql.Statement;
 import java.util.ArrayList;
@@ -39,13 +40,69 @@ import javax.persistence.metamodel.EntityType;
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.orm.DBAccessorImpl;
 import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang.StringUtils;
 
 import com.google.inject.Injector;
 import com.google.inject.persist.PersistService;
 
 public class H2DatabaseCleaner {
-  private static final String SEQ_INSERT_PREFIX = "INSERT INTO ambari_sequences";
-  private static List<String> seqInsertStatements;
+  private static final String SEQ_STATEMENT =
+      "INSERT INTO ambari_sequences(sequence_name, sequence_value) values (?, 0);";
+  private static List<String> sequenceList = new ArrayList<>();
+
+  static {
+        sequenceList.add("extension_id_seq");
+        sequenceList.add("resource_id_seq");
+        sequenceList.add("alert_target_id_seq");
+        sequenceList.add("topology_request_id_seq");
+        sequenceList.add("setting_id_seq");
+        sequenceList.add("principal_type_id_seq");
+        sequenceList.add("group_id_seq");
+        sequenceList.add("remote_cluster_id_seq");
+        sequenceList.add("privilege_id_seq");
+        sequenceList.add("servicecomponent_history_id_seq");
+        sequenceList.add("permission_id_seq");
+        sequenceList.add("principal_id_seq");
+        sequenceList.add("repo_version_id_seq");
+        sequenceList.add("cluster_version_id_seq");
+        sequenceList.add("topology_host_task_id_seq");
+        sequenceList.add("topology_logical_task_id_seq");
+        sequenceList.add("host_id_seq");
+        sequenceList.add("servicecomponentdesiredstate_id_seq");
+        sequenceList.add("configgroup_id_seq");
+        sequenceList.add("topology_host_group_id_seq");
+        sequenceList.add("upgrade_item_id_seq");
+        sequenceList.add("requestschedule_id_seq");
+        sequenceList.add("blueprint_setting_id_seq");
+        sequenceList.add("host_version_id_seq");
+        sequenceList.add("hostcomponentstate_id_seq");
+        sequenceList.add("cluster_id_seq");
+        sequenceList.add("view_instance_id_seq");
+        sequenceList.add("resourcefilter_id_seq");
+        sequenceList.add("alert_group_id_seq");
+        sequenceList.add("link_id_seq");
+        sequenceList.add("topology_host_info_id_seq");
+        sequenceList.add("viewentity_id_seq");
+        sequenceList.add("alert_notice_id_seq");
+        sequenceList.add("user_id_seq");
+        sequenceList.add("upgrade_id_seq");
+        sequenceList.add("stack_id_seq");
+        sequenceList.add("alert_current_id_seq");
+        sequenceList.add("widget_id_seq");
+        sequenceList.add("remote_cluster_service_id_seq");
+        sequenceList.add("alert_history_id_seq");
+        sequenceList.add("config_id_seq");
+        sequenceList.add("upgrade_group_id_seq");
+        sequenceList.add("member_id_seq");
+        sequenceList.add("service_config_id_seq");
+        sequenceList.add("widget_layout_id_seq");
+        sequenceList.add("hostcomponentdesiredstate_id_seq");
+        sequenceList.add("operation_level_id_seq");
+        sequenceList.add("servicecomponent_version_id_seq");
+        sequenceList.add("host_role_command_id_seq");
+        sequenceList.add("alert_definition_id_seq");
+        sequenceList.add("resource_type_id_seq");
+  }
 
   public static void clearDatabaseAndStopPersistenceService(Injector injector) throws AmbariException, SQLException {
     clearDatabase(injector.getProvider(EntityManager.class).get());
@@ -57,34 +114,20 @@ public class H2DatabaseCleaner {
       Configuration.JDBC_IN_MEMORY_USER, Configuration.JDBC_IN_MEMORY_PASSWORD);
   }
 
-  private static List<String> collectSequenceInserts() {
-    try {
-      ArrayList<String> statementList = new ArrayList<>();
-      for (String s : Files.readAllLines(Paths.get(DEFAULT_CREATE_JDBC_FILE_NAME), Charset.defaultCharset())) {
-        if (s.startsWith(SEQ_INSERT_PREFIX)) {
-          statementList.add(s);
-        }
-      }
-      return statementList;
-    } catch (IOException e) {
-      return Collections.emptyList();
-    }
-  }
-
   //TODO all tests this method is used in should be modified to remove hardcoded IDs
   public static void resetSequences(Injector injector) {
     DBAccessorImpl dbAccessor = injector.getInstance(DBAccessorImpl.class);
     try {
       if (dbAccessor.tableExists("ambari_sequences")) {
-        if (seqInsertStatements == null) {
-          seqInsertStatements = collectSequenceInserts();
-        }
-        if (!CollectionUtils.isEmpty(seqInsertStatements)) {
-          dbAccessor.truncateTable("ambari_sequences");
-
-          for (String insert : seqInsertStatements) {
-            dbAccessor.executeUpdate(insert);
+        dbAccessor.truncateTable("ambari_sequences");
+        PreparedStatement preparedStatement = dbAccessor.getConnection().prepareStatement(SEQ_STATEMENT);
+        try {
+          for (String sequenceName : sequenceList) {
+            preparedStatement.setString(1, sequenceName);
+            preparedStatement.executeUpdate();
           }
+        } finally {
+          preparedStatement.close();
         }
 
       }

http://git-wip-us.apache.org/repos/asf/ambari/blob/2d7276e2/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/CrudDAOTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/CrudDAOTest.java b/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/CrudDAOTest.java
index af54653..f3db856 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/CrudDAOTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/CrudDAOTest.java
@@ -54,11 +54,12 @@ public class CrudDAOTest {
   @Before
   public void before() {
     injector = Guice.createInjector(new InMemoryDefaultTestModule());
-    stackDAO = injector.getInstance(StackDAO.class);
-    repositoryVersionDAO = injector.getInstance(RepositoryVersionDAO.class);
     H2DatabaseCleaner.resetSequences(injector);
     injector.getInstance(GuiceJpaInitializer.class);
 
+    stackDAO = injector.getInstance(StackDAO.class);
+    repositoryVersionDAO = injector.getInstance(RepositoryVersionDAO.class);
+
     // required to populate stacks into the database
     injector.getInstance(AmbariMetaInfo.class);
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/2d7276e2/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/UpgradeDAOTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/UpgradeDAOTest.java b/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/UpgradeDAOTest.java
index 3c5970d..dc30c6c 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/UpgradeDAOTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/UpgradeDAOTest.java
@@ -80,7 +80,7 @@ public class UpgradeDAOTest {
 
     // create upgrade entities
     UpgradeEntity entity = new UpgradeEntity();
-    entity.setClusterId(Long.valueOf(1));
+    entity.setClusterId(clusterId.longValue());
     entity.setRequestId(Long.valueOf(1));
     entity.setFromVersion("");
     entity.setToVersion("");
@@ -150,14 +150,14 @@ public class UpgradeDAOTest {
     // create upgrade entities
     RequestEntity requestEntity = new RequestEntity();
     requestEntity.setRequestId(1L);
-    requestEntity.setClusterId(1L);
+    requestEntity.setClusterId(clusterId.longValue());
     requestEntity.setStatus(HostRoleStatus.PENDING);
     requestEntity.setStages(new ArrayList<StageEntity>());
     requestDAO.create(requestEntity);
 
     UpgradeEntity entity1 = new UpgradeEntity();
     entity1.setId(11L);
-    entity1.setClusterId(1L);
+    entity1.setClusterId(clusterId.longValue());
     entity1.setDirection(Direction.UPGRADE);
     entity1.setRequestId(1L);
     entity1.setFromVersion("2.2.0.0-1234");
@@ -168,7 +168,7 @@ public class UpgradeDAOTest {
     dao.create(entity1);
     UpgradeEntity entity2 = new UpgradeEntity();
     entity2.setId(22L);
-    entity2.setClusterId(1L);
+    entity2.setClusterId(clusterId.longValue());
     entity2.setDirection(Direction.DOWNGRADE);
     entity2.setRequestId(1L);
     entity2.setFromVersion("2.3.0.0-4567");
@@ -179,7 +179,7 @@ public class UpgradeDAOTest {
     dao.create(entity2);
     UpgradeEntity entity3 = new UpgradeEntity();
     entity3.setId(33L);
-    entity3.setClusterId(1L);
+    entity3.setClusterId(clusterId.longValue());
     entity3.setDirection(Direction.UPGRADE);
     entity3.setRequestId(1L);
     entity3.setFromVersion("2.2.0.0-1234");
@@ -188,7 +188,7 @@ public class UpgradeDAOTest {
     entity3.setUpgradePackage("test-upgrade");
     entity3.setDowngradeAllowed(true);
     dao.create(entity3);
-    UpgradeEntity lastUpgradeForCluster = dao.findLastUpgradeForCluster(1, Direction.UPGRADE);
+    UpgradeEntity lastUpgradeForCluster = dao.findLastUpgradeForCluster(clusterId.longValue(), Direction.UPGRADE);
     assertNotNull(lastUpgradeForCluster);
     assertEquals(33L, (long)lastUpgradeForCluster.getId());
   }
@@ -202,14 +202,14 @@ public class UpgradeDAOTest {
   public void testUpdatableColumns() throws Exception {
     RequestEntity requestEntity = new RequestEntity();
     requestEntity.setRequestId(1L);
-    requestEntity.setClusterId(1L);
+    requestEntity.setClusterId(clusterId.longValue());
     requestEntity.setStatus(HostRoleStatus.PENDING);
     requestEntity.setStages(new ArrayList<StageEntity>());
     requestDAO.create(requestEntity);
 
     UpgradeEntity upgradeEntity = new UpgradeEntity();
     upgradeEntity.setId(11L);
-    upgradeEntity.setClusterId(1L);
+    upgradeEntity.setClusterId(clusterId.longValue());
     upgradeEntity.setDirection(Direction.UPGRADE);
     upgradeEntity.setRequestId(1L);
     upgradeEntity.setFromVersion("2.2.0.0-1234");

http://git-wip-us.apache.org/repos/asf/ambari/blob/2d7276e2/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ComponentVersionCheckActionTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ComponentVersionCheckActionTest.java b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ComponentVersionCheckActionTest.java
index 389c604..a20f0e1 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ComponentVersionCheckActionTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ComponentVersionCheckActionTest.java
@@ -64,10 +64,13 @@ import org.apache.ambari.server.state.ServiceComponentHostFactory;
 import org.apache.ambari.server.state.ServiceFactory;
 import org.apache.ambari.server.state.StackId;
 import org.apache.ambari.server.state.State;
+import org.apache.ambari.server.utils.EventBusSynchronizer;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.inject.Guice;
 import com.google.inject.Inject;
@@ -78,6 +81,9 @@ import com.google.inject.persist.UnitOfWork;
  * Tests upgrade-related server side actions
  */
 public class ComponentVersionCheckActionTest {
+  private static final Logger LOG = LoggerFactory.getLogger(ComponentVersionCheckActionTest.class);
+
+
   private static final String HDP_2_1_1_0 = "2.1.1.0-1";
   private static final String HDP_2_1_1_1 = "2.1.1.1-2";
 
@@ -120,6 +126,7 @@ public class ComponentVersionCheckActionTest {
   @Before
   public void setup() throws Exception {
     m_injector = Guice.createInjector(new InMemoryDefaultTestModule());
+    EventBusSynchronizer.synchronizeAmbariEventPublisher(m_injector);
     m_injector.getInstance(GuiceJpaInitializer.class);
     m_injector.injectMembers(this);
     m_injector.getInstance(UnitOfWork.class).begin();
@@ -185,9 +192,8 @@ public class ComponentVersionCheckActionTest {
     hostVersionDAO.create(entity);
   }
 
-  private void makeCrossStackUpgradeCluster(StackId sourceStack, String sourceRepo, StackId targetStack, String targetRepo) throws Exception {
-    String clusterName = "c1";
-    String hostName = "h1";
+  private void makeCrossStackUpgradeCluster(StackId sourceStack, String sourceRepo, StackId targetStack,
+                                            String targetRepo, String clusterName, String hostName) throws Exception {
 
     Clusters clusters = m_injector.getInstance(Clusters.class);
     clusters.addCluster(clusterName, sourceStack);
@@ -219,6 +225,16 @@ public class ComponentVersionCheckActionTest {
     c.createClusterVersion(sourceStack, sourceRepo, "admin", RepositoryVersionState.INSTALLING);
     c.transitionClusterVersion(sourceStack, sourceRepo, RepositoryVersionState.CURRENT);
 
+  }
+
+  private void createNewRepoVersion(StackId targetStack, String targetRepo, String clusterName,
+                                    String hostName) throws AmbariException {
+    Clusters clusters = m_injector.getInstance(Clusters.class);
+    StackDAO stackDAO = m_injector.getInstance(StackDAO.class);
+
+    StackEntity stackEntityTarget = stackDAO.find(targetStack.getStackName(), targetStack.getStackVersion());
+
+    Cluster c = clusters.getCluster(clusterName);
     // Create the new repo version
     String urlInfo = "[{'repositories':["
         + "{'Repositories/base_url':'http://foo1','Repositories/repo_name':'HDP','Repositories/repo_id':'" + targetRepo + "'}"
@@ -284,8 +300,10 @@ public class ComponentVersionCheckActionTest {
     StackId targetStack = HDP_22_STACK;
     String sourceRepo = HDP_2_1_1_0;
     String targetRepo = HDP_2_2_1_0;
+    String clusterName = "c1";
+    String hostName = "h1";
 
-    makeCrossStackUpgradeCluster(sourceStack, sourceRepo, targetStack, targetRepo);
+    makeCrossStackUpgradeCluster(sourceStack, sourceRepo, targetStack, targetRepo, clusterName, hostName);
 
     Clusters clusters = m_injector.getInstance(Clusters.class);
     Cluster cluster = clusters.getCluster("c1");
@@ -296,9 +314,10 @@ public class ComponentVersionCheckActionTest {
     createNewServiceComponentHost(cluster, "HDFS", "NAMENODE", "h1");
     createNewServiceComponentHost(cluster, "HDFS", "DATANODE", "h1");
 
+    createNewRepoVersion(targetStack, targetRepo, clusterName, hostName);
+
     // create some configs
     createConfigs(cluster);
-
     // setup the cluster for the upgrade across stacks
     cluster.setCurrentStackVersion(sourceStack);
     cluster.setDesiredStackVersion(targetStack);

http://git-wip-us.apache.org/repos/asf/ambari/blob/2d7276e2/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java
index 42a4ac5..bb76a71 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java
@@ -85,6 +85,7 @@ import org.apache.ambari.server.state.State;
 import org.apache.ambari.server.state.stack.UpgradePack;
 import org.apache.ambari.server.state.stack.upgrade.Direction;
 import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
+import org.apache.ambari.server.utils.EventBusSynchronizer;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
@@ -161,6 +162,7 @@ public class UpgradeActionTest {
   @Before
   public void setup() throws Exception {
     m_injector = Guice.createInjector(new InMemoryDefaultTestModule());
+    EventBusSynchronizer.synchronizeAmbariEventPublisher(m_injector);
     m_injector.getInstance(GuiceJpaInitializer.class);
     m_injector.injectMembers(this);
     m_injector.getInstance(UnitOfWork.class).begin();
@@ -275,15 +277,13 @@ public class UpgradeActionTest {
     hostVersionDAO.create(entityTarget);
   }
 
-  private void makeUpgradeCluster(StackId sourceStack, String sourceRepo, StackId targetStack, String targetRepo) throws Exception {
-    String hostName = "h1";
+  private void createUpgradeClusterAndSourceRepo(StackId sourceStack, String sourceRepo,
+                                                 String hostName) throws Exception {
 
     clusters.addCluster(clusterName, sourceStack);
 
     StackEntity stackEntitySource = stackDAO.find(sourceStack.getStackName(), sourceStack.getStackVersion());
-    StackEntity stackEntityTarget = stackDAO.find(targetStack.getStackName(), targetStack.getStackVersion());
     assertNotNull(stackEntitySource);
-    assertNotNull(stackEntityTarget);
 
     Cluster c = clusters.getCluster(clusterName);
     c.setDesiredStackVersion(sourceStack);
@@ -320,6 +320,14 @@ public class UpgradeActionTest {
     c.createClusterVersion(sourceStack, sourceRepo, "admin", RepositoryVersionState.INSTALLING);
     c.transitionClusterVersion(sourceStack, sourceRepo, RepositoryVersionState.CURRENT);
 
+  }
+
+  private void createUpgradeClusterTargetRepo(StackId targetStack, String targetRepo,
+                                              String hostName) throws AmbariException {
+    Cluster c = clusters.getCluster(clusterName);
+    StackEntity stackEntityTarget = stackDAO.find(targetStack.getStackName(), targetStack.getStackVersion());
+    assertNotNull(stackEntityTarget);
+
     // Create the new repo version
     String urlInfo = "[{'repositories':["
             + "{'Repositories/base_url':'http://foo1','Repositories/repo_name':'HDP','Repositories/repo_id':'" + targetStack.getStackId() + "'}"
@@ -354,16 +362,14 @@ public class UpgradeActionTest {
     assertEquals(RepositoryVersionState.INSTALLED, hostVersions.get(0).getState());
   }
 
-  private void makeCrossStackUpgradeCluster(StackId sourceStack, String sourceRepo, StackId targetStack, String targetRepo) throws Exception {
-    String hostName = "h1";
+  private void makeCrossStackUpgradeClusterAndSourceRepo(StackId sourceStack, String sourceRepo,
+                                                         String hostName)throws Exception {
 
     clusters.addCluster(clusterName, sourceStack);
 
     StackEntity stackEntitySource = stackDAO.find(sourceStack.getStackName(), sourceStack.getStackVersion());
-    StackEntity stackEntityTarget = stackDAO.find(targetStack.getStackName(), targetStack.getStackVersion());
 
     assertNotNull(stackEntitySource);
-    assertNotNull(stackEntityTarget);
 
     Cluster c = clusters.getCluster(clusterName);
     c.setCurrentStackVersion(sourceStack);
@@ -384,11 +390,18 @@ public class UpgradeActionTest {
     m_helper.getOrCreateRepositoryVersion(sourceStack, sourceRepo);
     c.createClusterVersion(sourceStack, sourceRepo, "admin", RepositoryVersionState.INSTALLING);
     c.transitionClusterVersion(sourceStack, sourceRepo, RepositoryVersionState.CURRENT);
+  }
+
+  private void makeCrossStackUpgradeTargetRepo(StackId targetStack, String targetRepo, String hostName) throws Exception{
+    StackEntity stackEntityTarget = stackDAO.find(targetStack.getStackName(), targetStack.getStackVersion());
+    assertNotNull(stackEntityTarget);
+    Cluster c = clusters.getCluster(clusterName);
+
 
     // Create the new repo version
     String urlInfo = "[{'repositories':["
-            + "{'Repositories/base_url':'http://foo1','Repositories/repo_name':'HDP','Repositories/repo_id':'" + targetRepo + "'}"
-            + "], 'OperatingSystems/os_type':'redhat6'}]";
+        + "{'Repositories/base_url':'http://foo1','Repositories/repo_name':'HDP','Repositories/repo_id':'" + targetRepo + "'}"
+        + "], 'OperatingSystems/os_type':'redhat6'}]";
     repoVersionDAO.create(stackEntityTarget, targetRepo, String.valueOf(System.currentTimeMillis()), urlInfo);
 
     // Start upgrading the newer repo
@@ -396,7 +409,7 @@ public class UpgradeActionTest {
     c.transitionClusterVersion(targetStack, targetRepo, RepositoryVersionState.INSTALLED);
 
     c.mapHostVersions(Collections.singleton(hostName), c.getCurrentClusterVersion(),
-            RepositoryVersionState.CURRENT);
+        RepositoryVersionState.CURRENT);
 
     HostDAO hostDAO = m_injector.getInstance(HostDAO.class);
 
@@ -418,6 +431,7 @@ public class UpgradeActionTest {
     StackId targetStack = HDP_22_STACK;
     String sourceRepo = HDP_2_1_1_0;
     String targetRepo = HDP_2_2_0_1;
+    String hostName = "h1";
 
     // Must be a NON_ROLLING upgrade that jumps stacks in order for it to apply config changes.
     // That upgrade pack has changes for ZK and NameNode.
@@ -426,10 +440,8 @@ public class UpgradeActionTest {
     Map<String, UpgradePack> packs = ambariMetaInfo.getUpgradePacks(sourceStack.getStackName(), sourceStack.getStackVersion());
     Assert.assertTrue(packs.containsKey(upgradePackName));
 
-    makeCrossStackUpgradeCluster(sourceStack, sourceRepo, targetStack, targetRepo);
-
-    RepositoryVersionEntity targetRve = repoVersionDAO.findByStackNameAndVersion("HDP", targetRepo);
-    Assert.assertNotNull(targetRve);
+    makeCrossStackUpgradeClusterAndSourceRepo(sourceStack, sourceRepo, hostName);
+//    makeCrossStackUpgradeCluster(sourceStack, sourceRepo, targetStack, targetRepo);
 
     Cluster cluster = clusters.getCluster(clusterName);
 
@@ -446,6 +458,11 @@ public class UpgradeActionTest {
     createNewServiceComponentHost(cluster, "HDFS", "NAMENODE", "h1");
     createNewServiceComponentHost(cluster, "HDFS", "DATANODE", "h1");
 
+    makeCrossStackUpgradeTargetRepo(targetStack, targetRepo, hostName);
+
+    RepositoryVersionEntity targetRve = repoVersionDAO.findByStackNameAndVersion("HDP", targetRepo);
+    Assert.assertNotNull(targetRve);
+
     // Create some configs
     createConfigs(cluster);
     Collection<Config> configs = cluster.getAllConfigs();
@@ -583,8 +600,10 @@ public class UpgradeActionTest {
     StackId targetStack = HDP_21_STACK;
     String sourceRepo = HDP_2_1_1_0;
     String targetRepo = HDP_2_1_1_1;
+    String hostName = "h1";
 
-    makeUpgradeCluster(sourceStack, sourceRepo, targetStack, targetRepo);
+    createUpgradeClusterAndSourceRepo(sourceStack, sourceRepo, hostName);
+    createUpgradeClusterTargetRepo(targetStack, targetRepo, hostName);
 
     // Verify the repo before calling Finalize
     AmbariCustomCommandExecutionHelper helper = m_injector.getInstance(AmbariCustomCommandExecutionHelper.class);
@@ -630,8 +649,10 @@ public class UpgradeActionTest {
     StackId targetStack = HDP_21_STACK;
     String sourceRepo = HDP_2_1_1_0;
     String targetRepo = HDP_2_1_1_1;
+    String hostName = "h1";
 
-    makeUpgradeCluster(sourceStack, sourceRepo, targetStack, targetRepo);
+    createUpgradeClusterAndSourceRepo(sourceStack, sourceRepo, hostName);
+    createUpgradeClusterTargetRepo(targetStack, targetRepo, hostName);
 
     // move the old version from CURRENT to INSTALLED and the new version from
     // UPGRADED to CURRENT - this will simulate what happens when a host is
@@ -696,8 +717,10 @@ public class UpgradeActionTest {
     StackId targetStack = HDP_22_STACK;
     String sourceRepo = HDP_2_1_1_0;
     String targetRepo = HDP_2_2_0_1;
+    String hostName = "h1";
 
-    makeCrossStackUpgradeCluster(sourceStack, sourceRepo, targetStack, targetRepo);
+    makeCrossStackUpgradeClusterAndSourceRepo(sourceStack, sourceRepo, hostName);
+    makeCrossStackUpgradeTargetRepo(targetStack, targetRepo, hostName);
 
     Cluster cluster = clusters.getCluster(clusterName);
 
@@ -747,10 +770,12 @@ public class UpgradeActionTest {
     StackId targetStack = HDP_22_STACK;
     String sourceRepo = HDP_2_1_1_0;
     String targetRepo = HDP_2_2_0_1;
+    String hostName = "h1";
 
-    makeCrossStackUpgradeCluster(sourceStack, sourceRepo, targetStack, targetRepo);
+    makeCrossStackUpgradeClusterAndSourceRepo(sourceStack, sourceRepo, hostName);
     Cluster cluster = clusters.getCluster(clusterName);
 
+
     // install HDFS with some components
     Service service = installService(cluster, "HDFS");
     addServiceComponent(cluster, service, "NAMENODE");
@@ -758,6 +783,8 @@ public class UpgradeActionTest {
     createNewServiceComponentHost(cluster, "HDFS", "NAMENODE", "h1");
     createNewServiceComponentHost(cluster, "HDFS", "DATANODE", "h1");
 
+    makeCrossStackUpgradeTargetRepo(targetStack, targetRepo, hostName);
+
     // create some configs
     createConfigs(cluster);
 
@@ -836,8 +863,9 @@ public class UpgradeActionTest {
     StackId targetStack = HDP_22_STACK;
     String sourceRepo = HDP_2_1_1_0;
     String targetRepo = HDP_2_2_0_1;
+    String hostName = "h1";
 
-    makeCrossStackUpgradeCluster(sourceStack, sourceRepo, targetStack, targetRepo);
+    makeCrossStackUpgradeClusterAndSourceRepo(sourceStack, sourceRepo, hostName);
 
     Cluster cluster = clusters.getCluster(clusterName);
 
@@ -847,6 +875,7 @@ public class UpgradeActionTest {
     createNewServiceComponentHost(cluster, "HDFS", "NAMENODE", "h1");
     createNewServiceComponentHost(cluster, "HDFS", "DATANODE", "h1");
 
+    makeCrossStackUpgradeTargetRepo(targetStack, targetRepo, hostName);
     // create some configs
     createConfigs(cluster);
 
@@ -915,8 +944,9 @@ public class UpgradeActionTest {
     StackId targetStack = HDP_21_STACK;
     String sourceRepo = HDP_2_1_1_0;
     String targetRepo = HDP_2_1_1_1;
+    String hostName = "h1";
 
-    makeUpgradeCluster(sourceStack, sourceRepo, targetStack, targetRepo);
+    createUpgradeClusterAndSourceRepo(sourceStack, sourceRepo, hostName);
 
     // Verify the repo before calling Finalize
     AmbariCustomCommandExecutionHelper helper = m_injector.getInstance(AmbariCustomCommandExecutionHelper.class);
@@ -930,6 +960,8 @@ public class UpgradeActionTest {
     ServiceComponentHost nnSCH = createNewServiceComponentHost(cluster, "HDFS", "NAMENODE", "h1");
     ServiceComponentHost dnSCH = createNewServiceComponentHost(cluster, "HDFS", "DATANODE", "h1");
 
+    createUpgradeClusterTargetRepo(targetStack, targetRepo, hostName);
+
     // fake their upgrade
     nnSCH.setStackVersion(nnSCH.getDesiredStackVersion());
     nnSCH.setVersion(targetRepo);

http://git-wip-us.apache.org/repos/asf/ambari/blob/2d7276e2/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java
index 5d849c9..b1c10f5 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java
@@ -58,9 +58,7 @@ import org.apache.ambari.server.state.configgroup.ConfigGroupFactory;
 import org.apache.ambari.server.state.host.HostFactory;
 import org.apache.ambari.server.state.stack.OsFamily;
 import org.junit.After;
-import org.junit.AfterClass;
 import org.junit.Before;
-import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.experimental.runners.Enclosed;
 import org.junit.runner.RunWith;
@@ -90,8 +88,8 @@ public class ConfigHelperTest {
     private static AmbariMetaInfo metaInfo;
     private static ConfigFactory configFactory;
 
-    @BeforeClass
-    public static void setup() throws Exception {
+    @Before
+    public void setup() throws Exception {
       // Set the authenticated user
       // TODO: remove this or replace the authenticated user to test authorization rules
       SecurityContextHolder.getContext().setAuthentication(TestAuthenticationFactory.createAdministrator("admin"));
@@ -222,8 +220,8 @@ public class ConfigHelperTest {
       }}, null);
     }
 
-    @AfterClass
-    public static void tearDown() throws AmbariException, SQLException {
+    @After
+    public void tearDown() throws AmbariException, SQLException {
       H2DatabaseCleaner.clearDatabaseAndStopPersistenceService(injector);
 
       // Clear the authenticated user
@@ -536,7 +534,7 @@ public class ConfigHelperTest {
               configHelper.getEffectiveDesiredTags(cluster, "h3"));
 
       Assert.assertNotNull(effectiveAttributes);
-      Assert.assertEquals(10, effectiveAttributes.size());
+      Assert.assertEquals(7, effectiveAttributes.size());
 
       Assert.assertTrue(effectiveAttributes.containsKey("global3"));
       Map<String, Map<String, String>> globalAttrs = effectiveAttributes.get("global3");
@@ -899,7 +897,7 @@ public class ConfigHelperTest {
       // set up expectations
       expect(sch.getActualConfigs()).andReturn(schReturn).times(6);
       expect(sch.getHostName()).andReturn("h1").anyTimes();
-      expect(sch.getClusterId()).andReturn(1l).anyTimes();
+      expect(sch.getClusterId()).andReturn(cluster.getClusterId()).anyTimes();
       expect(sch.getServiceName()).andReturn("FLUME").anyTimes();
       expect(sch.getServiceComponentName()).andReturn("FLUME_HANDLER").anyTimes();
       replay(sch);

http://git-wip-us.apache.org/repos/asf/ambari/blob/2d7276e2/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/AlertDataManagerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/AlertDataManagerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/AlertDataManagerTest.java
index 05aeddb..4ad93e6 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/AlertDataManagerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/AlertDataManagerTest.java
@@ -112,6 +112,7 @@ public class AlertDataManagerTest {
   @Before
   public void setup() throws Exception {
     m_injector = Guice.createInjector(new InMemoryDefaultTestModule());
+    EventBusSynchronizer.synchronizeAlertEventPublisher(m_injector);
     m_injector.getInstance(GuiceJpaInitializer.class);
     m_injector.getInstance(UnitOfWork.class).begin();
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/2d7276e2/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 3f5a884..2b0cb30 100644
--- a/pom.xml
+++ b/pom.xml
@@ -158,6 +158,10 @@
           <artifactId>maven-clean-plugin</artifactId>
           <version>2.5</version>
         </plugin>
+        <plugin>
+          <artifactId>maven-assembly-plugin</artifactId>
+          <version>2.2-beta-5</version>
+        </plugin>
       </plugins>
     </pluginManagement>
     <plugins>


[39/50] [abbrv] ambari git commit: AMBARI-19855 Stack advisor issues encountered (dsen)

Posted by nc...@apache.org.
AMBARI-19855 Stack advisor issues encountered (dsen)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 4b0c93e96edc1f34b69a5c33fae22c08e94f21d2
Parents: d222f57
Author: Dmytro Sen <ds...@apache.org>
Authored: Fri Feb 3 17:14:17 2017 +0200
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Mon Feb 13 15:45:35 2017 -0500

----------------------------------------------------------------------
 .../common-services/YARN/3.0.0.3.0/service_advisor.py        | 8 ++++----
 .../main/resources/stacks/HDP/2.2/services/stack_advisor.py  | 8 ++++----
 .../resources/stacks/HDPWIN/2.2/services/stack_advisor.py    | 8 ++++----
 .../src/test/python/stacks/2.2/common/test_stack_advisor.py  | 7 ++++---
 4 files changed, 16 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4b0c93e9/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/service_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/service_advisor.py b/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/service_advisor.py
index 44bdf80..30dd474 100644
--- a/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/service_advisor.py
+++ b/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/service_advisor.py
@@ -335,10 +335,10 @@ class YARNRecommender(service_advisor.ServiceAdvisor):
     putYarnPropertyAttribute = self.putPropertyAttribute(configurations, "yarn-site")
     nodeManagerHost = self.getHostWithComponent("YARN", "NODEMANAGER", services, hosts)
     if (nodeManagerHost is not None):
-      cpuPercentageLimit = 0.8
-      if "yarn.nodemanager.resource.percentage-physical-cpu-limit" in configurations["yarn-site"]["properties"]:
-        cpuPercentageLimit = float(configurations["yarn-site"]["properties"]["yarn.nodemanager.resource.percentage-physical-cpu-limit"])
-      cpuLimit = max(1, int(floor(nodeManagerHost["Hosts"]["cpu_count"] * cpuPercentageLimit)))
+      cpuPercentageLimit = 80.0
+      if "yarn-site" in services["configurations"] and "yarn.nodemanager.resource.percentage-physical-cpu-limit" in services["configurations"]["yarn-site"]["properties"]:
+        cpuPercentageLimit = float(services["configurations"]["yarn-site"]["properties"]["yarn.nodemanager.resource.percentage-physical-cpu-limit"])
+      cpuLimit = max(1, int(floor(nodeManagerHost["Hosts"]["cpu_count"] * (cpuPercentageLimit / 100.0))))
       putYarnProperty('yarn.nodemanager.resource.cpu-vcores', str(cpuLimit))
       putYarnProperty('yarn.scheduler.maximum-allocation-vcores', configurations["yarn-site"]["properties"]["yarn.nodemanager.resource.cpu-vcores"])
       putYarnPropertyAttribute('yarn.nodemanager.resource.memory-mb', 'maximum', int(nodeManagerHost["Hosts"]["total_mem"] / 1024)) # total_mem in kb

http://git-wip-us.apache.org/repos/asf/ambari/blob/4b0c93e9/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 cba611c..421d3d4 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
@@ -141,10 +141,10 @@ class HDP22StackAdvisor(HDP21StackAdvisor):
     putYarnPropertyAttribute = self.putPropertyAttribute(configurations, "yarn-site")
     nodeManagerHost = self.getHostWithComponent("YARN", "NODEMANAGER", services, hosts)
     if (nodeManagerHost is not None):
-      cpuPercentageLimit = 0.8
-      if "yarn.nodemanager.resource.percentage-physical-cpu-limit" in configurations["yarn-site"]["properties"]:
-        cpuPercentageLimit = float(configurations["yarn-site"]["properties"]["yarn.nodemanager.resource.percentage-physical-cpu-limit"])
-      cpuLimit = max(1, int(floor(nodeManagerHost["Hosts"]["cpu_count"] * cpuPercentageLimit)))
+      cpuPercentageLimit = 80.0
+      if "yarn-site" in services["configurations"] and "yarn.nodemanager.resource.percentage-physical-cpu-limit" in services["configurations"]["yarn-site"]["properties"]:
+        cpuPercentageLimit = float(services["configurations"]["yarn-site"]["properties"]["yarn.nodemanager.resource.percentage-physical-cpu-limit"])
+      cpuLimit = max(1, int(floor(nodeManagerHost["Hosts"]["cpu_count"] * (cpuPercentageLimit / 100.0))))
       putYarnProperty('yarn.nodemanager.resource.cpu-vcores', str(cpuLimit))
       putYarnProperty('yarn.scheduler.maximum-allocation-vcores', configurations["yarn-site"]["properties"]["yarn.nodemanager.resource.cpu-vcores"])
       putYarnPropertyAttribute('yarn.nodemanager.resource.memory-mb', 'maximum', int(nodeManagerHost["Hosts"]["total_mem"] / 1024)) # total_mem in kb

http://git-wip-us.apache.org/repos/asf/ambari/blob/4b0c93e9/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 b72f046..a3d9598 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
@@ -221,10 +221,10 @@ class HDPWIN22StackAdvisor(HDPWIN21StackAdvisor):
     putYarnPropertyAttribute = self.putPropertyAttribute(configurations, "yarn-site")
     nodeManagerHost = self.getHostWithComponent("YARN", "NODEMANAGER", services, hosts)
     if (nodeManagerHost is not None):
-      cpuPercentageLimit = 0.8
-      if "yarn.nodemanager.resource.percentage-physical-cpu-limit" in configurations["yarn-site"]["properties"]:
-        cpuPercentageLimit = float(configurations["yarn-site"]["properties"]["yarn.nodemanager.resource.percentage-physical-cpu-limit"])
-      cpuLimit = max(1, int(math.floor(nodeManagerHost["Hosts"]["cpu_count"] * cpuPercentageLimit)))
+      cpuPercentageLimit = 80.0
+      if "yarn-site" in services["configurations"] and "yarn.nodemanager.resource.percentage-physical-cpu-limit" in services["configurations"]["yarn-site"]["properties"]:
+        cpuPercentageLimit = float(services["configurations"]["yarn-site"]["properties"]["yarn.nodemanager.resource.percentage-physical-cpu-limit"])
+      cpuLimit = max(1, int(floor(nodeManagerHost["Hosts"]["cpu_count"] * (cpuPercentageLimit / 100.0))))
       putYarnProperty('yarn.nodemanager.resource.cpu-vcores', str(cpuLimit))
       putYarnProperty('yarn.scheduler.maximum-allocation-vcores', configurations["yarn-site"]["properties"]["yarn.nodemanager.resource.cpu-vcores"])
       putYarnPropertyAttribute('yarn.nodemanager.resource.memory-mb', 'maximum', int(nodeManagerHost["Hosts"]["total_mem"] / 1024)) # total_mem in kb

http://git-wip-us.apache.org/repos/asf/ambari/blob/4b0c93e9/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
index a26b661..0c7af1a 100644
--- a/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
@@ -1152,7 +1152,7 @@ class TestHDP22StackAdvisor(TestCase):
 
     # Test host NodeManager CPU cores and 'yarn.nodemanager.resource.percentage-physical-cpu-limit'
     hosts["items"][2]["Hosts"]["cpu_count"] = 10
-    configurations["yarn-site"]["properties"]["yarn.nodemanager.resource.percentage-physical-cpu-limit"] = '0.5'
+    services["configurations"]["yarn-site"]["properties"]["yarn.nodemanager.resource.percentage-physical-cpu-limit"] = '50'
     services["changed-configurations"].append({
           "type": "yarn-site",
           "name": "yarn.nodemanager.resource.percentage-physical-cpu-limit",
@@ -1161,7 +1161,7 @@ class TestHDP22StackAdvisor(TestCase):
     expected["yarn-site"]["properties"]["yarn.nodemanager.resource.cpu-vcores"] = '5'
     expected["yarn-site"]["properties"]["yarn.scheduler.minimum-allocation-vcores"] = '1'
     expected["yarn-site"]["properties"]["yarn.scheduler.maximum-allocation-vcores"] = '5'
-    expected["yarn-site"]["properties"]["yarn.nodemanager.resource.percentage-physical-cpu-limit"] = '0.5'
+    expected["yarn-site"]["properties"]["yarn.nodemanager.resource.percentage-physical-cpu-limit"] = '50'
     expected["yarn-site"]["property_attributes"]["yarn.nodemanager.resource.cpu-vcores"]["maximum"] = '20'
     expected["yarn-site"]["property_attributes"]["yarn.scheduler.minimum-allocation-vcores"]["maximum"] = '5'
     expected["yarn-site"]["property_attributes"]["yarn.scheduler.maximum-allocation-vcores"]["maximum"] = '5'
@@ -1175,7 +1175,8 @@ class TestHDP22StackAdvisor(TestCase):
         "old_value": "1280"
     }]
     services.pop("configurations", None)
-    services["configurations"] = {"yarn-site": {"properties": {"yarn.nodemanager.resource.memory-mb": '4321'}}}
+    services["configurations"] = {"yarn-site": {"properties": {"yarn.nodemanager.resource.memory-mb": '4321',
+                                                               "yarn.nodemanager.resource.percentage-physical-cpu-limit" : '50'}}}
 
     expected["yarn-site"]["properties"]["yarn.nodemanager.resource.memory-mb"] = '4321'
     expected["yarn-site"]["properties"]["yarn.scheduler.maximum-allocation-mb"] = '4321'


[38/50] [abbrv] ambari git commit: AMBARI-19844. Hive View 2.0: Allow user to rename table.(dipayanb)

Posted by nc...@apache.org.
AMBARI-19844. Hive View 2.0: Allow user to rename table.(dipayanb)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 309d9fd4cf14a4d06a9bbd94925d6e4626963500
Parents: 60c3539
Author: Dipayan Bhowmick <di...@gmail.com>
Authored: Mon Feb 6 11:43:04 2017 +0530
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Mon Feb 13 15:45:35 2017 -0500

----------------------------------------------------------------------
 .../hive20/resources/browser/DDLService.java    | 20 +++--
 .../resources/ui/app/adapters/application.js    | 33 ++++----
 .../src/main/resources/ui/app/adapters/table.js |  9 +++
 .../ui/app/components/table-rename-form.js      | 63 +++++++++++++++
 .../resources/ui/app/controllers/application.js |  5 +-
 .../hive20/src/main/resources/ui/app/router.js  |  1 +
 .../main/resources/ui/app/routes/application.js |  3 +-
 .../databases/database/tables/table/rename.js   | 83 ++++++++++++++++++++
 .../ui/app/services/table-operations.js         | 11 +++
 .../templates/components/table-rename-form.hbs  | 31 ++++++++
 .../databases/database/tables/table.hbs         |  1 +
 .../databases/database/tables/table/rename.hbs  | 46 +++++++++++
 .../src/main/resources/ui/config/environment.js |  6 ++
 13 files changed, 290 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/309d9fd4/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java
index af8e1cd..89b9d84 100644
--- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java
+++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java
@@ -158,18 +158,17 @@ public class DDLService extends BaseService {
   @PUT
   @Path("databases/{database_id}/tables/{table_id}/rename")
   @Produces(MediaType.APPLICATION_JSON)
-  @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
+  @Consumes(MediaType.APPLICATION_JSON)
   public Response renameTable(@PathParam("database_id") String oldDatabaseName, @PathParam("table_id") String oldTableName,
-                              @FormParam("new_database_id") String newDatabaseName, @FormParam("new_table_id")
-                                  String newTableName) {
+                              TableRenameRequest request) {
     try {
-      Job job = proxy.renameTable(oldDatabaseName, oldTableName, newDatabaseName, newTableName, getResourceManager());
+      Job job = proxy.renameTable(oldDatabaseName, oldTableName, request.newDatabase, request.newTable, getResourceManager());
       JSONObject response = new JSONObject();
       response.put("job", job);
       return Response.status(Response.Status.ACCEPTED).entity(response).build();
     } catch (ServiceException e) {
       LOG.error("Exception occurred while renaming table for oldDatabaseName {}, oldTableName: {}, newDatabaseName : {}," +
-        " newTableName : {}", oldDatabaseName, oldTableName, newDatabaseName, newTableName, e);
+        " newTableName : {}", oldDatabaseName, oldTableName, request.newDatabase, request.newTable, e);
       throw new ServiceFormattedException(e);
     }
   }
@@ -346,4 +345,15 @@ public class DDLService extends BaseService {
   public static class CreateDatabaseRequest {
     public String name;
   }
+
+  /**
+   * Wrapper class for table rename request
+   */
+  public static class TableRenameRequest {
+    /* New database name */
+    public String newDatabase;
+
+    /* New table name */
+    public String newTable;
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/309d9fd4/contrib/views/hive20/src/main/resources/ui/app/adapters/application.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/adapters/application.js b/contrib/views/hive20/src/main/resources/ui/app/adapters/application.js
index 1cdab9e..9cc8658 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/adapters/application.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/adapters/application.js
@@ -21,14 +21,14 @@ import DS from 'ember-data';
 import ENV from 'ui/config/environment';
 
 export default DS.RESTAdapter.extend({
-  init: function() {
+  init: function () {
     Ember.$.ajaxSetup({
       cache: false
     });
   },
 
-  namespace: Ember.computed(function() {
-    var parts = window.location.pathname.split('/').filter(function(i) {
+  namespace: Ember.computed(function () {
+    var parts = window.location.pathname.split('/').filter(function (i) {
       return i !== "";
     });
     var view = parts[parts.length - 3];
@@ -39,19 +39,19 @@ export default DS.RESTAdapter.extend({
       instance = parts[parts.length - 2];
       version = '';
     }
-    if(ENV.environment === 'development') {
+    if (ENV.environment === 'development') {
       return 'resources';
     }
     return 'api/v1/views/' + view + version + '/instances/' + instance + '/resources';
   }),
 
-  headers: Ember.computed(function() {
+  headers: Ember.computed(function () {
     let headers = {
       'X-Requested-By': 'ambari',
       'Content-Type': 'application/json'
     };
 
-    if(ENV.environment === 'development') {
+    if (ENV.environment === 'development') {
       // In development mode when the UI is served using ember serve the xhr requests are proxied to ambari server
       // by setting the proxyurl parameter in ember serve and for ambari to authenticate the requests, it needs this
       // basic authorization. This is for default admin/admin username/password combination.
@@ -59,21 +59,24 @@ export default DS.RESTAdapter.extend({
       //headers['Authorization'] = 'Basic aGl2ZTpoaXZl';
       //headers['Authorization'] = 'Basic ZGlwYXlhbjpkaXBheWFu';
     }
-     return headers;
+    return headers;
   }),
 
   parseErrorResponse(responseText) {
     let json = this._super(responseText);
-    let error = {};
-    error.message = json.message;
-    error.trace = json.trace;
-    error.status = json.status;
+    if (Ember.isEmpty(json.errors)) {
+      let error = {};
+      error.message = json.message;
+      error.trace = json.trace;
+      error.status = json.status;
 
-    delete json.trace;
-    delete json.status;
-    delete json.message;
+      delete json.trace;
+      delete json.status;
+      delete json.message;
+
+      json.errors = error;
+    }
 
-    json.errors = error;
     return json;
   }
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/309d9fd4/contrib/views/hive20/src/main/resources/ui/app/adapters/table.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/adapters/table.js b/contrib/views/hive20/src/main/resources/ui/app/adapters/table.js
index e878899..47174e4 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/adapters/table.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/adapters/table.js
@@ -49,6 +49,15 @@ export default DDLAdapter.extend({
     return this.ajax(deletURL, 'DELETE');
   },
 
+  renameTable(database, newTableName, oldTableName) {
+    let renameUrl = this.buildURL('table', null, null, 'query', { databaseId: database, tableName: oldTableName }) + '/rename';
+    let data = {
+      newDatabase: database,
+      newTable: newTableName
+    };
+    return this.ajax(renameUrl, 'PUT', {data: data});
+  },
+
   analyseTable(databaseName, tableName, withColumns = false) {
     let analyseUrl = this.buildURL('table', null, null, 'query', { databaseId: databaseName, tableName: tableName }) +
       '/analyze' +

http://git-wip-us.apache.org/repos/asf/ambari/blob/309d9fd4/contrib/views/hive20/src/main/resources/ui/app/components/table-rename-form.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/table-rename-form.js b/contrib/views/hive20/src/main/resources/ui/app/components/table-rename-form.js
new file mode 100644
index 0000000..7640dd6
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/table-rename-form.js
@@ -0,0 +1,63 @@
+/**
+ * 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 Ember from 'ember';
+
+export default Ember.Component.extend({
+  classNames: ['form-horizontal'],
+
+  errorCleaner: Ember.observer('newTableName', function() {
+    if(this.get('error')) {
+      this.clearError();
+    }
+  }),
+
+  validate() {
+    if(Ember.isEmpty(this.get('newTableName'))) {
+      this.setError("Table name cannot be empty");
+      return false;
+    }
+    if(this.get('newTableName') === this.get('table.table')) {
+      this.setError("New table name cannot be same as the old table name");
+      return false;
+    }
+    return true;
+  },
+
+  setError(message) {
+    this.set('error', true);
+    this.set('errorMessage', message);
+  },
+
+  clearError() {
+    this.set('error');
+    this.set('errorMessage');
+  },
+
+  actions: {
+    rename() {
+      if(this.validate()) {
+        this.sendAction('rename', this.get('newTableName'));
+      }
+    },
+
+    cancel() {
+      this.sendAction('cancel');
+    }
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/309d9fd4/contrib/views/hive20/src/main/resources/ui/app/controllers/application.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/controllers/application.js b/contrib/views/hive20/src/main/resources/ui/app/controllers/application.js
index 54df442..beb97e6 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/controllers/application.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/controllers/application.js
@@ -17,9 +17,12 @@
  */
 
 import Ember from 'ember';
+import ENV from 'ui/config/environment';
 
 export default Ember.Controller.extend({
   serviceCheck: Ember.inject.service(),
 
-  serviceCheckCompleted: Ember.computed.alias('serviceCheck.transitionToApplication')
+  serviceCheckCompleted: Ember.computed('serviceCheck.transitionToApplication', function() {
+    return !ENV.APP.SHOULD_PERFORM_SERVICE_CHECK || this.get('serviceCheck.transitionToApplication');
+  })
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/309d9fd4/contrib/views/hive20/src/main/resources/ui/app/router.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/router.js b/contrib/views/hive20/src/main/resources/ui/app/router.js
index 150a3fd..34f1a66 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/router.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/router.js
@@ -39,6 +39,7 @@ Router.map(function() {
         this.route('new-database');
         this.route('new');
         this.route('table', {path: '/:name'}, function() {
+          this.route('rename');
           this.route('columns');
           this.route('partitions');
           this.route('storage');

http://git-wip-us.apache.org/repos/asf/ambari/blob/309d9fd4/contrib/views/hive20/src/main/resources/ui/app/routes/application.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/application.js b/contrib/views/hive20/src/main/resources/ui/app/routes/application.js
index 697f727..f4ceeb9 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/routes/application.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/routes/application.js
@@ -18,6 +18,7 @@
 
 import Ember from 'ember';
 import tabs from '../configs/top-level-tabs';
+import ENV from 'ui/config/environment';
 
 export default Ember.Route.extend({
   keepAlive: Ember.inject.service('keep-alive'),
@@ -28,7 +29,7 @@ export default Ember.Route.extend({
   },
 
   beforeModel() {
-    if (!this.get('serviceCheck.checkCompleted')) {
+    if (ENV.APP.SHOULD_PERFORM_SERVICE_CHECK && !this.get('serviceCheck.checkCompleted')) {
       this.transitionTo('service-check');
     }
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/309d9fd4/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/rename.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/rename.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/rename.js
new file mode 100644
index 0000000..cac471e
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/rename.js
@@ -0,0 +1,83 @@
+/**
+ * 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 TableMetaRouter from './table-meta-router';
+
+export default TableMetaRouter.extend({
+
+  tableOperations: Ember.inject.service(),
+
+  activate() {
+    let tableController = this.controllerFor('databases.database.tables.table');
+    this.set('existingTabs', tableController.get('tabs'));
+    tableController.set('tabs', []);
+  },
+
+  deactivate() {
+    let tableController = this.controllerFor('databases.database.tables.table');
+    tableController.set('tabs', this.get('existingTabs'));
+  },
+
+  actions: {
+    cancel() {
+      this.transitionTo('databases.database.tables');
+    },
+
+    rename(newTableName) {
+      let tableName = this.controller.get('table.table');
+      let databaseName = this.controller.get('table.database');
+      this._renameTo(newTableName, tableName, databaseName);
+    }
+  },
+
+  _renameTo(newTableName, oldTableName, databaseName) {
+    this._modalStatus(true, 'Submitting request to rename table');
+    this.get('tableOperations').renameTable(databaseName, newTableName, oldTableName).then((job) => {
+      this._modalStatus(true, 'Waiting for the table to be renamed');
+      return this.get('tableOperations').waitForJobToComplete(job.get('id'), 5 * 1000);
+    }).then((status) => {
+      this._modalStatus(true, 'Successfully renamed table');
+      this._transitionToTables();
+    }).catch((err) => {
+      this._modalStatus(true, 'Failed to rename table');
+      this._alertMessage('Failed to rename table', err);
+      this._transitionToTables();
+    });
+  },
+
+  _modalStatus(status, message) {
+    this.controller.set('showModal', status);
+    if(status) {
+      this.controller.set('modalMessage', message);
+    }
+  },
+
+  _transitionToTables() {
+    Ember.run.later(() => {
+      this._modalStatus(false);
+      this.transitionTo('databases');
+    }, 2000);
+  },
+
+  _alertMessage(message, err) {
+    console.log(message, err);
+    // TODO: user alert message here
+  }
+
+
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/309d9fd4/contrib/views/hive20/src/main/resources/ui/app/services/table-operations.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/services/table-operations.js b/contrib/views/hive20/src/main/resources/ui/app/services/table-operations.js
index 2a0aeed..16eba35 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/services/table-operations.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/services/table-operations.js
@@ -56,6 +56,17 @@ export default Ember.Service.extend({
     })
   },
 
+  renameTable(databaseName, newTableName, oldTableName ) {
+    return new Promise((resolve, reject) => {
+      this.get('store').adapterFor('table').renameTable(databaseName, newTableName, oldTableName).then((data) => {
+        this.get('store').pushPayload(data);
+        resolve(this.get('store').peekRecord('job', data.job.id));
+      }, (err) => {
+        reject(err);
+      });
+    })
+  },
+
   deleteDatabase(database) {
     return new Promise((resolve, reject) => {
       this.get('store').adapterFor('database').deleteDatabase(database.get('name')).then((data) => {

http://git-wip-us.apache.org/repos/asf/ambari/blob/309d9fd4/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-rename-form.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-rename-form.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-rename-form.hbs
new file mode 100644
index 0000000..b692a9c
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-rename-form.hbs
@@ -0,0 +1,31 @@
+{{!
+* 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.
+}}
+
+<div class="form-group">
+  <label class="col-sm-4 control-label">New Table Name</label>
+  <div class="col-sm-8 {{if error 'has-error'}}">
+    {{input value=newTableName class="form-control" placeholder="Table Name"}}
+    <span class="help-block">{{errorMessage}}</span>
+  </div>
+</div>
+<div class="form-group">
+  <div class="col-sm-offset-4 col-sm-8">
+    <button type="submit" class="btn btn-warning" {{action "rename"}}>{{fa-icon "pencil-square-o"}} Rename</button>
+    <button type="submit" class="btn btn-primary" {{action "cancel"}}>{{fa-icon "times"}} Cancel</button>
+  </div>
+</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/309d9fd4/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table.hbs
index 2d1d075..e3fe400 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table.hbs
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table.hbs
@@ -26,6 +26,7 @@
         </button>
         <ul class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenu1">
           <li><a href="#" class="text-uppercase" {{action "editTable" model}}>{{fa-icon "edit"}} Edit</a></li>
+          <li>{{#link-to "databases.database.tables.table.rename" class="text-uppercase"}}{{fa-icon "edit"}} Rename{{/link-to}}</li>
           <li><a href="#" class="text-uppercase" {{action "deleteTable" model}}>{{fa-icon "trash"}} Delete</a></li>
         </ul>
       </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/309d9fd4/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table/rename.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table/rename.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table/rename.hbs
new file mode 100644
index 0000000..31da3d4
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table/rename.hbs
@@ -0,0 +1,46 @@
+{{!
+* 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.
+}}
+
+<div class="row">
+  <div class="alert alert-info">
+    <p class="lead">{{fa-icon "pencil-square-o" size=1}} Rename table <strong class="text-uppercase">{{table.table}}</strong></p>
+  </div>
+</div>
+
+<div class="row stats-section">
+  <div class="col-md-6">
+    {{table-rename-form table=table
+                        cancel="cancel"
+                        rename="rename"}}
+  </div>
+</div>
+
+{{#if showModal}}
+  {{#modal-dialog
+    translucentOverlay=true
+    container-class="modal-dialog modal-sm"}}
+    <div class="modal-content">
+      <div class="modal-header text-danger">
+        <p class="modal-title">{{fa-icon "pencil-square-o"}}&nbsp;&nbsp;&nbsp; Rename Table</p>
+      </div>
+      <div class="modal-body text-center text-primary">
+        <p>{{modalMessage}}</p>
+      </div>
+    </div><!-- /.modal-content -->
+  {{/modal-dialog}}
+{{/if}}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/309d9fd4/contrib/views/hive20/src/main/resources/ui/config/environment.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/config/environment.js b/contrib/views/hive20/src/main/resources/ui/config/environment.js
index 9efd491..e45de05 100644
--- a/contrib/views/hive20/src/main/resources/ui/config/environment.js
+++ b/contrib/views/hive20/src/main/resources/ui/config/environment.js
@@ -34,6 +34,7 @@ module.exports = function(environment) {
     APP: {
       // Here you can pass flags/options to your application instance
       // when it is created
+      SHOULD_PERFORM_SERVICE_CHECK: true
     }
   };
 
@@ -43,6 +44,11 @@ module.exports = function(environment) {
     // ENV.APP.LOG_TRANSITIONS = true;
     // ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
     // ENV.APP.LOG_VIEW_LOOKUPS = true;
+
+
+    // Change the value to false to prevent the service checks. This is required in development mode
+    // as service checks take up time and hence increase the overall development time.
+    ENV.APP.SHOULD_PERFORM_SERVICE_CHECK = true;
   }
 
   if (environment === 'test') {


[24/50] [abbrv] ambari git commit: AMBARI-19919: spark/livy (1.x) should not be configured in Zeppelin's interpreter if they are not installed (Prabhjyot Singh via r-kamath)

Posted by nc...@apache.org.
AMBARI-19919: spark/livy (1.x) should not be configured in Zeppelin's interpreter if they are not installed (Prabhjyot Singh via r-kamath)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: a9060614ffe9cd6812eb8ff9cbb6fd81572f66e2
Parents: b695bf2
Author: Renjith Kamath <re...@gmail.com>
Authored: Mon Feb 13 13:27:06 2017 +0530
Committer: Renjith Kamath <re...@gmail.com>
Committed: Mon Feb 13 13:29:00 2017 +0530

----------------------------------------------------------------------
 .../package/scripts/livy2_config_template.py    | 107 +++++++++++++++++++
 .../0.6.0.2.5/package/scripts/master.py         |  42 ++++++--
 .../0.6.0.2.5/package/scripts/params.py         |   8 ++
 3 files changed, 147 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a9060614/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/livy2_config_template.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/livy2_config_template.py b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/livy2_config_template.py
new file mode 100644
index 0000000..71d3817
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/livy2_config_template.py
@@ -0,0 +1,107 @@
+#!/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.
+
+"""
+
+template = '''
+{
+  "id": "2C8A4SZ9T_livy2",
+  "status": "READY",
+  "group": "livy",
+  "name": "livy2",
+  "properties": {
+    "zeppelin.livy.keytab": "",
+    "zeppelin.livy.spark.sql.maxResult": "1000",
+    "livy.spark.executor.instances": "",
+    "livy.spark.executor.memory": "",
+    "livy.spark.dynamicAllocation.enabled": "",
+    "livy.spark.dynamicAllocation.cachedExecutorIdleTimeout": "",
+    "livy.spark.dynamicAllocation.initialExecutors": "",
+    "zeppelin.livy.session.create_timeout": "120",
+    "livy.spark.driver.memory": "",
+    "zeppelin.livy.displayAppInfo": "false",
+    "livy.spark.jars.packages": "",
+    "livy.spark.dynamicAllocation.maxExecutors": "",
+    "zeppelin.livy.concurrentSQL": "false",
+    "zeppelin.livy.principal": "",
+    "livy.spark.executor.cores": "",
+    "zeppelin.livy.url": "http://localhost:8998",
+    "zeppelin.livy.pull_status.interval.millis": "1000",
+    "livy.spark.driver.cores": "",
+    "livy.spark.dynamicAllocation.minExecutors": ""
+  },
+  "interpreterGroup": [
+    {
+      "class": "org.apache.zeppelin.livy.LivySparkInterpreter",
+      "editor": {
+        "editOnDblClick": false,
+        "language": "scala"
+      },
+      "name": "spark",
+      "defaultInterpreter": false
+    },
+    {
+      "class": "org.apache.zeppelin.livy.LivySparkSQLInterpreter",
+      "editor": {
+        "editOnDblClick": false,
+        "language": "sql"
+      },
+      "name": "sql",
+      "defaultInterpreter": false
+    },
+    {
+      "class": "org.apache.zeppelin.livy.LivyPySparkInterpreter",
+      "editor": {
+        "editOnDblClick": false,
+        "language": "python"
+      },
+      "name": "pyspark",
+      "defaultInterpreter": false
+              },
+    {
+      "class": "org.apache.zeppelin.livy.LivyPySpark3Interpreter",
+      "editor": {
+        "editOnDblClick": false,
+        "language": "python"
+      },
+      "name": "pyspark3",
+      "defaultInterpreter": false
+    },
+    {
+      "class": "org.apache.zeppelin.livy.LivySparkRInterpreter",
+      "editor": {
+        "editOnDblClick": false,
+        "language": "r"
+      },
+      "name": "sparkr",
+      "defaultInterpreter": false
+    }
+  ],
+  "dependencies": [],
+  "option": {
+    "setPermission": false,
+    "remote": true,
+    "users": [],
+    "isExistingProcess": false,
+    "perUser": "scoped",
+    "isUserImpersonate": false,
+    "perNote": "shared",
+    "port": -1
+  }
+}
+'''

http://git-wip-us.apache.org/repos/asf/ambari/blob/a9060614/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
index 9af48e5..8a1fad6 100644
--- a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
+++ b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
@@ -289,13 +289,18 @@ class Master(Script):
     config_data = self.get_interpreter_settings()
     interpreter_settings = config_data['interpreterSettings']
 
-    if params.spark2_home:
+    if 'spark2-env' in params.config['configurations']:
       spark2_config = self.get_spark2_interpreter_config()
       config_id = spark2_config["id"]
       interpreter_settings[config_id] = spark2_config
 
-    for interpreter_setting in interpreter_settings:
-      interpreter = interpreter_settings[interpreter_setting]
+    if 'livy2-env' in params.config['configurations']:
+      livy2_config = self.get_livy2_interpreter_config()
+      config_id = livy2_config["id"]
+      interpreter_settings[config_id] = livy2_config
+
+    for setting_key in interpreter_settings.keys():
+      interpreter = interpreter_settings[setting_key]
       if interpreter['group'] == 'jdbc':
         interpreter['dependencies'] = []
         if params.hive_server_host:
@@ -328,23 +333,34 @@ class Master(Script):
                                                     params.zookeeper_znode_parent
             interpreter['dependencies'].append(
                 {"groupArtifactVersion": "org.apache.phoenix:phoenix-core:4.7.0-HBase-1.1", "local": "false"})
-      elif interpreter['group'] == 'livy' and params.livy_livyserver_host:
-        interpreter['properties']['zeppelin.livy.url'] = "http://" + params.livy_livyserver_host +\
-                                                      ":" + params.livy_livyserver_port
+      elif interpreter['group'] == 'livy' and interpreter['name'] == 'livy':
+        if params.livy_livyserver_host:
+          interpreter['properties']['zeppelin.livy.url'] = "http://" + params.livy_livyserver_host + \
+                                                           ":" + params.livy_livyserver_port
+        else:
+          del interpreter_settings[setting_key]
+
+      elif interpreter['group'] == 'livy' and interpreter['name'] == 'livy2':
+        if params.livy2_livyserver_host:
+          interpreter['properties']['zeppelin.livy.url'] = "http://" + params.livy2_livyserver_host + \
+                                                           ":" + params.livy2_livyserver_port
+        else:
+          del interpreter_settings[setting_key]
+
 
       elif interpreter['group'] == 'spark' and interpreter['name'] == 'spark':
-        if params.spark_home:
+        if 'spark-env' in params.config['configurations']:
           interpreter['properties']['master'] = "yarn-client"
           interpreter['properties']['SPARK_HOME'] = "/usr/hdp/current/spark-client/"
         else:
-          interpreter['properties']['master'] = "local[*]"
+          del interpreter_settings[setting_key]
 
       elif interpreter['group'] == 'spark' and interpreter['name'] == 'spark2':
-        if params.spark2_home:
+        if 'spark2-env' in params.config['configurations']:
           interpreter['properties']['master'] = "yarn-client"
           interpreter['properties']['SPARK_HOME'] = "/usr/hdp/current/spark2-client/"
         else:
-          interpreter['properties']['master'] = "local[*]"
+          del interpreter_settings[setting_key]
 
     self.set_interpreter_settings(config_data)
 
@@ -367,5 +383,11 @@ class Master(Script):
 
     return json.loads(spark2_config_template.template)
 
+  def get_livy2_interpreter_config(self):
+    import livy2_config_template
+    import json
+
+    return json.loads(livy2_config_template.template)
+
 if __name__ == "__main__":
   Master().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/a9060614/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/params.py b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/params.py
index 97e93fe..16a2782 100644
--- a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/params.py
@@ -161,14 +161,22 @@ spark_client_version = get_stack_version('spark-client')
 
 hbase_master_hosts = default("/clusterHostInfo/hbase_master_hosts", [])
 livy_hosts = default("/clusterHostInfo/livy_server_hosts", [])
+livy2_hosts = default("/clusterHostInfo/livy2_server_hosts", [])
 
 livy_livyserver_host = None
 livy_livyserver_port = None
+livy2_livyserver_host = None
+livy2_livyserver_port = None
 if stack_version_formatted and check_stack_feature(StackFeature.SPARK_LIVY, stack_version_formatted) and \
     len(livy_hosts) > 0:
   livy_livyserver_host = str(livy_hosts[0])
   livy_livyserver_port = config['configurations']['livy-conf']['livy.server.port']
 
+if stack_version_formatted and check_stack_feature(StackFeature.SPARK_LIVY2, stack_version_formatted) and \
+    len(livy2_hosts) > 0:
+  livy2_livyserver_host = str(livy2_hosts[0])
+  livy2_livyserver_port = config['configurations']['livy2-conf']['livy.server.port']
+
 hdfs_user = config['configurations']['hadoop-env']['hdfs_user']
 security_enabled = config['configurations']['cluster-env']['security_enabled']
 hdfs_user_keytab = config['configurations']['hadoop-env']['hdfs_user_keytab']


[18/50] [abbrv] ambari git commit: AMBARI-19968. Control Log Level for all Hive components for log4j (Madhuvanthi Radhakrishnan via smohanty)

Posted by nc...@apache.org.
AMBARI-19968. Control Log Level for all Hive components for log4j (Madhuvanthi Radhakrishnan via smohanty)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: d6e0b267a26ee5a1ca8a35b2cf682c860653eef8
Parents: 6098d34
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Fri Feb 10 22:54:27 2017 -0800
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Sat Feb 11 08:23:46 2017 -0800

----------------------------------------------------------------------
 .../ambari/server/state/theme/TabLayout.java    |  17 ++-
 .../HIVE/0.12.0.2.0/package/scripts/hive.py     |   2 +-
 .../package/scripts/hive_interactive.py         |   4 +-
 .../0.12.0.2.0/package/scripts/params_linux.py  |   1 +
 .../HIVE/configuration/beeline-log4j2.xml       |   2 +-
 .../services/HIVE/configuration/hive-env.xml    |  29 +++++
 .../HIVE/configuration/hive-exec-log4j.xml      | 114 +++++++++++++++++
 .../HIVE/configuration/hive-exec-log4j2.xml     |   2 +-
 .../services/HIVE/configuration/hive-log4j.xml  | 126 +++++++++++++++++++
 .../services/HIVE/configuration/hive-log4j2.xml |   2 +-
 .../HIVE/configuration/llap-cli-log4j2.xml      |   2 +-
 .../HIVE/configuration/llap-daemon-log4j.xml    |   2 +-
 .../HIVE/configuration/webhcat-log4j.xml        |  83 ++++++++++++
 .../HDP/2.5/services/HIVE/themes/theme.json     |  48 +++++++
 .../stacks/2.0.6/HIVE/test_hive_client.py       |   4 +-
 .../stacks/2.0.6/HIVE/test_hive_metastore.py    |   6 +-
 .../stacks/2.0.6/HIVE/test_hive_server.py       |   4 +-
 .../stacks/2.5/HIVE/test_hive_server_int.py     |  10 +-
 18 files changed, 432 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d6e0b267/ambari-server/src/main/java/org/apache/ambari/server/state/theme/TabLayout.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/TabLayout.java b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/TabLayout.java
index 0e38040..4f6cf8f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/TabLayout.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/TabLayout.java
@@ -19,15 +19,16 @@
 package org.apache.ambari.server.state.theme;
 
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
 
 import org.codehaus.jackson.annotate.JsonIgnoreProperties;
 import org.codehaus.jackson.annotate.JsonProperty;
 import org.codehaus.jackson.map.annotate.JsonSerialize;
 
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 
 @JsonSerialize(include= JsonSerialize.Inclusion.NON_NULL)
 @JsonIgnoreProperties(ignoreUnknown = true)
@@ -90,8 +91,12 @@ public class TabLayout {
         if (childSection.isRemoved()) {
           mergedSections.remove(childSection.getName());
         } else {
-          Section parentSection = mergedSections.get(childSection.getName());
-          childSection.mergeWithParent(parentSection);
+          if(mergedSections.containsKey(childSection.getName())) {
+            Section parentSection = mergedSections.get(childSection.getName());
+            childSection.mergeWithParent(parentSection);
+          }else{
+            childSection.mergeWithParent(childSection);
+          }
           mergedSections.put(childSection.getName(), childSection);
         }
       }

http://git-wip-us.apache.org/repos/asf/ambari/blob/d6e0b267/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 2a4fd30..b7b04a2 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
@@ -375,7 +375,7 @@ def fill_conf_dir(component_conf_dir):
            mode=mode_identified_for_file,
            group=params.user_group,
            owner=params.hive_user,
-           content=params.log4j_exec_props
+           content=InlineTemplate(params.log4j_exec_props)
       )
     elif (os.path.exists("{component_conf_dir}/{log4j_exec_filename}.template")):
       File(format("{component_conf_dir}/{log4j_exec_filename}"),

http://git-wip-us.apache.org/repos/asf/ambari/blob/d6e0b267/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py
index 10c2e6c..3a70fcf 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py
@@ -248,14 +248,14 @@ def hive_interactive(name=None):
          mode=mode_identified,
          group=params.user_group,
          owner=params.hive_user,
-         content=params.hive_exec_log4j2)
+         content=InlineTemplate(params.hive_exec_log4j2))
 
       beeline_log4j2_filename = 'beeline-log4j2.properties'
       File(format("{hive_server_interactive_conf_dir}/{beeline_log4j2_filename}"),
          mode=mode_identified,
          group=params.user_group,
          owner=params.hive_user,
-         content=params.beeline_log4j2)
+         content=InlineTemplate(params.beeline_log4j2))
 
       File(os.path.join(hive_server_interactive_conf_dir, "hadoop-metrics2-hiveserver2.properties"),
            owner=params.hive_user,

http://git-wip-us.apache.org/repos/asf/ambari/blob/d6e0b267/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
index 936b194..a32fbfb 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
@@ -497,6 +497,7 @@ webhcat_log_maxfilesize = default("/configurations/webhcat-log4j/webhcat_log_max
 webhcat_log_maxbackupindex = default("/configurations/webhcat-log4j/webhcat_log_maxbackupindex", 20)
 hive_log_maxfilesize = default("/configurations/hive-log4j/hive_log_maxfilesize", 256)
 hive_log_maxbackupindex = default("/configurations/hive-log4j/hive_log_maxbackupindex", 30)
+hive_log_level = default("/configurations/hive-env/hive.log.level", "INFO")
 
 #hive-log4j.properties.template
 if (('hive-log4j' in config['configurations']) and ('content' in config['configurations']['hive-log4j'])):

http://git-wip-us.apache.org/repos/asf/ambari/blob/d6e0b267/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/beeline-log4j2.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/beeline-log4j2.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/beeline-log4j2.xml
index efe9d6e..e814045 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/beeline-log4j2.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/beeline-log4j2.xml
@@ -46,7 +46,7 @@ name = BeelineLog4j2
 packages = org.apache.hadoop.hive.ql.log
 
 # list of properties
-property.hive.log.level = WARN
+property.hive.log.level = {{hive_log_level}}
 property.hive.root.logger = console
 
 # list of all appenders

http://git-wip-us.apache.org/repos/asf/ambari/blob/d6e0b267/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-env.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-env.xml
index 14e58bd..ca44bf2 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-env.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-env.xml
@@ -20,6 +20,35 @@
  */
 -->
 <configuration supports_adding_forbidden="false">
+  <property>
+    <name>hive.log.level</name>
+    <description>Hive Log level to control log4j - Options are INFO, DEBUG, WARN, ERROR</description>
+    <value>INFO</value>
+    <display-name>Hive Log Level</display-name>
+    <value-attributes>
+      <type>value-list</type>
+      <entries>
+        <entry>
+          <value>INFO</value>
+          <label>INFO (Recommended)</label>
+        </entry>
+        <entry>
+          <value>DEBUG</value>
+          <label>DEBUG (Most Verbose)</label>
+        </entry>
+        <entry>
+          <value>WARN</value>
+          <label>WARN</label>
+        </entry>
+        <entry>
+          <value>ERROR</value>
+          <label>ERROR (Least Verbose)</label>
+        </entry>
+      </entries>
+      <selection-cardinality>1</selection-cardinality>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
   <!-- hive-env.sh -->
   <property>
     <name>content</name>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d6e0b267/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-exec-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-exec-log4j.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-exec-log4j.xml
new file mode 100644
index 0000000..4d09756
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-exec-log4j.xml
@@ -0,0 +1,114 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<configuration supports_final="false" supports_adding_forbidden="false">
+  <property>
+    <name>content</name>
+    <display-name>hive-exec-log4j template</display-name>
+    <description>Custom hive-exec-log4j</description>
+    <value>
+# 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.
+
+# Define some default values that can be overridden by system properties
+
+hive.log.threshold=ALL
+hive.root.logger={{hive_log_level}},FA
+hive.log.dir=${java.io.tmpdir}/${user.name}
+hive.query.id=hadoop
+hive.log.file=${hive.query.id}.log
+
+# Define the root logger to the system property "hadoop.root.logger".
+log4j.rootLogger=${hive.root.logger}, EventCounter
+
+# Logging Threshold
+log4j.threshhold=${hive.log.threshold}
+
+#
+# File Appender
+#
+
+log4j.appender.FA=org.apache.log4j.FileAppender
+log4j.appender.FA.File=${hive.log.dir}/${hive.log.file}
+log4j.appender.FA.layout=org.apache.log4j.PatternLayout
+
+# Pattern format: Date LogLevel LoggerName LogMessage
+#log4j.appender.DRFA.layout.ConversionPattern=%d{ISO8601} %p %c: %m%n
+# Debugging Pattern format
+log4j.appender.FA.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n
+
+
+#
+# console
+# Add "console" to rootlogger above if you want to use this
+#
+
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.target=System.err
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n
+
+#custom logging levels
+#log4j.logger.xxx=DEBUG
+
+#
+# Event Counter Appender
+# Sends counts of logging messages at different severity levels to Hadoop Metrics.
+#
+log4j.appender.EventCounter=org.apache.hadoop.hive.shims.HiveEventCounter
+
+
+log4j.category.DataNucleus=ERROR,FA
+log4j.category.Datastore=ERROR,FA
+log4j.category.Datastore.Schema=ERROR,FA
+log4j.category.JPOX.Datastore=ERROR,FA
+log4j.category.JPOX.Plugin=ERROR,FA
+log4j.category.JPOX.MetaData=ERROR,FA
+log4j.category.JPOX.Query=ERROR,FA
+log4j.category.JPOX.General=ERROR,FA
+log4j.category.JPOX.Enhancer=ERROR,FA
+
+
+# Silence useless ZK logs
+log4j.logger.org.apache.zookeeper.server.NIOServerCnxn=WARN,FA
+log4j.logger.org.apache.zookeeper.ClientCnxnSocketNIO=WARN,FA
+
+    </value>
+    <value-attributes>
+      <type>content</type>
+      <show-property-name>false</show-property-name>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d6e0b267/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-exec-log4j2.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-exec-log4j2.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-exec-log4j2.xml
index 3b935f8..b96a468 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-exec-log4j2.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-exec-log4j2.xml
@@ -46,7 +46,7 @@ name = HiveExecLog4j2
 packages = org.apache.hadoop.hive.ql.log
 
 # list of properties
-property.hive.log.level = INFO
+property.hive.log.level = {{hive_log_level}}
 property.hive.root.logger = FA
 property.hive.query.id = hadoop
 property.hive.log.dir = ${sys:java.io.tmpdir}/${sys:user.name}

http://git-wip-us.apache.org/repos/asf/ambari/blob/d6e0b267/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-log4j.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-log4j.xml
new file mode 100644
index 0000000..ca0fa49
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-log4j.xml
@@ -0,0 +1,126 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<configuration supports_final="false" supports_adding_forbidden="false">
+  <property>
+    <name>content</name>
+    <display-name>hive-log4j template</display-name>
+    <description>Custom log4j.properties</description>
+    <value>
+# 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.
+
+# Define some default values that can be overridden by system properties
+hive.log.threshold=ALL
+hive.root.logger={{hive_log_level}},DRFA
+hive.log.dir=${java.io.tmpdir}/${user.name}
+hive.log.file=hive.log
+
+# Define the root logger to the system property "hadoop.root.logger".
+log4j.rootLogger=${hive.root.logger}, EventCounter
+
+# Logging Threshold
+log4j.threshold=${hive.log.threshold}
+
+#
+# Daily Rolling File Appender
+#
+# Use the PidDailyerRollingFileAppend class instead if you want to use separate log files
+# for different CLI session.
+#
+# log4j.appender.DRFA=org.apache.hadoop.hive.ql.log.PidDailyRollingFileAppender
+
+log4j.appender.DRFA=org.apache.log4j.DailyRollingFileAppender
+
+log4j.appender.DRFA.File=${hive.log.dir}/${hive.log.file}
+
+# Rollver at midnight
+log4j.appender.DRFA.DatePattern=.yyyy-MM-dd
+
+# 30-day backup
+#log4j.appender.DRFA.MaxBackupIndex= {{hive_log_maxbackupindex}}
+log4j.appender.DRFA.MaxFileSize = {{hive_log_maxfilesize}}MB
+log4j.appender.DRFA.layout=org.apache.log4j.PatternLayout
+
+
+# Pattern format: Date LogLevel LoggerName LogMessage
+#log4j.appender.DRFA.layout.ConversionPattern=%d{ISO8601} %p %c: %m%n
+# Debugging Pattern format
+log4j.appender.DRFA.layout.ConversionPattern=%d{ISO8601} %-5p [%t]: %c{2} (%F:%M(%L)) - %m%n
+
+
+#
+# console
+# Add "console" to rootlogger above if you want to use this
+#
+
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.target=System.err
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} [%t]: %p %c{2}: %m%n
+log4j.appender.console.encoding=UTF-8
+
+#custom logging levels
+#log4j.logger.xxx=DEBUG
+
+#
+# Event Counter Appender
+# Sends counts of logging messages at different severity levels to Hadoop Metrics.
+#
+log4j.appender.EventCounter=org.apache.hadoop.hive.shims.HiveEventCounter
+
+
+log4j.category.DataNucleus=ERROR,DRFA
+log4j.category.Datastore=ERROR,DRFA
+log4j.category.Datastore.Schema=ERROR,DRFA
+log4j.category.JPOX.Datastore=ERROR,DRFA
+log4j.category.JPOX.Plugin=ERROR,DRFA
+log4j.category.JPOX.MetaData=ERROR,DRFA
+log4j.category.JPOX.Query=ERROR,DRFA
+log4j.category.JPOX.General=ERROR,DRFA
+log4j.category.JPOX.Enhancer=ERROR,DRFA
+
+
+# Silence useless ZK logs
+log4j.logger.org.apache.zookeeper.server.NIOServerCnxn=WARN,DRFA
+log4j.logger.org.apache.zookeeper.ClientCnxnSocketNIO=WARN,DRFA
+
+    </value>
+    <value-attributes>
+      <type>content</type>
+      <show-property-name>false</show-property-name>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d6e0b267/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-log4j2.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-log4j2.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-log4j2.xml
index 01d556f..e6c925d 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-log4j2.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-log4j2.xml
@@ -67,7 +67,7 @@ name = HiveLog4j2
 packages = org.apache.hadoop.hive.ql.log
 
 # list of properties
-property.hive.log.level = INFO
+property.hive.log.level = {{hive_log_level}}
 property.hive.root.logger = DRFA
 property.hive.log.dir = ${sys:java.io.tmpdir}/${sys:user.name}
 property.hive.log.file = hive.log

http://git-wip-us.apache.org/repos/asf/ambari/blob/d6e0b267/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/llap-cli-log4j2.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/llap-cli-log4j2.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/llap-cli-log4j2.xml
index ff93265..a40c200 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/llap-cli-log4j2.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/llap-cli-log4j2.xml
@@ -67,7 +67,7 @@ name = LlapCliLog4j2
 packages = org.apache.hadoop.hive.ql.log
 
 # list of properties
-property.hive.log.level = INFO
+property.hive.log.level = {{hive_log_level}}
 property.hive.root.logger = console
 property.hive.log.dir = ${sys:java.io.tmpdir}/${sys:user.name}
 property.hive.log.file = llap-cli.log

http://git-wip-us.apache.org/repos/asf/ambari/blob/d6e0b267/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/llap-daemon-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/llap-daemon-log4j.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/llap-daemon-log4j.xml
index 9fe45b0..a26f7a1 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/llap-daemon-log4j.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/llap-daemon-log4j.xml
@@ -74,7 +74,7 @@ name = LlapDaemonLog4j2
 packages = org.apache.hadoop.hive.ql.log
 
 # list of properties
-property.llap.daemon.log.level = INFO
+property.llap.daemon.log.level = {{hive_log_level}}
 property.llap.daemon.root.logger = console
 property.llap.daemon.log.dir = .
 property.llap.daemon.log.file = llapdaemon.log

http://git-wip-us.apache.org/repos/asf/ambari/blob/d6e0b267/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/webhcat-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/webhcat-log4j.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/webhcat-log4j.xml
new file mode 100644
index 0000000..7295e4c
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/webhcat-log4j.xml
@@ -0,0 +1,83 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<configuration supports_final="false" supports_adding_forbidden="false">
+  <property>
+    <name>content</name>
+    <display-name>webhcat-log4j template</display-name>
+    <description>Custom webhcat-log4j.properties</description>
+    <value>
+# 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.
+
+# Define some default values that can be overridden by system properties
+webhcat.root.logger = {{hive_log_level}}, standard
+webhcat.log.dir = .
+webhcat.log.file = webhcat.log
+
+log4j.rootLogger = ${webhcat.root.logger}
+
+# Logging Threshold
+log4j.threshhold = DEBUG
+
+log4j.appender.standard  =  org.apache.log4j.DailyRollingFileAppender
+log4j.appender.standard.File = ${webhcat.log.dir}/${webhcat.log.file}
+log4j.appender.standard.MaxFileSize = {{webhcat_log_maxfilesize}}MB
+log4j.appender.standard.MaxBackupIndex = {{webhcat_log_maxbackupindex}}
+
+# Rollver at midnight
+log4j.appender.DRFA.DatePattern = .yyyy-MM-dd
+
+log4j.appender.DRFA.layout = org.apache.log4j.PatternLayout
+
+log4j.appender.standard.layout = org.apache.log4j.PatternLayout
+log4j.appender.standard.layout.conversionPattern = %-5p | %d{DATE} | %c | %m%n
+
+# Class logging settings
+log4j.logger.com.sun.jersey = DEBUG
+log4j.logger.com.sun.jersey.spi.container.servlet.WebComponent = ERROR
+log4j.logger.org.apache.hadoop = INFO
+log4j.logger.org.apache.hadoop.conf = WARN
+log4j.logger.org.apache.zookeeper = WARN
+log4j.logger.org.eclipse.jetty = INFO
+
+    </value>
+    <value-attributes>
+      <type>content</type>
+      <show-property-name>false</show-property-name>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d6e0b267/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/themes/theme.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/themes/theme.json b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/themes/theme.json
index 9caf51e..befd313 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/themes/theme.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/themes/theme.json
@@ -1,5 +1,43 @@
 {
+
   "configuration" : {
+    "layouts": [
+      {
+        "name": "default",
+        "tabs": [
+          {
+            "name": "settings",
+            "display-name": "Settings",
+            "layout": {
+              "tab-rows": 6,
+              "tab-columns": 3,
+              "sections": [
+                {
+                  "name": "misc-settings",
+                  "display-name": "Miscellaneous Settings",
+                  "row-index": "2",
+                  "column-index": "0",
+                  "row-span": "1",
+                  "column-span": "3",
+                  "section-columns": "3",
+                  "section-rows": "2",
+                  "subsections": [
+                    {
+                      "name": "misc-row1-col1",
+                      "display-name": "Log Level",
+                      "row-index": "0",
+                      "column-index": "0",
+                      "row-span": "1",
+                      "column-span": "1"
+                    }
+                  ]
+                }
+              ]
+            }
+          }
+        ]
+      }
+      ],
     "placement" : {
       "configs" : [
         {
@@ -161,6 +199,10 @@
               }
             }
           ]
+        },
+        {
+          "config": "hive-env/hive.log.level",
+          "subsection-name": "misc-row1-col1"
         }
       ]
     },
@@ -243,6 +285,12 @@
             }
           ]
         }
+      },
+      {
+        "config": "hive-env/hive.log.level",
+        "widget": {
+          "type": "combo"
+        }
       }
     ]
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/d6e0b267/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py
index d102b9d..6afc298 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py
@@ -61,7 +61,7 @@ class TestHiveClient(RMFTestCase):
         mode = 0644,
     )
     self.assertResourceCalled('File', '/usr/hdp/current/hive-client/conf/hive-exec-log4j.properties',
-        content = 'log4jproperties\nline2',
+        content = InlineTemplate('log4jproperties\nline2'),
         owner = 'hive',
         group = 'hadoop',
         mode = 0644,
@@ -141,7 +141,7 @@ class TestHiveClient(RMFTestCase):
         mode = 0644,
     )
     self.assertResourceCalled('File', '/usr/hdp/current/hive-client/conf/hive-exec-log4j.properties',
-        content = 'log4jproperties\nline2',
+        content = InlineTemplate('log4jproperties\nline2'),
         owner = 'hive',
         group = 'hadoop',
         mode = 0644,

http://git-wip-us.apache.org/repos/asf/ambari/blob/d6e0b267/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py
index 9c04acc..9486e11 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py
@@ -181,7 +181,7 @@ class TestHiveMetastore(RMFTestCase):
                               mode = 0644,
                               )
     self.assertResourceCalled('File', '/usr/hdp/current/hive-server2/conf/hive-exec-log4j.properties',
-                              content = 'log4jproperties\nline2',
+                              content = InlineTemplate('log4jproperties\nline2'),
                               owner = 'hive',
                               group = 'hadoop',
                               mode = 0644,
@@ -304,7 +304,7 @@ class TestHiveMetastore(RMFTestCase):
                               mode = 0644,
                               )
     self.assertResourceCalled('File', '/usr/hdp/current/hive-server2/conf/hive-exec-log4j.properties',
-                              content = 'log4jproperties\nline2',
+                              content = InlineTemplate('log4jproperties\nline2'),
                               owner = 'hive',
                               group = 'hadoop',
                               mode = 0644,
@@ -449,7 +449,7 @@ class TestHiveMetastore(RMFTestCase):
                               mode = 0644)
 
     self.assertResourceCalled('File', '/usr/hdp/current/hive-server2/conf/hive-exec-log4j.properties',
-      content = 'log4jproperties\nline2',
+      content = InlineTemplate('log4jproperties\nline2'),
       mode = 420,
       group = 'hadoop',
       owner = 'hive')

http://git-wip-us.apache.org/repos/asf/ambari/blob/d6e0b267/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
index 50164cf..6592590 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
@@ -357,7 +357,7 @@ class TestHiveServer(RMFTestCase):
                               mode=0644
     )
     self.assertResourceCalled('File', '/usr/hdp/current/hive-server2/conf/hive-exec-log4j.properties',
-                              content='log4jproperties\nline2',
+                              content=InlineTemplate('log4jproperties\nline2'),
                               owner='hive',
                               group='hadoop',
                               mode=0644,
@@ -565,7 +565,7 @@ class TestHiveServer(RMFTestCase):
                               mode = 0644,
     )
     self.assertResourceCalled('File', '/usr/hdp/current/hive-server2/conf/hive-exec-log4j.properties',
-                              content='log4jproperties\nline2',
+                              content=InlineTemplate('log4jproperties\nline2'),
                               owner='hive',
                               group='hadoop',
                               mode=0644,

http://git-wip-us.apache.org/repos/asf/ambari/blob/d6e0b267/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py b/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
index 281dba4..6f017bc 100644
--- a/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
+++ b/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
@@ -243,7 +243,7 @@ class TestHiveServerInteractive(RMFTestCase):
     self.assertNoMoreResources()
 
   '''
-  #restart should not call slider destroy
+  restart should not call slider destroy
   '''
   @patch("os.path.isfile")
   @patch("resource_management.libraries.functions.copy_tarball.copy_to_hdfs")
@@ -578,13 +578,13 @@ class TestHiveServerInteractive(RMFTestCase):
                                     mode=0600,
                                     )
           self.assertResourceCalled('File', os.path.join(conf_dir, 'hive-exec-log4j2.properties'),
-                                    content='con\ntent',  # Test new line
+                                    content=InlineTemplate('con\ntent'),  # Test new line
                                     owner='hive',
                                     group='hadoop',
                                     mode=0600,
                                     )
           self.assertResourceCalled('File', os.path.join(conf_dir, 'beeline-log4j2.properties'),
-                                    content='con\ntent',  # Test new line
+                                    content=InlineTemplate('con\ntent'),  # Test new line
                                     owner='hive',
                                     group='hadoop',
                                     mode=0600,
@@ -643,13 +643,13 @@ class TestHiveServerInteractive(RMFTestCase):
                                     mode=0644,
           )
           self.assertResourceCalled('File', os.path.join(conf_dir, 'hive-exec-log4j2.properties'),
-                                    content='con\ntent',  # Test new line
+                                    content=InlineTemplate('con\ntent'),  # Test new line
                                     owner='hive',
                                     group='hadoop',
                                     mode=0644,
           )
           self.assertResourceCalled('File', os.path.join(conf_dir, 'beeline-log4j2.properties'),
-                                    content='con\ntent',  # Test new line
+                                    content=InlineTemplate('con\ntent'),  # Test new line
                                     owner='hive',
                                     group='hadoop',
                                     mode=0644,


[27/50] [abbrv] ambari git commit: AMBARI-19982 Admin View: issues with Users/Groups table filters. (ababiichuk)

Posted by nc...@apache.org.
AMBARI-19982 Admin View: issues with Users/Groups table filters. (ababiichuk)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: a6445ac838cc2b54e5ee5f943d4fa22a72fc7ad3
Parents: a7eafd5
Author: ababiichuk <ab...@hortonworks.com>
Authored: Mon Feb 13 13:56:29 2017 +0200
Committer: ababiichuk <ab...@hortonworks.com>
Committed: Mon Feb 13 14:45:50 2017 +0200

----------------------------------------------------------------------
 .../controllers/clusters/UserAccessListCtrl.js  |  5 +-
 .../clusters/UserAccessListCtrl_test.js         | 90 --------------------
 2 files changed, 1 insertion(+), 94 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a6445ac8/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/clusters/UserAccessListCtrl.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/clusters/UserAccessListCtrl.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/clusters/UserAccessListCtrl.js
index 3737414..5dc6bd3 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/clusters/UserAccessListCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/clusters/UserAccessListCtrl.js
@@ -314,8 +314,6 @@ function($scope, $location, Cluster, $modal, $rootScope, $routeParams, Permissio
 
   $scope.clearFilters = function() {
     $scope.currentNameFilter = '';
-    $scope.isUserActive = true;
-    $scope.currentTypeFilter = $scope.typeFilterOptions[0];
     $scope.currentRoleFilter = $scope.roleFilterOptions[0];
     $scope.resetPagination();
   };
@@ -325,8 +323,7 @@ function($scope, $location, Cluster, $modal, $rootScope, $routeParams, Permissio
 
   $scope.$watch(
     function (scope) {
-      return Boolean(scope.currentNameFilter || (scope.currentTypeFilter && scope.currentTypeFilter.value)
-        || (scope.currentRoleFilter && scope.currentRoleFilter.value));
+      return Boolean(scope.currentNameFilter || (scope.currentRoleFilter && scope.currentRoleFilter.value));
     },
     function (newValue, oldValue, scope) {
       scope.isNotEmptyFilter = newValue;

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6445ac8/ambari-admin/src/main/resources/ui/admin-web/test/unit/controllers/clusters/UserAccessListCtrl_test.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/test/unit/controllers/clusters/UserAccessListCtrl_test.js b/ambari-admin/src/main/resources/ui/admin-web/test/unit/controllers/clusters/UserAccessListCtrl_test.js
index 42fb453..14c0975 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/test/unit/controllers/clusters/UserAccessListCtrl_test.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/test/unit/controllers/clusters/UserAccessListCtrl_test.js
@@ -77,10 +77,6 @@ describe('#Cluster', function () {
             value: 'CLUSTER.USER'
           }
         ];
-        scope.typeFilterOptions = [
-          {label: $t('common.user'), value: 'USER'},
-          {label: $t('common.group'), value: 'GROUP'}
-        ];
         scope.currentRoleFilter = scope.roleFilterOptions[1];
         scope.clearFilters();
         expect(scope.currentNameFilter).toEqual('');
@@ -98,16 +94,12 @@ describe('#Cluster', function () {
       var cases = [
         {
           currentNameFilter: '',
-          currentTypeFilter: null,
           currentRoleFilter: null,
           isNotEmptyFilter: false,
           title: 'no filters'
         },
         {
           currentNameFilter: '',
-          currentTypeFilter: {
-            value: ''
-          },
           currentRoleFilter: {
             value: ''
           },
@@ -116,9 +108,6 @@ describe('#Cluster', function () {
         },
         {
           currentNameFilter: 'a',
-          currentTypeFilter: {
-            value: ''
-          },
           currentRoleFilter: {
             value: ''
           },
@@ -127,9 +116,6 @@ describe('#Cluster', function () {
         },
         {
           currentNameFilter: '0',
-          currentTypeFilter: {
-            value: ''
-          },
           currentRoleFilter: {
             value: ''
           },
@@ -138,20 +124,6 @@ describe('#Cluster', function () {
         },
         {
           currentNameFilter: '',
-          currentTypeFilter: {
-            value: 'GROUP'
-          },
-          currentRoleFilter: {
-            value: ''
-          },
-          isNotEmptyFilter: true,
-          title: 'type filter'
-        },
-        {
-          currentNameFilter: '',
-          currentTypeFilter: {
-            value: ''
-          },
           currentRoleFilter: {
             value: 'CLUSTER.USER'
           },
@@ -160,64 +132,6 @@ describe('#Cluster', function () {
         },
         {
           currentNameFilter: 'a',
-          currentTypeFilter: {
-            value: 'GROUP'
-          },
-          currentRoleFilter: {
-            value: ''
-          },
-          isNotEmptyFilter: true,
-          title: 'name and type filters'
-        },
-        {
-          currentNameFilter: 'a',
-          currentTypeFilter: {
-            value: ''
-          },
-          currentRoleFilter: {
-            value: 'CLUSTER.USER'
-          },
-          isNotEmptyFilter: true,
-          title: 'name and role filters'
-        },
-        {
-          currentNameFilter: '0',
-          currentTypeFilter: {
-            value: 'GROUP'
-          },
-          currentRoleFilter: {
-            value: ''
-          },
-          isNotEmptyFilter: true,
-          title: 'name and type filters with "0" as string'
-        },
-        {
-          currentNameFilter: '0',
-          currentTypeFilter: {
-            value: ''
-          },
-          currentRoleFilter: {
-            value: 'CLUSTER.USER'
-          },
-          isNotEmptyFilter: true,
-          title: 'name and role filters with "0" as string'
-        },
-        {
-          currentNameFilter: '',
-          currentTypeFilter: {
-            value: 'GROUP'
-          },
-          currentRoleFilter: {
-            value: 'CLUSTER.USER'
-          },
-          isNotEmptyFilter: true,
-          title: 'type and role filters'
-        },
-        {
-          currentNameFilter: 'a',
-          currentTypeFilter: {
-            value: 'CLUSTER.USER'
-          },
           currentRoleFilter: {
             value: 'GROUP'
           },
@@ -226,9 +140,6 @@ describe('#Cluster', function () {
         },
         {
           currentNameFilter: '0',
-          currentTypeFilter: {
-            value: 'CLUSTER.USER'
-          },
           currentRoleFilter: {
             value: 'GROUP'
           },
@@ -241,7 +152,6 @@ describe('#Cluster', function () {
         it(item.title, function () {
           scope.currentNameFilter = item.currentNameFilter;
           scope.currentRoleFilter = item.currentRoleFilter;
-          scope.currentTypeFilter = item.currentTypeFilter;
           scope.$digest();
           expect(scope.isNotEmptyFilter).toEqual(item.isNotEmptyFilter);
         });


[23/50] [abbrv] ambari git commit: AMBARI-19968. Control Log Level for all Hive components for log4j - UT fix (Madhuvanthi Radhakrishnan via smohanty)

Posted by nc...@apache.org.
AMBARI-19968. Control Log Level for all Hive components for log4j - UT fix (Madhuvanthi Radhakrishnan via smohanty)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: b695bf2bfcb96b48e7896a6242d25cf786cb46df
Parents: 3a95192
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Sun Feb 12 19:10:12 2017 -0800
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Sun Feb 12 19:10:12 2017 -0800

----------------------------------------------------------------------
 .../org/apache/ambari/server/state/theme/TabLayout.java     | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b695bf2b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/TabLayout.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/TabLayout.java b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/TabLayout.java
index 4f6cf8f..98222de 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/TabLayout.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/TabLayout.java
@@ -19,16 +19,15 @@
 package org.apache.ambari.server.state.theme;
 
 
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
 
 @JsonSerialize(include= JsonSerialize.Inclusion.NON_NULL)
 @JsonIgnoreProperties(ignoreUnknown = true)


[16/50] [abbrv] ambari git commit: AMBARI-19931. HiveView2.0: DB panel shows up on Query result full screen (pallavkul)

Posted by nc...@apache.org.
AMBARI-19931. HiveView2.0: DB panel shows up on Query result full screen (pallavkul)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 77b5b16e2bd68ed18e193104b56ad0bb434ee505
Parents: 1d1253a
Author: pallavkul <pa...@gmail.com>
Authored: Sat Feb 11 17:17:12 2017 +0530
Committer: pallavkul <pa...@gmail.com>
Committed: Sat Feb 11 17:17:12 2017 +0530

----------------------------------------------------------------------
 .../resources/ui/app/routes/queries/query.js    | 43 +++++++++++++++++---
 .../src/main/resources/ui/app/services/query.js |  2 -
 .../src/main/resources/ui/app/styles/app.scss   |  1 -
 .../ui/app/templates/queries/query.hbs          |  4 +-
 4 files changed, 40 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/77b5b16e/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js b/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js
index 72682f5..88202ff 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js
@@ -24,6 +24,9 @@ export default Ember.Route.extend({
   jobs: Ember.inject.service(),
   savedQueries: Ember.inject.service(),
 
+  isQueryEdidorPaneExpanded: false,
+  isQueryResultPanelExpanded: false,
+
   beforeModel(){
     let existingWorksheets = this.store.peekAll('worksheet');
     existingWorksheets.setEach('selected', false);
@@ -161,7 +164,6 @@ export default Ember.Route.extend({
       this.get('controller.model').set('selectedDb', db);
     },
 
-
     visualExplainQuery(){
       this.get('controller').set('isVisualExplainQuery', true );
       this.send('executeQuery');
@@ -389,15 +391,46 @@ export default Ember.Route.extend({
     },
 
     expandQueryEdidorPanel(){
+
+      if(!this.get('isQueryEdidorPaneExpanded')){
+        this.set('isQueryEdidorPaneExpanded', true);
+      } else {
+        this.set('isQueryEdidorPaneExpanded', false);
+      }
       Ember.$('.query-editor-panel').toggleClass('query-editor-full-width');
       Ember.$('.database-panel').toggleClass("hide");
+
     },
 
     expandQueryResultPanel(){
-      Ember.$('.query-editor-panel').toggleClass('query-editor-full-width');
-      Ember.$('.query-editor-container').toggleClass("hide");
-      Ember.$('.database-panel').toggleClass("hide");
-      this.send('adjustPanelSize');
+
+      if(!this.get('isQueryResultPanelExpanded')){
+
+        if(!this.get('isQueryEdidorPaneExpanded')){
+          Ember.$('.query-editor-container').addClass("hide");
+          Ember.$('.database-panel').addClass("hide");
+          Ember.$('.query-editor-panel').addClass('query-editor-full-width');
+        } else {
+
+          Ember.$('.query-editor-container').addClass("hide");
+        }
+        this.set('isQueryResultPanelExpanded', true);
+
+      } else {
+
+        if(!this.get('isQueryEdidorPaneExpanded')){
+          Ember.$('.query-editor-container').removeClass("hide");
+          Ember.$('.database-panel').removeClass("hide");
+          Ember.$('.query-editor-panel').removeClass('query-editor-full-width');
+        } else {
+
+          Ember.$('.query-editor-container').removeClass("hide");
+
+        }
+        this.set('isQueryResultPanelExpanded', false);
+
+      }
+
     },
 
     adjustPanelSize(){

http://git-wip-us.apache.org/repos/asf/ambari/blob/77b5b16e/contrib/views/hive20/src/main/resources/ui/app/services/query.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/services/query.js b/contrib/views/hive20/src/main/resources/ui/app/services/query.js
index b484c74..42d4fb0 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/services/query.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/services/query.js
@@ -80,6 +80,4 @@ export default Ember.Service.extend({
     });
   }
 
-
-
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/77b5b16e/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss b/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss
index 6469b2e..a9c91c7 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss
+++ b/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss
@@ -322,7 +322,6 @@ pre {
 }
 
 .query-result-table {
-  border-top: 1px solid darken($database-search-background, 25%);
   padding-top:10px;
 }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/77b5b16e/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query.hbs
index 84992d7..5b2b5c2 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query.hbs
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query.hbs
@@ -54,12 +54,12 @@
         <div>
           <ul class="row nav nav-tabs inverse">
             <li class="editor-result-list active">
-              <a href="javascript:void(0)" class="editor-result-list-anchor" {{action 'showQueryEditorResult' }}>
+              <a href="javascript:void(0)" class="editor-result-list-anchor active" {{action 'showQueryEditorResult' }}>
                 {{fa-icon "file-text-o"}}&nbsp;&nbsp;RESULT
               </a>
             </li>
             <li class="log-list">
-              <a href="javascript:void(0)" class="log-list-anchor active" {{action 'showQueryEditorLog' }}>
+              <a href="javascript:void(0)" class="log-list-anchor" {{action 'showQueryEditorLog' }}>
                 {{fa-icon "list"}}&nbsp;&nbsp;LOG
               </a>
             </li>


[33/50] [abbrv] ambari git commit: AMBARI-19865: Ambari-server logon failure: Hadoop-common dependency on servlet-api 2.5

Posted by nc...@apache.org.
AMBARI-19865: Ambari-server logon failure: Hadoop-common dependency on servlet-api 2.5


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: ed9282759eb8b66e090e9268778e1b443d22611e
Parents: 68f3a4a
Author: Nahappan Somasundaram <ns...@hortonworks.com>
Authored: Fri Feb 3 07:57:28 2017 -0800
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Mon Feb 13 15:45:35 2017 -0500

----------------------------------------------------------------------
 ambari-server/pom.xml                        | 6 ++++++
 ambari-server/src/main/assemblies/server.xml | 4 ++++
 2 files changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ed928275/ambari-server/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index 89b734e..0508556 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -1481,6 +1481,12 @@
       <groupId>org.apache.hadoop</groupId>
       <artifactId>hadoop-common</artifactId>
       <version>${hadoop.version}</version>
+      <exclusions>
+        <exclusion>
+          <groupId>javax.servlet</groupId>
+          <artifactId>servlet-api</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
     <dependency>
       <groupId>org.eclipse.jetty</groupId>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed928275/ambari-server/src/main/assemblies/server.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/assemblies/server.xml b/ambari-server/src/main/assemblies/server.xml
index d65232c..1902384 100644
--- a/ambari-server/src/main/assemblies/server.xml
+++ b/ambari-server/src/main/assemblies/server.xml
@@ -307,6 +307,10 @@
       <outputDirectory>/var/lib/ambari-server/resources</outputDirectory>
     </file>
     <file>
+      <source>${project.build.directory}/CredentialUtil.jar</source>
+      <outputDirectory>/var/lib/ambari-server/resources</outputDirectory>
+    </file>
+    <file>
       <source>src/main/resources/APACHE-AMBARI-MIB.txt</source>
       <outputDirectory>/var/lib/ambari-server/resources</outputDirectory>
     </file>


[13/50] [abbrv] ambari git commit: AMBARI-19667. Hive View 2.0: Editor should be stretchable by dragging (pallavkul)

Posted by nc...@apache.org.
AMBARI-19667. Hive View 2.0: Editor should be stretchable by dragging (pallavkul)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: d96d209c1ad8aeefd9ab1c02fbe621c7dfd02ffa
Parents: b00cf74
Author: pallavkul <pa...@gmail.com>
Authored: Sat Feb 11 08:46:11 2017 +0530
Committer: pallavkul <pa...@gmail.com>
Committed: Sat Feb 11 08:46:11 2017 +0530

----------------------------------------------------------------------
 .../src/main/resources/ui/app/components/query-editor.js    | 8 ++++++++
 .../views/hive20/src/main/resources/ui/app/styles/app.scss  | 9 +++++++++
 contrib/views/hive20/src/main/resources/ui/bower.json       | 1 +
 .../views/hive20/src/main/resources/ui/ember-cli-build.js   | 2 ++
 4 files changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d96d209c/contrib/views/hive20/src/main/resources/ui/app/components/query-editor.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/query-editor.js b/contrib/views/hive20/src/main/resources/ui/app/components/query-editor.js
index 27d43d5..7bfe223 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/components/query-editor.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/query-editor.js
@@ -74,6 +74,14 @@ export default Ember.Component.extend({
       });
     });
 
+    this.$('.CodeMirror').resizable({
+      handles: 's',
+
+      resize: function () {
+        Ember.run.debounce(this, updateSize, 150);
+      }
+    }).find('.ui-resizable-s').addClass('grip fa fa-reorder');
+
 
   }.on('didInsertElement'),
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/d96d209c/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss b/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss
index 0dae396..1dc86d7 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss
+++ b/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss
@@ -223,6 +223,15 @@ pre {
   overflow-y: scroll;
 }
 
+.grip {
+  height: 20px;
+  border: 0 1px 1px solid #ddd;
+  background-color: #f5f5f5;
+  color: #bbb;
+  text-align: center;
+  font-size: inherit;
+}
+
 .hv-dropdown {
   position: absolute;
   .dropdown-menu {

http://git-wip-us.apache.org/repos/asf/ambari/blob/d96d209c/contrib/views/hive20/src/main/resources/ui/bower.json
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/bower.json b/contrib/views/hive20/src/main/resources/ui/bower.json
index f4d9aa0..9fa7076 100644
--- a/contrib/views/hive20/src/main/resources/ui/bower.json
+++ b/contrib/views/hive20/src/main/resources/ui/bower.json
@@ -6,6 +6,7 @@
     "ember-cli-shims": "~0.1.1",
     "ember-qunit-notifications": "0.1.0",
     "font-awesome": "~4.5.0",
+    "jquery-ui": "~1.12.1",
     "codemirror": "~5.15.0",
     "bootstrap-treeview": "~1.2.0",
     "blob": "*"

http://git-wip-us.apache.org/repos/asf/ambari/blob/d96d209c/contrib/views/hive20/src/main/resources/ui/ember-cli-build.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/ember-cli-build.js b/contrib/views/hive20/src/main/resources/ui/ember-cli-build.js
index 10e0402..d53cdac 100644
--- a/contrib/views/hive20/src/main/resources/ui/ember-cli-build.js
+++ b/contrib/views/hive20/src/main/resources/ui/ember-cli-build.js
@@ -55,6 +55,8 @@ module.exports = function(defaults) {
    app.import('bower_components/codemirror/addon/hint/show-hint.js');
    app.import('bower_components/d3/d3.js');
    app.import('bower_components/codemirror/lib/codemirror.css');
+   app.import('bower_components/jquery-ui/jquery-ui.js');
+   app.import('bower_components/jquery-ui/themes/base/jquery-ui.css');
    app.import('bower_components/codemirror/addon/hint/show-hint.css');
 
   /*


[30/50] [abbrv] ambari git commit: AMBARI-19987 Oozie start failed after enabling credential store (dsen)

Posted by nc...@apache.org.
AMBARI-19987 Oozie start failed after enabling credential store (dsen)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: d252665ce94f532b08efb9bc5f31f7b8f6cde97a
Parents: fa32fec
Author: Dmytro Sen <ds...@apache.org>
Authored: Mon Feb 13 19:42:59 2017 +0200
Committer: Dmytro Sen <ds...@apache.org>
Committed: Mon Feb 13 19:42:59 2017 +0200

----------------------------------------------------------------------
 .../ambari_agent/CustomServiceOrchestrator.py   | 12 +++++-
 .../ambari_commons/credential_store_helper.py   | 45 ++++++++++++++++++++
 .../query/render/ClusterBlueprintRenderer.java  |  8 ++--
 .../internal/ServiceResourceProvider.java       |  1 -
 .../orm/entities/ServiceDesiredStateEntity.java | 21 ---------
 .../org/apache/ambari/server/state/Service.java |  8 ----
 .../apache/ambari/server/state/ServiceImpl.java | 40 +++--------------
 .../server/upgrade/UpgradeCatalog250.java       |  5 ---
 .../main/resources/Ambari-DDL-Derby-CREATE.sql  |  1 -
 .../main/resources/Ambari-DDL-MySQL-CREATE.sql  |  1 -
 .../main/resources/Ambari-DDL-Oracle-CREATE.sql |  1 -
 .../resources/Ambari-DDL-Postgres-CREATE.sql    |  1 -
 .../resources/Ambari-DDL-SQLAnywhere-CREATE.sql |  1 -
 .../resources/Ambari-DDL-SQLServer-CREATE.sql   |  1 -
 .../0.12.0.2.0/package/scripts/params_linux.py  | 35 +++------------
 .../4.0.0.2.0/package/scripts/params_linux.py   | 20 ++++++++-
 .../server/upgrade/UpgradeCatalog250Test.java   | 12 +-----
 17 files changed, 90 insertions(+), 123 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d252665c/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
index bacda46..9f2852b 100644
--- a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
+++ b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
@@ -238,6 +238,7 @@ class CustomServiceOrchestrator():
                 value_names.append(value_name) # Gather the value_name for deletion
           if len(credentials) > 0:
             configtype_credentials[config_type] = credentials
+            logger.info("Identifying config {0} for CS: ".format(config_type))
           for value_name in value_names:
             # Remove the clear text password
             config.pop(value_name, None)
@@ -255,8 +256,11 @@ class CustomServiceOrchestrator():
     roleCommand = None
     if 'roleCommand' in commandJson:
       roleCommand = commandJson['roleCommand']
+    task_id = None
+    if 'taskId' in commandJson:
+      task_id = commandJson['taskId']
 
-    logger.info('generateJceks: roleCommand={0}'.format(roleCommand))
+    logger.info('Generating the JCEKS file: roleCommand={0} and taskId = {1}'.format(roleCommand, task_id))
 
     # Set up the variables for the external command to generate a JCEKS file
     java_home = commandJson['hostLevelParams']['java_home']
@@ -267,6 +271,12 @@ class CustomServiceOrchestrator():
 
     # Gather the password values and remove them from the configuration
     configtype_credentials = self.getConfigTypeCredentials(commandJson)
+
+    # CS is enabled but no config property is available for this command
+    if len(configtype_credentials) == 0:
+      logger.info("Credential store is enabled but no property are found that can be encrypted.")
+      commandJson['credentialStoreEnabled'] = "false"
+
     for config_type, credentials in configtype_credentials.items():
       config = commandJson['configurations'][config_type]
       file_path = os.path.join(self.getProviderDirectory(serviceName), "{0}.jceks".format(config_type))

http://git-wip-us.apache.org/repos/asf/ambari/blob/d252665c/ambari-common/src/main/python/ambari_commons/credential_store_helper.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/ambari_commons/credential_store_helper.py b/ambari-common/src/main/python/ambari_commons/credential_store_helper.py
new file mode 100644
index 0000000..914c1c7
--- /dev/null
+++ b/ambari-common/src/main/python/ambari_commons/credential_store_helper.py
@@ -0,0 +1,45 @@
+#!/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 os
+
+from resource_management.core.resources.system import File
+from resource_management.core.shell import checked_call
+from resource_management.core.source import DownloadSource
+
+credential_util_cmd = 'org.apache.ambari.server.credentialapi.CredentialUtil'
+credential_util_jar = 'CredentialUtil.jar'
+
+def get_password_from_credential_store(alias, provider_path, cs_lib_path, java_home, jdk_location):
+    # Try to download CredentialUtil.jar from ambari-server resources
+    credential_util_dir = cs_lib_path.split('*')[0] # Remove the trailing '*'
+    credential_util_path = os.path.join(credential_util_dir, credential_util_jar)
+    credential_util_url =  jdk_location + credential_util_jar
+    File(credential_util_path,
+         content = DownloadSource(credential_util_url),
+         mode = 0755,
+         )
+
+    # Execute a get command on the CredentialUtil CLI to get the password for the specified alias
+    java_bin = '{java_home}/bin/java'.format(java_home=java_home)
+    cmd = (java_bin, '-cp', cs_lib_path, credential_util_cmd, 'get', alias, '-provider', provider_path)
+    cmd_result, std_out_msg  = checked_call(cmd)
+    std_out_lines = std_out_msg.split('\n')
+    return std_out_lines[-1] # Get the last line of the output, to skip warnings if any.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/d252665c/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRenderer.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRenderer.java b/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRenderer.java
index 4091ee8..5e19a6c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRenderer.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRenderer.java
@@ -286,11 +286,9 @@ public class ClusterBlueprintRenderer extends BaseRenderer implements Renderer {
 
       //service_settings population
       property = new HashMap<>();
-      if (ServiceInfoMap.get("credential_store_supported").equals("true")) {
-        if (ServiceInfoMap.get("credential_store_enabled").equals("true")) {
-          property.put("name", ServiceInfoMap.get("service_name").toString());
-          property.put("credential_store_enabled", "true");
-        }
+      if (ServiceInfoMap.get("credential_store_enabled").equals("true")) {
+        property.put("name", ServiceInfoMap.get("service_name").toString());
+        property.put("credential_store_enabled", "true");
       }
 
       //Fetch the service Components to obtain ServiceComponentInfo

http://git-wip-us.apache.org/repos/asf/ambari/blob/d252665c/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
index 0d5c174..99a81c1 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
@@ -368,7 +368,6 @@ public class ServiceResourceProvider extends AbstractControllerResourceProvider
       AmbariMetaInfo ambariMetaInfo = getManagementController().getAmbariMetaInfo();
       ServiceInfo serviceInfo = ambariMetaInfo.getService(stackId.getStackName(),
           stackId.getStackVersion(), request.getServiceName());
-      s.setCredentialStoreSupported(serviceInfo.isCredentialStoreSupported());
       LOG.info("Service: {}, credential_store_supported from stack definition:{}", request.getServiceName(),
           serviceInfo.isCredentialStoreSupported());
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/d252665c/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceDesiredStateEntity.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceDesiredStateEntity.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceDesiredStateEntity.java
index e4401a1..885f995 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceDesiredStateEntity.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceDesiredStateEntity.java
@@ -67,9 +67,6 @@ public class ServiceDesiredStateEntity {
   @Enumerated(value = EnumType.STRING)
   private SecurityState securityState = SecurityState.UNSECURED;
 
-  @Column(name = "credential_store_supported", nullable = false, insertable = true, updatable = true)
-  private short credentialStoreSupported = 0;
-
   @Column(name = "credential_store_enabled", nullable = false, insertable = true, updatable = true)
   private short credentialStoreEnabled = 0;
 
@@ -138,24 +135,6 @@ public class ServiceDesiredStateEntity {
   }
 
   /**
-   * Gets a value indicating if credential store is supported or not.
-   *
-   * @return true or false
-   */
-  public boolean isCredentialStoreSupported() {
-    return credentialStoreSupported != 0;
-  }
-
-  /**
-   * Sets a value indicating if credential store is supported or not.
-   *
-   * @param credentialStoreSupported
-   */
-  public void setCredentialStoreSupported(boolean credentialStoreSupported) {
-    this.credentialStoreSupported = (short)((credentialStoreSupported == false) ? 0 : 1);
-  }
-
-  /**
    * Gets a value indicating if credential store use is enabled or not.
    *
    * @return true or false

http://git-wip-us.apache.org/repos/asf/ambari/blob/d252665c/ambari-server/src/main/java/org/apache/ambari/server/state/Service.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/Service.java b/ambari-server/src/main/java/org/apache/ambari/server/state/Service.java
index cf36a8b..0f425a4 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/Service.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/Service.java
@@ -110,14 +110,6 @@ public interface Service {
   boolean isCredentialStoreSupported();
 
   /**
-   * Set a true or false value specifying if this
-   * service supports credential store.
-   *
-   * @param credentialStoreSupported - true or false
-   */
-  void setCredentialStoreSupported(boolean credentialStoreSupported);
-
-  /**
    * Get a true or false value specifying whether
    * credential store use is enabled for this service.
    *

http://git-wip-us.apache.org/repos/asf/ambari/blob/d252665c/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java
index e223eed..713c189 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java
@@ -70,6 +70,7 @@ public class ServiceImpl implements Service {
   private final Cluster cluster;
   private final ConcurrentMap<String, ServiceComponent> components = new ConcurrentHashMap<>();
   private final boolean isClientOnlyService;
+  private final boolean isCredentialStoreSupported;
 
   @Inject
   private ServiceConfigDAO serviceConfigDAO;
@@ -130,6 +131,8 @@ public class ServiceImpl implements Service {
 
     isClientOnlyService = sInfo.isClientOnlyService();
 
+    isCredentialStoreSupported = sInfo.isCredentialStoreSupported();
+
     persist(serviceEntity);
   }
 
@@ -174,6 +177,7 @@ public class ServiceImpl implements Service {
     ServiceInfo sInfo = ambariMetaInfo.getService(stackId.getStackName(),
         stackId.getStackVersion(), getName());
     isClientOnlyService = sInfo.isClientOnlyService();
+    isCredentialStoreSupported = sInfo.isCredentialStoreSupported();
   }
 
   @Override
@@ -327,45 +331,11 @@ public class ServiceImpl implements Service {
    */
   @Override
   public boolean isCredentialStoreSupported() {
-    ServiceDesiredStateEntity desiredStateEntity = getServiceDesiredStateEntity();
-
-    if (desiredStateEntity != null) {
-      return desiredStateEntity.isCredentialStoreSupported();
-    } else {
-      LOG.warn("Trying to fetch a member from an entity object that may " +
-              "have been previously deleted, serviceName = " + getName());
-    }
-    return false;
+    return isCredentialStoreSupported;
   }
 
 
-  /**
-   * Set a true or false value specifying whether this
-   * service supports credential store.
-   *
-   * @param credentialStoreSupported - true or false
-   */
-  @Override
-  public void setCredentialStoreSupported(boolean credentialStoreSupported) {
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("Setting CredentialStoreEnabled of Service" + ", clusterName="
-              + cluster.getClusterName() + ", clusterId="
-              + cluster.getClusterId() + ", serviceName=" + getName()
-              + ", oldCredentialStoreSupported=" + isCredentialStoreSupported()
-              + ", newCredentialStoreSupported=" + credentialStoreSupported);
-    }
-
-    ServiceDesiredStateEntity desiredStateEntity = getServiceDesiredStateEntity();
-
-    if (desiredStateEntity != null) {
-      desiredStateEntity.setCredentialStoreSupported(credentialStoreSupported);
-      desiredStateEntity = serviceDesiredStateDAO.merge(desiredStateEntity);
 
-    } else {
-      LOG.warn("Setting a member on an entity object that may have been "
-              + "previously deleted, serviceName = " + getName());
-    }
-  }
 
   /**
    * Get a true or false value specifying whether

http://git-wip-us.apache.org/repos/asf/ambari/blob/d252665c/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
index 2082048..1f93f1f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
@@ -83,7 +83,6 @@ public class UpgradeCatalog250 extends AbstractUpgradeCatalog {
   public static final String COMPONENT_VERSION_FK_REPO_VERSION = "FK_scv_repo_version_id";
 
   protected static final String SERVICE_DESIRED_STATE_TABLE = "servicedesiredstate";
-  protected static final String CREDENTIAL_STORE_SUPPORTED_COL = "credential_store_supported";
   protected static final String CREDENTIAL_STORE_ENABLED_COL = "credential_store_enabled";
 
   protected static final String HOST_COMPONENT_DESIREDSTATE_TABLE = "hostcomponentdesiredstate";
@@ -547,12 +546,8 @@ public class UpgradeCatalog250 extends AbstractUpgradeCatalog {
    */
   private void updateServiceDesiredStateTable() throws SQLException {
     // ALTER TABLE servicedesiredstate ADD COLUMN
-    // credential_store_supported SMALLINT DEFAULT 0 NOT NULL
     // credential_store_enabled SMALLINT DEFAULT 0 NOT NULL
     dbAccessor.addColumn(SERVICE_DESIRED_STATE_TABLE,
-      new DBColumnInfo(CREDENTIAL_STORE_SUPPORTED_COL, Short.class, null, 0, false));
-
-    dbAccessor.addColumn(SERVICE_DESIRED_STATE_TABLE,
       new DBColumnInfo(CREDENTIAL_STORE_ENABLED_COL, Short.class, null, 0, false));
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/d252665c/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql
index b79c945..c7d7990 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql
@@ -262,7 +262,6 @@ CREATE TABLE servicedesiredstate (
   service_name VARCHAR(255) NOT NULL,
   maintenance_state VARCHAR(32) NOT NULL,
   security_state VARCHAR(32) NOT NULL DEFAULT 'UNSECURED',
-  credential_store_supported SMALLINT NOT NULL DEFAULT 0,
   credential_store_enabled SMALLINT NOT NULL DEFAULT 0,
   CONSTRAINT PK_servicedesiredstate PRIMARY KEY (cluster_id, service_name),
   CONSTRAINT FK_sds_desired_stack_id FOREIGN KEY (desired_stack_id) REFERENCES stack(stack_id),

http://git-wip-us.apache.org/repos/asf/ambari/blob/d252665c/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
index 1c502bc..de79328 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
@@ -272,7 +272,6 @@ CREATE TABLE servicedesiredstate (
   service_name VARCHAR(255) NOT NULL,
   maintenance_state VARCHAR(32) NOT NULL DEFAULT 'ACTIVE',
   security_state VARCHAR(32) NOT NULL DEFAULT 'UNSECURED',
-  credential_store_supported SMALLINT NOT NULL DEFAULT 0,
   credential_store_enabled SMALLINT NOT NULL DEFAULT 0,
   CONSTRAINT PK_servicedesiredstate PRIMARY KEY (cluster_id, service_name),
   CONSTRAINT FK_sds_desired_stack_id FOREIGN KEY (desired_stack_id) REFERENCES stack(stack_id),

http://git-wip-us.apache.org/repos/asf/ambari/blob/d252665c/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
index c6d4ad0..16c5864 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
@@ -252,7 +252,6 @@ CREATE TABLE servicedesiredstate (
   service_name VARCHAR2(255) NOT NULL,
   maintenance_state VARCHAR2(32) NOT NULL,
   security_state VARCHAR2(32) DEFAULT 'UNSECURED' NOT NULL,
-  credential_store_supported SMALLINT DEFAULT 0 NOT NULL,
   credential_store_enabled SMALLINT DEFAULT 0 NOT NULL,
   CONSTRAINT PK_servicedesiredstate PRIMARY KEY (cluster_id, service_name),
   CONSTRAINT FK_sds_desired_stack_id FOREIGN KEY (desired_stack_id) REFERENCES stack(stack_id),

http://git-wip-us.apache.org/repos/asf/ambari/blob/d252665c/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
index 1be87bb..91610bb 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
@@ -261,7 +261,6 @@ CREATE TABLE servicedesiredstate (
   service_name VARCHAR(255) NOT NULL,
   maintenance_state VARCHAR(32) NOT NULL,
   security_state VARCHAR(32) NOT NULL DEFAULT 'UNSECURED',
-  credential_store_supported SMALLINT NOT NULL DEFAULT 0,
   credential_store_enabled SMALLINT NOT NULL DEFAULT 0,
   CONSTRAINT PK_servicedesiredstate PRIMARY KEY (cluster_id, service_name),
   CONSTRAINT FK_sds_desired_stack_id FOREIGN KEY (desired_stack_id) REFERENCES stack(stack_id),

http://git-wip-us.apache.org/repos/asf/ambari/blob/d252665c/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
index abe48e8..aebbcb0 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
@@ -250,7 +250,6 @@ CREATE TABLE servicedesiredstate (
   service_name VARCHAR(255) NOT NULL,
   maintenance_state VARCHAR(32) NOT NULL DEFAULT 'ACTIVE',
   security_state VARCHAR(32) NOT NULL DEFAULT 'UNSECURED',
-  credential_store_supported SMALLINT NOT NULL DEFAULT 0,
   credential_store_enabled SMALLINT NOT NULL DEFAULT 0,
   CONSTRAINT PK_servicedesiredstate PRIMARY KEY (cluster_id, service_name),
   CONSTRAINT FK_sds_desired_stack_id FOREIGN KEY (desired_stack_id) REFERENCES stack(stack_id),

http://git-wip-us.apache.org/repos/asf/ambari/blob/d252665c/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
index 169a464..d3eaa6c 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
@@ -265,7 +265,6 @@ CREATE TABLE servicedesiredstate (
   service_name VARCHAR(255) NOT NULL,
   maintenance_state VARCHAR(32) NOT NULL,
   security_state VARCHAR(32) NOT NULL DEFAULT 'UNSECURED',
-  credential_store_supported SMALLINT NOT NULL DEFAULT 0,
   credential_store_enabled SMALLINT NOT NULL DEFAULT 0,
   CONSTRAINT PK_servicedesiredstate PRIMARY KEY CLUSTERED (cluster_id,service_name),
   CONSTRAINT FK_sds_desired_stack_id FOREIGN KEY (desired_stack_id) REFERENCES stack(stack_id),

http://git-wip-us.apache.org/repos/asf/ambari/blob/d252665c/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
index a32fbfb..ba610a0 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
@@ -48,9 +48,7 @@ from resource_management.libraries.functions.get_architecture import get_archite
 
 from resource_management.core.utils import PasswordString
 from resource_management.core.shell import checked_call
-from resource_management.core.logger import Logger
-from resource_management.core.resources.system import File
-from resource_management.core.source import DownloadSource
+from ambari_commons.credential_store_helper import get_password_from_credential_store
 
 # Default log4j version; put config files under /etc/hive/conf
 log4j_version = '1'
@@ -230,36 +228,15 @@ hive_jdbc_connection_url = config['configurations']['hive-site']['javax.jdo.opti
 
 jdk_location = config['hostLevelParams']['jdk_location']
 
-credential_util_cmd = 'org.apache.ambari.server.credentialapi.CredentialUtil'
-credential_util_jar = 'CredentialUtil.jar'
-
-# Gets the hive metastore password from its JCEKS provider, if available.
-def getHiveMetastorePassword():
-  passwd = ''
+if credential_store_enabled:
   if 'hadoop.security.credential.provider.path' in config['configurations']['hive-site']:
-    # Try to download CredentialUtil.jar from ambari-server resources
     cs_lib_path = config['configurations']['hive-site']['credentialStoreClassPath']
-    credential_util_dir = cs_lib_path.split('*')[0] # Remove the trailing '*'
-    credential_util_path = os.path.join(credential_util_dir, credential_util_jar)
-    credential_util_url =  jdk_location + credential_util_jar
-    File(credential_util_path,
-         content = DownloadSource(credential_util_url),
-         mode = 0644,
-    )
-
-    # Execute a get command on the CredentialUtil CLI to get the password for the specified alias
     java_home = config['hostLevelParams']['java_home']
-    java_bin = '{java_home}/bin/java'.format(java_home=java_home)
     alias = 'javax.jdo.option.ConnectionPassword'
     provider_path = config['configurations']['hive-site']['hadoop.security.credential.provider.path']
-    cmd = (java_bin, '-cp', cs_lib_path, credential_util_cmd, 'get', alias, '-provider', provider_path)
-    cmd_result, std_out_msg  = checked_call(cmd)
-    std_out_lines = std_out_msg.split('\n')
-    passwd = std_out_lines[-1] # Get the last line of the output, to skip warnings if any.
-  return passwd
-
-if credential_store_enabled:
-  hive_metastore_user_passwd = PasswordString(getHiveMetastorePassword())
+    hive_metastore_user_passwd = PasswordString(get_password_from_credential_store(alias, provider_path, cs_lib_path, java_home, jdk_location))
+  else:
+    raise Exception("hadoop.security.credential.provider.path property should be set")
 else:
   hive_metastore_user_passwd = config['configurations']['hive-site']['javax.jdo.option.ConnectionPassword']
 hive_metastore_user_passwd = unicode(hive_metastore_user_passwd) if not is_empty(hive_metastore_user_passwd) else hive_metastore_user_passwd
@@ -843,4 +820,4 @@ if enable_ranger_hive:
   if has_ranger_admin and stack_supports_ranger_audit_db and xa_audit_db_flavor.lower() == 'sqla':
     xa_audit_db_is_enabled = False
 
-# ranger hive plugin section end
\ No newline at end of file
+# ranger hive plugin section end

http://git-wip-us.apache.org/repos/asf/ambari/blob/d252665c/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params_linux.py
index eb438e7..d30a465 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params_linux.py
@@ -34,6 +34,8 @@ from resource_management.libraries.resources.hdfs_resource import HdfsResource
 from resource_management.libraries.functions.get_architecture import get_architecture
 from resource_management.libraries.functions.stack_features import get_stack_feature_version
 
+from resource_management.core.utils import PasswordString
+from ambari_commons.credential_store_helper import get_password_from_credential_store
 from urlparse import urlparse
 
 import status_params
@@ -166,6 +168,10 @@ zk_connection_string = default('/configurations/oozie-site/oozie.zookeeper.conne
 jaas_file = os.path.join(conf_dir, 'zkmigrator_jaas.conf')
 stack_supports_zk_security = check_stack_feature(StackFeature.SECURE_ZOOKEEPER, version_for_stack_feature_checks)
 
+credential_store_enabled = False
+if 'credentialStoreEnabled' in config:
+  credential_store_enabled = config['credentialStoreEnabled']
+
 if security_enabled:
   oozie_site = dict(config['configurations']['oozie-site'])
   oozie_principal_with_host = oozie_principal.replace('_HOST', hostname)
@@ -195,7 +201,19 @@ oozie_env_sh_template = config['configurations']['oozie-env']['content']
 oracle_driver_jar_name = "ojdbc6.jar"
 
 oozie_metastore_user_name = config['configurations']['oozie-site']['oozie.service.JPAService.jdbc.username']
-oozie_metastore_user_passwd = default("/configurations/oozie-site/oozie.service.JPAService.jdbc.password","")
+
+if credential_store_enabled:
+  if 'hadoop.security.credential.provider.path' in config['configurations']['oozie-site']:
+    cs_lib_path = config['configurations']['oozie-site']['credentialStoreClassPath']
+    java_home = config['hostLevelParams']['java_home']
+    alias = 'oozie.service.JPAService.jdbc.password'
+    provider_path = config['configurations']['oozie-site']['hadoop.security.credential.provider.path']
+    oozie_metastore_user_passwd = PasswordString(get_password_from_credential_store(alias, provider_path, cs_lib_path, java_home, jdk_location))
+  else:
+    raise Exception("hadoop.security.credential.provider.path property should be set")
+else:
+  oozie_metastore_user_passwd = default("/configurations/oozie-site/oozie.service.JPAService.jdbc.password","")
+
 oozie_jdbc_connection_url = default("/configurations/oozie-site/oozie.service.JPAService.jdbc.url", "")
 oozie_log_dir = config['configurations']['oozie-env']['oozie_log_dir']
 oozie_data_dir = config['configurations']['oozie-env']['oozie_data_dir']

http://git-wip-us.apache.org/repos/asf/ambari/blob/d252665c/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
index 1c742ef..cee490b 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
@@ -189,9 +189,7 @@ public class UpgradeCatalog250Test {
       eq("repo_version"), eq("repo_version_id"), eq(false));
 
     // servicedesiredstate table
-    Capture<DBAccessor.DBColumnInfo> capturedCredentialStoreSupportedCol = newCapture();
     Capture<DBAccessor.DBColumnInfo> capturedCredentialStoreEnabledCol = newCapture();
-    dbAccessor.addColumn(eq(UpgradeCatalog250.SERVICE_DESIRED_STATE_TABLE), capture(capturedCredentialStoreSupportedCol));
     dbAccessor.addColumn(eq(UpgradeCatalog250.SERVICE_DESIRED_STATE_TABLE), capture(capturedCredentialStoreEnabledCol));
 
     expect(dbAccessor.getConnection()).andReturn(connection).anyTimes();
@@ -253,16 +251,8 @@ public class UpgradeCatalog250Test {
     // did we get them all?
     Assert.assertEquals(0, expected.size());
 
-    // Verify if credential_store_supported & credential_store_enabled columns
+    // Verify if credential_store_enabled columns
     // were added to servicedesiredstate table
-    DBAccessor.DBColumnInfo capturedCredentialStoreSupportedColValues = capturedCredentialStoreSupportedCol.getValue();
-    Assert.assertNotNull(capturedCredentialStoreSupportedColValues);
-
-    Assert.assertEquals(UpgradeCatalog250.CREDENTIAL_STORE_SUPPORTED_COL, capturedCredentialStoreSupportedColValues.getName());
-    Assert.assertEquals(null, capturedCredentialStoreSupportedColValues.getLength());
-    Assert.assertEquals(Short.class, capturedCredentialStoreSupportedColValues.getType());
-    Assert.assertEquals(0, capturedCredentialStoreSupportedColValues.getDefaultValue());
-    Assert.assertEquals(false, capturedCredentialStoreSupportedColValues.isNullable());
 
     DBAccessor.DBColumnInfo capturedCredentialStoreEnabledColValues = capturedCredentialStoreEnabledCol.getValue();
     Assert.assertNotNull(capturedCredentialStoreEnabledColValues);


[45/50] [abbrv] ambari git commit: AMBARI-19795 Ambari upgrade to not add ranger plugin configs under ranger plugin supported services (mugdha)

Posted by nc...@apache.org.
AMBARI-19795 Ambari upgrade to not add ranger plugin configs under ranger plugin supported services (mugdha)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 94d9361ef649459894a0119862ec34e652e1e792
Parents: 309d9fd
Author: Mugdha Varadkar <mu...@apache.org>
Authored: Fri Feb 3 15:15:11 2017 +0530
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Mon Feb 13 15:45:36 2017 -0500

----------------------------------------------------------------------
 .../0.9.0/configuration/ranger-kafka-audit.xml  | 32 ++++-----
 .../ranger-kafka-plugin-properties.xml          | 14 ++--
 .../ranger-kafka-policymgr-ssl.xml              | 12 ++--
 .../configuration/ranger-kafka-security.xml     | 12 ++--
 .../ranger-knox-plugin-properties.xml           | 12 ++--
 .../0.10.0/configuration/ranger-storm-audit.xml | 32 ++++-----
 .../ranger-storm-policymgr-ssl.xml              | 12 ++--
 .../configuration/ranger-storm-security.xml     | 12 ++--
 .../ranger-storm-plugin-properties.xml          | 71 --------------------
 .../ranger-hbase-plugin-properties.xml          | 10 +--
 .../ranger-hdfs-plugin-properties.xml           | 12 ++--
 .../ranger-hive-plugin-properties.xml           | 10 +--
 .../ranger-knox-plugin-properties.xml           |  2 +-
 .../HBASE/configuration/ranger-hbase-audit.xml  | 32 ++++-----
 .../ranger-hbase-policymgr-ssl.xml              | 12 ++--
 .../configuration/ranger-hbase-security.xml     | 14 ++--
 .../configuration/ranger-hdfs-policymgr-ssl.xml | 12 ++--
 .../HDFS/configuration/ranger-hdfs-security.xml | 14 ++--
 .../HIVE/configuration/ranger-hive-audit.xml    | 32 ++++-----
 .../configuration/ranger-hive-policymgr-ssl.xml | 12 ++--
 .../HIVE/configuration/ranger-hive-security.xml | 14 ++--
 .../ranger-kafka-policymgr-ssl.xml              |  4 +-
 .../KNOX/configuration/ranger-knox-audit.xml    | 32 ++++-----
 .../configuration/ranger-knox-policymgr-ssl.xml | 12 ++--
 .../KNOX/configuration/ranger-knox-security.xml | 12 ++--
 .../ranger-storm-policymgr-ssl.xml              |  4 +-
 .../configuration/ranger-storm-security.xml     |  2 +-
 .../YARN/configuration/ranger-yarn-audit.xml    | 32 ++++-----
 .../ranger-yarn-plugin-properties.xml           | 12 ++--
 .../configuration/ranger-yarn-policymgr-ssl.xml | 12 ++--
 .../YARN/configuration/ranger-yarn-security.xml | 12 ++--
 .../ATLAS/configuration/ranger-atlas-audit.xml  | 18 ++---
 .../ranger-atlas-plugin-properties.xml          | 58 ++--------------
 .../ranger-atlas-policymgr-ssl.xml              | 12 ++--
 .../configuration/ranger-atlas-security.xml     | 14 ++--
 .../ranger-hbase-plugin-properties.xml          | 71 --------------------
 .../ranger-hdfs-plugin-properties.xml           | 50 +-------------
 .../ranger-hive-plugin-properties.xml           | 71 --------------------
 .../HIVE/configuration/ranger-hive-security.xml |  2 +-
 .../ranger-kafka-plugin-properties.xml          | 71 --------------------
 .../ranger-knox-plugin-properties.xml           | 71 --------------------
 .../ranger-storm-policymgr-ssl.xml              |  4 +-
 .../configuration/ranger-storm-security.xml     |  2 +-
 .../ranger-yarn-plugin-properties.xml           | 71 --------------------
 .../ranger-atlas-plugin-properties.xml          | 71 ++++++++++++++++++++
 .../ranger-hbase-plugin-properties.xml          | 71 ++++++++++++++++++++
 .../ranger-hdfs-plugin-properties.xml           | 70 +++++++++++++++++++
 .../ranger-hive-plugin-properties.xml           | 71 ++++++++++++++++++++
 .../ranger-kafka-plugin-properties.xml          | 71 ++++++++++++++++++++
 .../ranger-knox-plugin-properties.xml           | 71 ++++++++++++++++++++
 .../ranger-storm-plugin-properties.xml          | 71 ++++++++++++++++++++
 .../ranger-yarn-plugin-properties.xml           | 71 ++++++++++++++++++++
 52 files changed, 823 insertions(+), 778 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-audit.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-audit.xml b/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-audit.xml
index 5257549..b4c0790 100644
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-audit.xml
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-audit.xml
@@ -23,7 +23,7 @@
     <name>xasecure.audit.is.enabled</name>
     <value>true</value>
     <description>Is Audit enabled?</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db</name>
@@ -39,19 +39,19 @@
         <name>xasecure.audit.destination.db</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.jdbc.url</name>
     <value>{{audit_jdbc_url}}</value>
     <description>Audit DB JDBC URL</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.user</name>
     <value>{{xa_audit_db_user}}</value>
     <description>Audit DB JDBC User</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.password</name>
@@ -61,25 +61,25 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.jdbc.driver</name>
     <value>{{jdbc_driver}}</value>
     <description>Audit DB JDBC Driver</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.credential.provider.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>Credential file store</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.batch.filespool.dir</name>
     <value>/var/log/kafka/audit/db/spool</value>
     <description>/var/log/kafka/audit/db/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs</name>
@@ -95,7 +95,7 @@
         <name>xasecure.audit.destination.hdfs</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs.dir</name>
@@ -107,13 +107,13 @@
         <name>xasecure.audit.destination.hdfs.dir</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs.batch.filespool.dir</name>
     <value>/var/log/kafka/audit/hdfs/spool</value>
     <description>/var/log/kafka/audit/hdfs/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr</name>
@@ -129,7 +129,7 @@
         <name>xasecure.audit.destination.solr</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.urls</name>
@@ -144,7 +144,7 @@
         <name>ranger.audit.solr.urls</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.zookeepers</name>
@@ -156,13 +156,13 @@
         <name>ranger.audit.solr.zookeepers</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.batch.filespool.dir</name>
     <value>/var/log/kafka/audit/solr/spool</value>
     <description>/var/log/kafka/audit/solr/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.provider.summary.enabled</name>
@@ -172,6 +172,6 @@
     <value-attributes>
       <type>boolean</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-plugin-properties.xml b/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-plugin-properties.xml
index 7f594a0..3949402 100644
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-plugin-properties.xml
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-plugin-properties.xml
@@ -24,7 +24,7 @@
     <value>ambari-qa</value>
     <display-name>Policy user for KAFKA</display-name>
     <description>This user must be system user and also present at Ranger admin portal</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>hadoop.rpc.protection</name>
@@ -33,7 +33,7 @@
     <value-attributes>
       <empty-value-valid>true</empty-value-valid>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>common.name.for.certificate</name>
@@ -42,13 +42,13 @@
     <value-attributes>
       <empty-value-valid>true</empty-value-valid>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>zookeeper.connect</name>
     <value>localhost:2181</value>
     <description>Used for repository creation on ranger admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger-kafka-plugin-enabled</name>
@@ -65,14 +65,14 @@
       <type>boolean</type>
       <overridable>false</overridable>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>REPOSITORY_CONFIG_USERNAME</name>
     <value>kafka</value>
     <display-name>Ranger repository config user</display-name>
     <description>Used for repository creation on ranger admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>REPOSITORY_CONFIG_PASSWORD</name>
@@ -83,6 +83,6 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-policymgr-ssl.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-policymgr-ssl.xml b/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-policymgr-ssl.xml
index f0fc160..cf4a82e 100644
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-policymgr-ssl.xml
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-policymgr-ssl.xml
@@ -23,7 +23,7 @@
     <name>xasecure.policymgr.clientssl.keystore</name>
     <value>kafkadev-clientcert.jks</value>
     <description>Java Keystore files</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.keystore.password</name>
@@ -33,13 +33,13 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore</name>
     <value>cacerts-xasecure.jks</value>
     <description>java truststore file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore.password</name>
@@ -49,18 +49,18 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.keystore.credential.file</name>
     <value>jceks://file/{{credential_file}}</value>
     <description>java keystore credential file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore.credential.file</name>
     <value>jceks://file/{{credential_file}}</value>
     <description>java truststore credential file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-security.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-security.xml b/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-security.xml
index a9f84a4..47ea2a8 100644
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-security.xml
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-security.xml
@@ -23,19 +23,19 @@
     <name>ranger.plugin.kafka.service.name</name>
     <value>{{repo_name}}</value>
     <description>Name of the Ranger service containing policies for this Kafka instance</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.kafka.policy.source.impl</name>
     <value>org.apache.ranger.admin.client.RangerAdminRESTClient</value>
     <description>Class to retrieve policies from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.kafka.policy.rest.url</name>
     <value>{{policymgr_mgr_url}}</value>
     <description>URL to Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
     <depends-on>
       <property>
         <type>admin-properties</type>
@@ -47,18 +47,18 @@
     <name>ranger.plugin.kafka.policy.rest.ssl.config.file</name>
     <value>/etc/kafka/conf/ranger-policymgr-ssl.xml</value>
     <description>Path to the file containing SSL details to contact Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.kafka.policy.pollIntervalMs</name>
     <value>30000</value>
     <description>How often to poll for changes in policies?</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.kafka.policy.cache.dir</name>
     <value>/etc/ranger/{{repo_name}}/policycache</value>
     <description>Directory where Ranger policies are cached after successful retrieval from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/ranger-knox-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/ranger-knox-plugin-properties.xml b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/ranger-knox-plugin-properties.xml
index 7f85667..ae9314b 100644
--- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/ranger-knox-plugin-properties.xml
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/ranger-knox-plugin-properties.xml
@@ -24,7 +24,7 @@
     <value>ambari-qa</value>
     <display-name>Policy user for KNOX</display-name>
     <description>This user must be system user and also present at Ranger admin portal</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>common.name.for.certificate</name>
@@ -33,7 +33,7 @@
     <value-attributes>
       <empty-value-valid>true</empty-value-valid>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger-knox-plugin-enabled</name>
@@ -50,14 +50,14 @@
       <type>boolean</type>
       <overridable>false</overridable>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>REPOSITORY_CONFIG_USERNAME</name>
     <value>admin</value>
     <display-name>Ranger repository config user</display-name>
     <description>Used for repository creation on ranger admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>REPOSITORY_CONFIG_PASSWORD</name>
@@ -68,14 +68,14 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>KNOX_HOME</name>
     <value>/usr/local/knox-server</value>
     <display-name>Knox Home</display-name>
     <description>Knox home folder</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>XAAUDIT.DB.IS_ENABLED</name>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/common-services/STORM/0.10.0/configuration/ranger-storm-audit.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/0.10.0/configuration/ranger-storm-audit.xml b/ambari-server/src/main/resources/common-services/STORM/0.10.0/configuration/ranger-storm-audit.xml
index b7cf4c5..4dc51eb 100644
--- a/ambari-server/src/main/resources/common-services/STORM/0.10.0/configuration/ranger-storm-audit.xml
+++ b/ambari-server/src/main/resources/common-services/STORM/0.10.0/configuration/ranger-storm-audit.xml
@@ -23,7 +23,7 @@
     <name>xasecure.audit.is.enabled</name>
     <value>true</value>
     <description>Is Audit enabled?</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db</name>
@@ -39,19 +39,19 @@
         <name>xasecure.audit.destination.db</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.jdbc.url</name>
     <value>{{audit_jdbc_url}}</value>
     <description>Audit DB JDBC URL</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.user</name>
     <value>{{xa_audit_db_user}}</value>
     <description>Audit DB JDBC User</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.password</name>
@@ -61,25 +61,25 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.jdbc.driver</name>
     <value>{{jdbc_driver}}</value>
     <description>Audit DB JDBC Driver</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.credential.provider.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>Credential file store</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.batch.filespool.dir</name>
     <value>/var/log/storm/audit/db/spool</value>
     <description>/var/log/storm/audit/db/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs</name>
@@ -95,7 +95,7 @@
         <name>xasecure.audit.destination.hdfs</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs.dir</name>
@@ -107,13 +107,13 @@
         <name>xasecure.audit.destination.hdfs.dir</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs.batch.filespool.dir</name>
     <value>/var/log/storm/audit/hdfs/spool</value>
     <description>/var/log/storm/audit/hdfs/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr</name>
@@ -129,7 +129,7 @@
         <name>xasecure.audit.destination.solr</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.urls</name>
@@ -144,7 +144,7 @@
         <name>ranger.audit.solr.urls</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.zookeepers</name>
@@ -156,13 +156,13 @@
         <name>ranger.audit.solr.zookeepers</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.batch.filespool.dir</name>
     <value>/var/log/storm/audit/solr/spool</value>
     <description>/var/log/storm/audit/solr/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.provider.summary.enabled</name>
@@ -172,6 +172,6 @@
     <value-attributes>
       <type>boolean</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/common-services/STORM/0.10.0/configuration/ranger-storm-policymgr-ssl.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/0.10.0/configuration/ranger-storm-policymgr-ssl.xml b/ambari-server/src/main/resources/common-services/STORM/0.10.0/configuration/ranger-storm-policymgr-ssl.xml
index 9592914..b1f6e1e 100644
--- a/ambari-server/src/main/resources/common-services/STORM/0.10.0/configuration/ranger-storm-policymgr-ssl.xml
+++ b/ambari-server/src/main/resources/common-services/STORM/0.10.0/configuration/ranger-storm-policymgr-ssl.xml
@@ -23,7 +23,7 @@
     <name>xasecure.policymgr.clientssl.keystore</name>
     <value>hadoopdev-clientcert.jks</value>
     <description>Java Keystore files</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.keystore.password</name>
@@ -33,13 +33,13 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore</name>
     <value>cacerts-xasecure.jks</value>
     <description>java truststore file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore.password</name>
@@ -49,18 +49,18 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.keystore.credential.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>java keystore credential file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore.credential.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>java truststore credential file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/common-services/STORM/0.10.0/configuration/ranger-storm-security.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/0.10.0/configuration/ranger-storm-security.xml b/ambari-server/src/main/resources/common-services/STORM/0.10.0/configuration/ranger-storm-security.xml
index 84e394b4..b72b302 100644
--- a/ambari-server/src/main/resources/common-services/STORM/0.10.0/configuration/ranger-storm-security.xml
+++ b/ambari-server/src/main/resources/common-services/STORM/0.10.0/configuration/ranger-storm-security.xml
@@ -23,19 +23,19 @@
     <name>ranger.plugin.storm.service.name</name>
     <value>{{repo_name}}</value>
     <description>Name of the Ranger service containing policies for this Storm instance</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.storm.policy.source.impl</name>
     <value>org.apache.ranger.admin.client.RangerAdminRESTClient</value>
     <description>Class to retrieve policies from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.storm.policy.rest.url</name>
     <value>{{policymgr_mgr_url}}</value>
     <description>URL to Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
     <depends-on>
       <property>
         <type>admin-properties</type>
@@ -47,18 +47,18 @@
     <name>ranger.plugin.storm.policy.rest.ssl.config.file</name>
     <value>/etc/storm/conf/ranger-policymgr-ssl.xml</value>
     <description>Path to the file containing SSL details to contact Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.storm.policy.pollIntervalMs</name>
     <value>30000</value>
     <description>How often to poll for changes in policies?</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.storm.policy.cache.dir</name>
     <value>/etc/ranger/{{repo_name}}/policycache</value>
     <description>Directory where Ranger policies are cached after successful retrieval from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/common-services/STORM/1.0.1/configuration/ranger-storm-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/1.0.1/configuration/ranger-storm-plugin-properties.xml b/ambari-server/src/main/resources/common-services/STORM/1.0.1/configuration/ranger-storm-plugin-properties.xml
deleted file mode 100644
index 3450970..0000000
--- a/ambari-server/src/main/resources/common-services/STORM/1.0.1/configuration/ranger-storm-plugin-properties.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<configuration>
-
-  <property>
-    <name>external_admin_username</name>
-    <value></value>
-    <display-name>External Ranger admin username</display-name>
-    <description>Add ranger default admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_admin_password</name>
-    <value></value>
-    <display-name>External Ranger admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_username</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin username</display-name>
-    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_password</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.2/services/HBASE/configuration/ranger-hbase-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HBASE/configuration/ranger-hbase-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HBASE/configuration/ranger-hbase-plugin-properties.xml
index 0de538d..960c751 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HBASE/configuration/ranger-hbase-plugin-properties.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HBASE/configuration/ranger-hbase-plugin-properties.xml
@@ -26,7 +26,7 @@
     <value-attributes>
       <empty-value-valid>true</empty-value-valid>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>policy_user</name>
@@ -39,7 +39,7 @@
       </property>
     </depends-on>
     <description>This user must be system user and also present at Ranger admin portal</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger-hbase-plugin-enabled</name>
@@ -56,14 +56,14 @@
         <name>ranger-hbase-plugin-enabled</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>REPOSITORY_CONFIG_USERNAME</name>
     <value>hbase</value>
     <display-name>Ranger repository config user</display-name>
     <description>Used for repository creation on ranger admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>REPOSITORY_CONFIG_PASSWORD</name>
@@ -74,7 +74,7 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>XAAUDIT.DB.IS_ENABLED</name>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/configuration/ranger-hdfs-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/configuration/ranger-hdfs-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/configuration/ranger-hdfs-plugin-properties.xml
index 7460d26..c57c5f0 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/configuration/ranger-hdfs-plugin-properties.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/configuration/ranger-hdfs-plugin-properties.xml
@@ -17,7 +17,7 @@
     <display-name>Policy user for HDFS</display-name>
     <description>This user must be system user and also present at Ranger
 			admin portal</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>hadoop.rpc.protection</name>
@@ -27,7 +27,7 @@
     <value-attributes>
       <empty-value-valid>true</empty-value-valid>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>common.name.for.certificate</name>
@@ -36,7 +36,7 @@
     <value-attributes>
       <empty-value-valid>true</empty-value-valid>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger-hdfs-plugin-enabled</name>
@@ -53,7 +53,7 @@
       <type>boolean</type>
       <overridable>false</overridable>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>REPOSITORY_CONFIG_USERNAME</name>
@@ -61,7 +61,7 @@
     <display-name>Ranger repository config user</display-name>
     <description>Used for repository creation on ranger admin
 		</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>REPOSITORY_CONFIG_PASSWORD</name>
@@ -73,7 +73,7 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>XAAUDIT.DB.IS_ENABLED</name>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/ranger-hive-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/ranger-hive-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/ranger-hive-plugin-properties.xml
index 0db5565..830c539 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/ranger-hive-plugin-properties.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/ranger-hive-plugin-properties.xml
@@ -24,13 +24,13 @@
     <value>ambari-qa</value>
     <display-name>Policy user for HIVE</display-name>
     <description>This user must be system user and also present at Ranger admin portal</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>jdbc.driverClassName</name>
     <value>org.apache.hive.jdbc.HiveDriver</value>
     <description>Used for repository creation on ranger admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>common.name.for.certificate</name>
@@ -39,14 +39,14 @@
     <value-attributes>
       <empty-value-valid>true</empty-value-valid>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>REPOSITORY_CONFIG_USERNAME</name>
     <value>hive</value>
     <display-name>Ranger repository config user</display-name>
     <description>Used for repository creation on ranger admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>REPOSITORY_CONFIG_PASSWORD</name>
@@ -57,7 +57,7 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>XAAUDIT.DB.IS_ENABLED</name>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/ranger-knox-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/ranger-knox-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/ranger-knox-plugin-properties.xml
index ad2b1e4..d5880dd 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/ranger-knox-plugin-properties.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/ranger-knox-plugin-properties.xml
@@ -24,6 +24,6 @@
     <value>/usr/hdp/current/knox-server</value>
     <display-name>Knox Home</display-name>
     <description>Knox home folder</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-audit.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-audit.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-audit.xml
index f670d7e..85c16c8 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-audit.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-audit.xml
@@ -23,7 +23,7 @@
     <name>xasecure.audit.is.enabled</name>
     <value>true</value>
     <description>Is Audit enabled?</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db</name>
@@ -39,19 +39,19 @@
         <name>xasecure.audit.destination.db</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.jdbc.url</name>
     <value>{{audit_jdbc_url}}</value>
     <description>Audit DB JDBC URL</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.user</name>
     <value>{{xa_audit_db_user}}</value>
     <description>Audit DB JDBC User</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.password</name>
@@ -61,25 +61,25 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.jdbc.driver</name>
     <value>{{jdbc_driver}}</value>
     <description>Audit DB JDBC Driver</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.credential.provider.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>Credential file store</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.batch.filespool.dir</name>
     <value>/var/log/hbase/audit/db/spool</value>
     <description>/var/log/hbase/audit/db/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs</name>
@@ -95,7 +95,7 @@
         <name>xasecure.audit.destination.hdfs</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs.dir</name>
@@ -107,13 +107,13 @@
         <name>xasecure.audit.destination.hdfs.dir</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs.batch.filespool.dir</name>
     <value>/var/log/hbase/audit/hdfs/spool</value>
     <description>/var/log/hbase/audit/hdfs/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr</name>
@@ -129,7 +129,7 @@
         <name>xasecure.audit.destination.solr</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.urls</name>
@@ -144,7 +144,7 @@
         <name>ranger.audit.solr.urls</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.zookeepers</name>
@@ -156,13 +156,13 @@
         <name>ranger.audit.solr.zookeepers</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.batch.filespool.dir</name>
     <value>/var/log/hbase/audit/solr/spool</value>
     <description>/var/log/hbase/audit/solr/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.provider.summary.enabled</name>
@@ -172,6 +172,6 @@
     <value-attributes>
       <type>boolean</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-policymgr-ssl.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-policymgr-ssl.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-policymgr-ssl.xml
index 79370bc..c761b26 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-policymgr-ssl.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-policymgr-ssl.xml
@@ -23,7 +23,7 @@
     <name>xasecure.policymgr.clientssl.keystore</name>
     <value>/usr/hdp/current/hbase-client/conf/ranger-plugin-keystore.jks</value>
     <description>Java Keystore files</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.keystore.password</name>
@@ -33,13 +33,13 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore</name>
     <value>/usr/hdp/current/hbase-client/conf/ranger-plugin-truststore.jks</value>
     <description>java truststore file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore.password</name>
@@ -49,18 +49,18 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.keystore.credential.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>java keystore credential file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore.credential.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>java truststore credential file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-security.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-security.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-security.xml
index 0ad5e60..4a0909a 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-security.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-security.xml
@@ -23,19 +23,19 @@
     <name>ranger.plugin.hbase.service.name</name>
     <value>{{repo_name}}</value>
     <description>Name of the Ranger service containing HBase policies</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.hbase.policy.source.impl</name>
     <value>org.apache.ranger.admin.client.RangerAdminRESTClient</value>
     <description>Class to retrieve policies from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.hbase.policy.rest.url</name>
     <value>{{policymgr_mgr_url}}</value>
     <description>URL to Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
     <depends-on>
       <property>
         <type>admin-properties</type>
@@ -47,19 +47,19 @@
     <name>ranger.plugin.hbase.policy.rest.ssl.config.file</name>
     <value>/etc/hbase/conf/ranger-policymgr-ssl.xml</value>
     <description>Path to the file containing SSL details to contact Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.hbase.policy.pollIntervalMs</name>
     <value>30000</value>
     <description>How often to poll for changes in policies?</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.hbase.policy.cache.dir</name>
     <value>/etc/ranger/{{repo_name}}/policycache</value>
     <description>Directory where Ranger policies are cached after successful retrieval from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.hbase.update.xapolicies.on.grant.revoke</name>
@@ -69,6 +69,6 @@
     <value-attributes>
       <type>boolean</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/configuration/ranger-hdfs-policymgr-ssl.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/configuration/ranger-hdfs-policymgr-ssl.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/configuration/ranger-hdfs-policymgr-ssl.xml
index e14a9e8..71ba3a6 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/configuration/ranger-hdfs-policymgr-ssl.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/configuration/ranger-hdfs-policymgr-ssl.xml
@@ -23,7 +23,7 @@
     <name>xasecure.policymgr.clientssl.keystore</name>
     <value>/usr/hdp/current/hadoop-client/conf/ranger-plugin-keystore.jks</value>
     <description>Java Keystore files</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.keystore.password</name>
@@ -33,13 +33,13 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore</name>
     <value>/usr/hdp/current/hadoop-client/conf/ranger-plugin-truststore.jks</value>
     <description>java truststore file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore.password</name>
@@ -49,18 +49,18 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.keystore.credential.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>java keystore credential file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore.credential.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>java truststore credential file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/configuration/ranger-hdfs-security.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/configuration/ranger-hdfs-security.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/configuration/ranger-hdfs-security.xml
index b2b8edb..f23706e 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/configuration/ranger-hdfs-security.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/configuration/ranger-hdfs-security.xml
@@ -23,19 +23,19 @@
     <name>ranger.plugin.hdfs.service.name</name>
     <value>{{repo_name}}</value>
     <description>Name of the Ranger service containing Hdfs policies</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.hdfs.policy.source.impl</name>
     <value>org.apache.ranger.admin.client.RangerAdminRESTClient</value>
     <description>Class to retrieve policies from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.hdfs.policy.rest.url</name>
     <value>{{policymgr_mgr_url}}</value>
     <description>URL to Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
     <depends-on>
       <property>
         <type>admin-properties</type>
@@ -47,24 +47,24 @@
     <name>ranger.plugin.hdfs.policy.rest.ssl.config.file</name>
     <value>/etc/hadoop/conf/ranger-policymgr-ssl.xml</value>
     <description>Path to the file containing SSL details to contact Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.hdfs.policy.pollIntervalMs</name>
     <value>30000</value>
     <description>How often to poll for changes in policies?</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.hdfs.policy.cache.dir</name>
     <value>/etc/ranger/{{repo_name}}/policycache</value>
     <description>Directory where Ranger policies are cached after successful retrieval from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.add-hadoop-authorization</name>
     <value>true</value>
     <description>Enable/Disable the default hadoop authorization (based on rwxrwxrwx permission on the resource) if Ranger Authorization fails.</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-audit.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-audit.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-audit.xml
index 874d0d5..b210fca 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-audit.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-audit.xml
@@ -23,7 +23,7 @@
     <name>xasecure.audit.is.enabled</name>
     <value>true</value>
     <description>Is Audit enabled?</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db</name>
@@ -39,19 +39,19 @@
         <name>xasecure.audit.destination.db</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.jdbc.url</name>
     <value>{{audit_jdbc_url}}</value>
     <description>Audit DB JDBC URL</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.user</name>
     <value>{{xa_audit_db_user}}</value>
     <description>Audit DB JDBC User</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.password</name>
@@ -61,25 +61,25 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.jdbc.driver</name>
     <value>{{jdbc_driver}}</value>
     <description>Audit DB JDBC Driver</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.credential.provider.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>Credential file store</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.batch.filespool.dir</name>
     <value>/var/log/hive/audit/db/spool</value>
     <description>/var/log/hive/audit/db/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs</name>
@@ -95,7 +95,7 @@
         <name>xasecure.audit.destination.hdfs</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs.dir</name>
@@ -107,13 +107,13 @@
         <name>xasecure.audit.destination.hdfs.dir</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs.batch.filespool.dir</name>
     <value>/var/log/hive/audit/hdfs/spool</value>
     <description>/var/log/hive/audit/hdfs/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr</name>
@@ -129,7 +129,7 @@
         <name>xasecure.audit.destination.solr</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.urls</name>
@@ -144,7 +144,7 @@
         <name>ranger.audit.solr.urls</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.zookeepers</name>
@@ -156,13 +156,13 @@
         <name>ranger.audit.solr.zookeepers</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.batch.filespool.dir</name>
     <value>/var/log/hive/audit/solr/spool</value>
     <description>/var/log/hive/audit/solr/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.provider.summary.enabled</name>
@@ -172,6 +172,6 @@
     <value-attributes>
       <type>boolean</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-policymgr-ssl.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-policymgr-ssl.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-policymgr-ssl.xml
index 14e7b16..a538843 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-policymgr-ssl.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-policymgr-ssl.xml
@@ -23,7 +23,7 @@
     <name>xasecure.policymgr.clientssl.keystore</name>
     <value>/usr/hdp/current/hive-server2/conf/ranger-plugin-keystore.jks</value>
     <description>Java Keystore files</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.keystore.password</name>
@@ -33,13 +33,13 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore</name>
     <value>/usr/hdp/current/hive-server2/conf/ranger-plugin-truststore.jks</value>
     <description>java truststore file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore.password</name>
@@ -49,18 +49,18 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.keystore.credential.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>java keystore credential file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore.credential.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>java truststore credential file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-security.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-security.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-security.xml
index a07972a..7ea3391 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-security.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-security.xml
@@ -23,19 +23,19 @@
     <name>ranger.plugin.hive.service.name</name>
     <value>{{repo_name}}</value>
     <description>Name of the Ranger service containing policies for this HIVE instance</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.hive.policy.source.impl</name>
     <value>org.apache.ranger.admin.client.RangerAdminRESTClient</value>
     <description>Class to retrieve policies from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.hive.policy.rest.url</name>
     <value>{{policymgr_mgr_url}}</value>
     <description>URL to Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
     <depends-on>
       <property>
         <type>admin-properties</type>
@@ -47,19 +47,19 @@
     <name>ranger.plugin.hive.policy.rest.ssl.config.file</name>
     <value>/usr/hdp/current/hive-server2/conf/conf.server/ranger-policymgr-ssl.xml</value>
     <description>Path to the file containing SSL details to contact Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.hive.policy.pollIntervalMs</name>
     <value>30000</value>
     <description>How often to poll for changes in policies?</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.hive.policy.cache.dir</name>
     <value>/etc/ranger/{{repo_name}}/policycache</value>
     <description>Directory where Ranger policies are cached after successful retrieval from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.hive.update.xapolicies.on.grant.revoke</name>
@@ -69,6 +69,6 @@
     <value-attributes>
       <type>boolean</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/configuration/ranger-kafka-policymgr-ssl.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/configuration/ranger-kafka-policymgr-ssl.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/configuration/ranger-kafka-policymgr-ssl.xml
index 2f4c121..24fd407 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/configuration/ranger-kafka-policymgr-ssl.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/configuration/ranger-kafka-policymgr-ssl.xml
@@ -23,12 +23,12 @@
     <name>xasecure.policymgr.clientssl.keystore</name>
     <value>/usr/hdp/current/kafka-broker/config/ranger-plugin-keystore.jks</value>
     <description>Java Keystore files</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore</name>
     <value>/usr/hdp/current/kafka-broker/config/ranger-plugin-truststore.jks</value>
     <description>java truststore file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-audit.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-audit.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-audit.xml
index abdf2bd..1f3c1d1 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-audit.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-audit.xml
@@ -23,7 +23,7 @@
     <name>xasecure.audit.is.enabled</name>
     <value>true</value>
     <description>Is Audit enabled?</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db</name>
@@ -39,19 +39,19 @@
         <name>xasecure.audit.destination.db</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.jdbc.url</name>
     <value>{{audit_jdbc_url}}</value>
     <description>Audit DB JDBC URL</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.user</name>
     <value>{{xa_audit_db_user}}</value>
     <description>Audit DB JDBC User</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.password</name>
@@ -61,25 +61,25 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.jdbc.driver</name>
     <value>{{jdbc_driver}}</value>
     <description>Audit DB JDBC Driver</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.credential.provider.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>Credential file store</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.batch.filespool.dir</name>
     <value>/var/log/knox/audit/db/spool</value>
     <description>/var/log/knox/audit/db/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs</name>
@@ -95,7 +95,7 @@
         <name>xasecure.audit.destination.hdfs</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs.dir</name>
@@ -107,13 +107,13 @@
         <name>xasecure.audit.destination.hdfs.dir</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs.batch.filespool.dir</name>
     <value>/var/log/knox/audit/hdfs/spool</value>
     <description>/var/log/knox/audit/hdfs/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr</name>
@@ -129,7 +129,7 @@
         <name>xasecure.audit.destination.solr</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.urls</name>
@@ -144,7 +144,7 @@
         <name>ranger.audit.solr.urls</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.zookeepers</name>
@@ -156,13 +156,13 @@
         <name>ranger.audit.solr.zookeepers</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.batch.filespool.dir</name>
     <value>/var/log/knox/audit/solr/spool</value>
     <description>/var/log/knox/audit/solr/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.provider.summary.enabled</name>
@@ -172,6 +172,6 @@
     <value-attributes>
       <type>boolean</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-policymgr-ssl.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-policymgr-ssl.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-policymgr-ssl.xml
index 6cc2351..bb0878f 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-policymgr-ssl.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-policymgr-ssl.xml
@@ -23,7 +23,7 @@
     <name>xasecure.policymgr.clientssl.keystore</name>
     <value>/usr/hdp/current/knox-server/conf/ranger-plugin-keystore.jks</value>
     <description>Java Keystore files</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.keystore.password</name>
@@ -33,13 +33,13 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore</name>
     <value>/usr/hdp/current/knox-server/conf/ranger-plugin-truststore.jks</value>
     <description>java truststore file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore.password</name>
@@ -49,18 +49,18 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.keystore.credential.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>java keystore credential file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore.credential.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>java truststore credential file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-security.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-security.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-security.xml
index 0f0d3a7..37bda4c 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-security.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-security.xml
@@ -23,19 +23,19 @@
     <name>ranger.plugin.knox.service.name</name>
     <value>{{repo_name}}</value>
     <description>Name of the Ranger service containing policies for this Knox instance</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.knox.policy.source.impl</name>
     <value>org.apache.ranger.admin.client.RangerAdminJersey2RESTClient</value>
     <description>Class to retrieve policies from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.knox.policy.rest.url</name>
     <value>{{policymgr_mgr_url}}</value>
     <description>URL to Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
     <depends-on>
       <property>
         <type>admin-properties</type>
@@ -47,18 +47,18 @@
     <name>ranger.plugin.knox.policy.rest.ssl.config.file</name>
     <value>/usr/hdp/current/knox-server/conf/ranger-policymgr-ssl.xml</value>
     <description>Path to the file containing SSL details to contact Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.knox.policy.pollIntervalMs</name>
     <value>30000</value>
     <description>How often to poll for changes in policies?</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.knox.policy.cache.dir</name>
     <value>/etc/ranger/{{repo_name}}/policycache</value>
     <description>Directory where Ranger policies are cached after successful retrieval from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.3/services/STORM/configuration/ranger-storm-policymgr-ssl.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/STORM/configuration/ranger-storm-policymgr-ssl.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/STORM/configuration/ranger-storm-policymgr-ssl.xml
index 21658e7..5672f04 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/STORM/configuration/ranger-storm-policymgr-ssl.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/STORM/configuration/ranger-storm-policymgr-ssl.xml
@@ -23,12 +23,12 @@
     <name>xasecure.policymgr.clientssl.keystore</name>
     <value>/usr/hdp/current/storm-client/conf/ranger-plugin-keystore.jks</value>
     <description>Java Keystore files</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore</name>
     <value>/usr/hdp/current/storm-client/conf/ranger-plugin-truststore.jks</value>
     <description>java truststore file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.3/services/STORM/configuration/ranger-storm-security.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/STORM/configuration/ranger-storm-security.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/STORM/configuration/ranger-storm-security.xml
index 8a3dd2e..f3d7530 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/STORM/configuration/ranger-storm-security.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/STORM/configuration/ranger-storm-security.xml
@@ -23,6 +23,6 @@
     <name>ranger.plugin.storm.policy.rest.ssl.config.file</name>
     <value>/usr/hdp/current/storm-client/conf/ranger-policymgr-ssl.xml</value>
     <description>Path to the file containing SSL details to contact Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-audit.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-audit.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-audit.xml
index 8237f1c..a6b1baa 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-audit.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-audit.xml
@@ -23,7 +23,7 @@
     <name>xasecure.audit.is.enabled</name>
     <value>true</value>
     <description>Is Audit enabled?</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db</name>
@@ -39,19 +39,19 @@
         <name>xasecure.audit.destination.db</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.jdbc.url</name>
     <value>{{audit_jdbc_url}}</value>
     <description>Audit DB JDBC URL</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.user</name>
     <value>{{xa_audit_db_user}}</value>
     <description>Audit DB JDBC User</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.password</name>
@@ -61,25 +61,25 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.jdbc.driver</name>
     <value>{{jdbc_driver}}</value>
     <description>Audit DB JDBC Driver</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.credential.provider.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>Credential file store</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.batch.filespool.dir</name>
     <value>/var/log/hadoop/yarn/audit/db/spool</value>
     <description>/var/log/hadoop/yarn/audit/db/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs</name>
@@ -95,7 +95,7 @@
         <name>xasecure.audit.destination.hdfs</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs.dir</name>
@@ -107,13 +107,13 @@
         <name>xasecure.audit.destination.hdfs.dir</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs.batch.filespool.dir</name>
     <value>/var/log/hadoop/yarn/audit/hdfs/spool</value>
     <description>/var/log/hadoop/yarn/audit/hdfs/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr</name>
@@ -129,7 +129,7 @@
         <name>xasecure.audit.destination.solr</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.urls</name>
@@ -144,7 +144,7 @@
         <name>ranger.audit.solr.urls</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.zookeepers</name>
@@ -156,13 +156,13 @@
         <name>ranger.audit.solr.zookeepers</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.batch.filespool.dir</name>
     <value>/var/log/hadoop/yarn/audit/solr/spool</value>
     <description>/var/log/hadoop/yarn/audit/solr/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.provider.summary.enabled</name>
@@ -172,6 +172,6 @@
     <value-attributes>
       <type>boolean</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-plugin-properties.xml
index 1899d44..97867cc 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-plugin-properties.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-plugin-properties.xml
@@ -24,7 +24,7 @@
     <value>ambari-qa</value>
     <display-name>Policy user for YARN</display-name>
     <description>This user must be system user and also present at Ranger admin portal</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>hadoop.rpc.protection</name>
@@ -33,7 +33,7 @@
     <value-attributes>
       <empty-value-valid>true</empty-value-valid>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>common.name.for.certificate</name>
@@ -42,7 +42,7 @@
     <value-attributes>
       <empty-value-valid>true</empty-value-valid>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger-yarn-plugin-enabled</name>
@@ -59,14 +59,14 @@
       <type>boolean</type>
       <overridable>false</overridable>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>REPOSITORY_CONFIG_USERNAME</name>
     <value>yarn</value>
     <display-name>Ranger repository config user</display-name>
     <description>Used for repository creation on ranger admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>REPOSITORY_CONFIG_PASSWORD</name>
@@ -77,6 +77,6 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-policymgr-ssl.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-policymgr-ssl.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-policymgr-ssl.xml
index 6ad6e62..5410104 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-policymgr-ssl.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-policymgr-ssl.xml
@@ -23,7 +23,7 @@
     <name>xasecure.policymgr.clientssl.keystore</name>
     <value>/usr/hdp/current/hadoop-client/conf/ranger-yarn-plugin-keystore.jks</value>
     <description>Java Keystore files</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.keystore.password</name>
@@ -33,13 +33,13 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore</name>
     <value>/usr/hdp/current/hadoop-client/conf/ranger-yarn-plugin-truststore.jks</value>
     <description>java truststore file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore.password</name>
@@ -49,18 +49,18 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.keystore.credential.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>java keystore credential file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore.credential.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>java truststore credential file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>


[31/50] [abbrv] ambari git commit: AMBARI-19970 : AMS graphs are not present on cluster with SSL (Commit 2). (avijayan)

Posted by nc...@apache.org.
AMBARI-19970 : AMS graphs are not present on cluster with SSL (Commit 2). (avijayan)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 7cb9a6ad53a926f055c5bf78ac2a9a8bd1668d78
Parents: d252665
Author: Aravindan Vijayan <av...@hortonworks.com>
Authored: Mon Feb 13 10:56:46 2017 -0800
Committer: Aravindan Vijayan <av...@hortonworks.com>
Committed: Mon Feb 13 10:56:46 2017 -0800

----------------------------------------------------------------------
 .../0.1.0/package/templates/hadoop-metrics2-hbase.properties.j2  | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7cb9a6ad/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/hadoop-metrics2-hbase.properties.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/hadoop-metrics2-hbase.properties.j2 b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/hadoop-metrics2-hbase.properties.j2
index 8c20f2b..8c6f86f 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/hadoop-metrics2-hbase.properties.j2
+++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/hadoop-metrics2-hbase.properties.j2
@@ -42,16 +42,19 @@ hbase.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
 hbase.period=30
 hbase.collector.hosts={{ams_collector_hosts}}
 hbase.port={{metric_collector_port}}
+hbase.protocol={{metric_collector_protocol}}
 
 jvm.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
 jvm.period=30
 jvm.collector.hosts={{ams_collector_hosts}}
 jvm.port={{metric_collector_port}}
+jvm.protocol={{metric_collector_protocol}}
 
 rpc.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
 rpc.period=30
 rpc.collector.hosts={{ams_collector_hosts}}
 rpc.port={{metric_collector_port}}
+rpc.protocol={{metric_collector_protocol}}
 
 *.timeline.plugin.urls=file:///usr/lib/ambari-metrics-hadoop-sink/ambari-metrics-hadoop-sink.jar
 *.sink.timeline.slave.host.name={{hostname}}
@@ -60,6 +63,7 @@ hbase.sink.timeline.period={{metrics_collection_period}}
 hbase.sink.timeline.sendInterval={{metrics_report_interval}}000
 hbase.sink.timeline.collector.hosts={{ams_collector_hosts}}
 hbase.sink.timeline.port={{metric_collector_port}}
+hbase.sink.timeline.protocol={{metric_collector_protocol}}
 hbase.sink.timeline.serviceName-prefix=ams
 
 # HTTPS properties


[19/50] [abbrv] ambari git commit: AMBARI-19884. Set a higher value of num aggregated files per container - HDP stack, YARN (Siddharth Seth via smohanty)

Posted by nc...@apache.org.
AMBARI-19884. Set a higher value of num aggregated files per container - HDP stack, YARN (Siddharth Seth via smohanty)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: d5100632624a671512ea44e6ad8f6ee9df3dba24
Parents: d6e0b26
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Sat Feb 11 16:09:15 2017 -0800
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Sat Feb 11 16:09:48 2017 -0800

----------------------------------------------------------------------
 .../HDP/2.5/services/YARN/configuration/yarn-site.xml       | 6 ++++++
 .../resources/stacks/HDP/2.5/upgrades/config-upgrade.xml    | 5 +++++
 .../stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml      | 9 ++++++++-
 .../main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml  | 1 +
 4 files changed, 20 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d5100632/ambari-server/src/main/resources/stacks/HDP/2.5/services/YARN/configuration/yarn-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/YARN/configuration/yarn-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/YARN/configuration/yarn-site.xml
index 90b2243..b6fadcb 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/YARN/configuration/yarn-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/YARN/configuration/yarn-site.xml
@@ -47,6 +47,12 @@
     <on-ambari-upgrade add="false"/>
   </property>
   <property>
+    <name>yarn.nodemanager.log-aggregation.num-log-files-per-app</name>
+    <value>336</value>
+    <description>The number of files to retain per container when continuous log aggregation is used</description>
+    <on-ambari-upgrade add="false"/>
+  </property>
+  <property>
     <name>yarn.nodemanager.container-metrics.unregister-delay-ms</name>
     <value>60000</value>
     <description>The delay time ms to unregister container metrics after completion.</description>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d5100632/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml
index 100df8f..15837df 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml
@@ -146,6 +146,11 @@
                     to-key="yarn.scheduler.capacity.ordering-policy.priority-utilization.underutilized-preemption.enabled"
                     default-value="false"/>
         </definition>
+        <definition xsi:type="configure" id="yarn_site_retained_log_count" summary="Updating Yarn retained file count for continuous Log Aggregation">
+          <type>yarn-site</type>
+          <set key="yarn.nodemanager.log-aggregation.num-log-files-per-app"
+               value="336" />
+        </definition>
       </changes>
     </component>
   </service>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d5100632/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml
index 6e92141..8c7a9b1 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml
@@ -299,12 +299,19 @@
       </execute-stage>
 
       <!--Yarn-->
-      <execute-stage service="YARN" component="RESOURCEMANAGER" title="Apply config changes for Resource Manager">
+      <execute-stage service="YARN" component="RESOURCEMANAGER" title="Apply config changes for underutilized_preemption">
         <task xsi:type="configure" id="hdp_2_6_0_0_yarn_priority_utilization_underutilized_preemption">
           <summary>Updating underutilized_preemption setting</summary>
         </task>
       </execute-stage>
 
+      <!--Yarn-->
+      <execute-stage service="YARN" component="RESOURCEMANAGER" title="Apply config changes for YARN app log retaintion">
+        <task xsi:type="configure" id="yarn_site_retained_log_count">
+          <summary>Updating log aggregation retained files setting</summary>
+        </task>
+      </execute-stage>
+
       <!--TEZ-->
       <execute-stage service="TEZ" component="TEZ_CLIENT" title="Verify LZO codec path for Tez">
         <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.FixLzoCodecPath">

http://git-wip-us.apache.org/repos/asf/ambari/blob/d5100632/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml
index bc68754..b83525a 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml
@@ -670,6 +670,7 @@
           <task xsi:type="configure" id="yarn_log4j_parameterize" />
           <task xsi:type="configure" id="yarn_env_security_opts" />
           <task xsi:type="configure" id="hdp_2_6_0_0_yarn_priority_utilization_underutilized_preemption" />
+          <task xsi:type="configure" id="yarn_site_retained_log_count" />
         </pre-upgrade>
         <pre-downgrade />
         <upgrade>


[49/50] [abbrv] ambari git commit: AMBARI-19745. Hive History Queries not working for Hive 2.0 in Hue-Migration View (Ishan Bhatt via gauravn7)

Posted by nc...@apache.org.
AMBARI-19745. Hive History Queries not working for Hive 2.0 in Hue-Migration View (Ishan Bhatt via gauravn7)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 3436c4a1addc11bd56ae6cb4711aec5cf54b06fe
Parents: 4061cba
Author: Gaurav Nagar <gr...@gmail.com>
Authored: Mon Feb 6 18:31:16 2017 +0530
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Mon Feb 13 15:45:36 2017 -0500

----------------------------------------------------------------------
 .../historyquery/HiveHistoryQueryMigrationImplementation.java  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/3436c4a1/contrib/views/hueambarimigration/src/main/java/org/apache/ambari/view/huetoambarimigration/migration/hive/historyquery/HiveHistoryQueryMigrationImplementation.java
----------------------------------------------------------------------
diff --git a/contrib/views/hueambarimigration/src/main/java/org/apache/ambari/view/huetoambarimigration/migration/hive/historyquery/HiveHistoryQueryMigrationImplementation.java b/contrib/views/hueambarimigration/src/main/java/org/apache/ambari/view/huetoambarimigration/migration/hive/historyquery/HiveHistoryQueryMigrationImplementation.java
index f154b39..33d57b4 100644
--- a/contrib/views/hueambarimigration/src/main/java/org/apache/ambari/view/huetoambarimigration/migration/hive/historyquery/HiveHistoryQueryMigrationImplementation.java
+++ b/contrib/views/hueambarimigration/src/main/java/org/apache/ambari/view/huetoambarimigration/migration/hive/historyquery/HiveHistoryQueryMigrationImplementation.java
@@ -138,12 +138,12 @@ public class HiveHistoryQueryMigrationImplementation {
     String epochtime1 = Long.toString(epochtime);
     PreparedStatement prSt = null;
     String revsql = null;
-    if (versionName.contains("1.5")) {
-      prSt = ambaridatabase.insertToHiveHistoryForHiveNext(c, id, maxcount1, epochtime, dirname, username);
-    }
     if (versionName.contains("1.0")) {
       prSt = ambaridatabase.insertToHiveHistoryForHive(c, id, maxcount1, epochtime, dirname, username);
+    } else {
+      prSt = ambaridatabase.insertToHiveHistoryForHiveNext(c, id, maxcount1, epochtime, dirname, username);
     }
+
     logger.info("The actual insert statement is " + prSt);
     prSt.executeUpdate();
     revsql = ambaridatabase.revertSql(id, maxcount1);


[46/50] [abbrv] ambari git commit: AMBARI-19867. Grafana install fails if custom directory's parent does not exist. (Attila Doroszlai via stoader)

Posted by nc...@apache.org.
AMBARI-19867. Grafana install fails if custom directory's parent does not exist. (Attila Doroszlai via stoader)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 4ce8641e9da2ddca2f3a4b137f2860d2e6ed0ec5
Parents: 1756ce5
Author: Attila Doroszlai <ad...@hortonworks.com>
Authored: Mon Feb 6 15:42:29 2017 +0100
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Mon Feb 13 15:45:36 2017 -0500

----------------------------------------------------------------------
 .../common-services/AMBARI_METRICS/0.1.0/package/scripts/ams.py     | 1 +
 .../test/python/stacks/2.0.6/AMBARI_METRICS/test_metrics_grafana.py | 1 +
 2 files changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4ce8641e/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams.py b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams.py
index c3bc600..2886e94 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams.py
+++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams.py
@@ -423,6 +423,7 @@ def ams(name=None, action=None):
                 owner=params.ams_user,
                 group=params.user_group,
                 mode=0755,
+                create_parents = True,
                 recursive_ownership = True
                 )
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ce8641e/ambari-server/src/test/python/stacks/2.0.6/AMBARI_METRICS/test_metrics_grafana.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/AMBARI_METRICS/test_metrics_grafana.py b/ambari-server/src/test/python/stacks/2.0.6/AMBARI_METRICS/test_metrics_grafana.py
index 07b27a6..dc064e4 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/AMBARI_METRICS/test_metrics_grafana.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/AMBARI_METRICS/test_metrics_grafana.py
@@ -91,6 +91,7 @@ class TestMetricsGrafana(RMFTestCase):
                               owner = 'ams',
                               group = 'hadoop',
                               mode=0755,
+                              create_parents = True,
                               recursive_ownership = True
                               )
 


[05/50] [abbrv] ambari git commit: AMBARI-19904. Upgrade: Package Install stuck in Installing state forever. (stoader)

Posted by nc...@apache.org.
AMBARI-19904. Upgrade: Package Install stuck in Installing state forever. (stoader)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 33caec24a8742666a7190f38f5ebd71c54b2a405
Parents: a0ba7fb
Author: Toader, Sebastian <st...@hortonworks.com>
Authored: Fri Feb 10 18:38:37 2017 +0100
Committer: Toader, Sebastian <st...@hortonworks.com>
Committed: Fri Feb 10 18:38:37 2017 +0100

----------------------------------------------------------------------
 .../server/actionmanager/ActionDBAccessor.java  |  5 +-
 .../actionmanager/ActionDBAccessorImpl.java     |  6 +-
 .../server/actionmanager/ActionScheduler.java   | 15 ++---
 .../actionmanager/TestActionScheduler.java      | 65 +++++++++++++++-----
 4 files changed, 66 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/33caec24/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java
index 8aef70d..217fe0a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java
@@ -24,6 +24,7 @@ import java.util.Map;
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.agent.CommandReport;
 import org.apache.ambari.server.agent.ExecutionCommand;
+import org.apache.ambari.server.orm.entities.HostRoleCommandEntity;
 import org.apache.ambari.server.orm.entities.RequestEntity;
 
 public interface ActionDBAccessor {
@@ -58,8 +59,10 @@ public interface ActionDBAccessor {
    * Abort all outstanding operations associated with the given request. This
    * method uses the {@link HostRoleStatus#SCHEDULED_STATES} to determine which
    * {@link HostRoleCommand} instances to abort.
+   *
+   * Returns the list of the aborted operations.
    */
-  public void abortOperation(long requestId);
+  public Collection<HostRoleCommandEntity> abortOperation(long requestId);
 
   /**
    * Mark the task as to have timed out

http://git-wip-us.apache.org/repos/asf/ambari/blob/33caec24/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
index 7837a7b..7881a4b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
@@ -202,7 +202,7 @@ public class ActionDBAccessorImpl implements ActionDBAccessor {
    * {@inheritDoc}
    */
   @Override
-  public void abortOperation(long requestId) {
+  public Collection<HostRoleCommandEntity> abortOperation(long requestId) {
     long now = System.currentTimeMillis();
 
     endRequest(requestId);
@@ -226,8 +226,10 @@ public class ActionDBAccessorImpl implements ActionDBAccessor {
 
     // no need to merge if there's nothing to merge
     if (!commands.isEmpty()) {
-      hostRoleCommandDAO.mergeAll(commands);
+      return hostRoleCommandDAO.mergeAll(commands);
     }
+
+    return Collections.emptyList();
   }
 
   /* (non-Javadoc)

http://git-wip-us.apache.org/repos/asf/ambari/blob/33caec24/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
index fa2ad4f..680c0a6 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
@@ -929,15 +929,16 @@ class ActionScheduler implements Runnable {
         ExecutionCommand c = wrapper.getExecutionCommand();
         transitionToFailedState(stage.getClusterName(), c.getServiceName(),
                 c.getRole(), hostName, now, true);
-        if (c.getRoleCommand().equals(RoleCommand.ACTIONEXECUTE)) {
-          String clusterName = c.getClusterName();
-          processActionDeath(clusterName,
-                  c.getHostname(),
-                  c.getRole());
-        }
       }
     }
-    db.abortOperation(stage.getRequestId());
+    Collection<HostRoleCommandEntity> abortedOperations = db.abortOperation(stage.getRequestId());
+
+    for (HostRoleCommandEntity command: abortedOperations) {
+      if (command.getRoleCommand().equals(RoleCommand.ACTIONEXECUTE)) {
+        String clusterName = stage.getClusterName();
+        processActionDeath(clusterName, command.getHostName(), command.getRole().name());
+      }
+    }
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/33caec24/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
index 653ad2c..6519126 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
@@ -109,6 +109,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.common.collect.ArrayListMultimap;
+import com.google.common.collect.Lists;
 import com.google.common.collect.Multimap;
 import com.google.common.reflect.TypeToken;
 import com.google.inject.AbstractModule;
@@ -508,10 +509,11 @@ public class TestActionScheduler {
     when(db.getCommandsInProgressCount()).thenReturn(stages.size());
     when(db.getStagesInProgress()).thenReturn(stages);
 
-    doAnswer(new Answer<Void>() {
+    doAnswer(new Answer<Collection<HostRoleCommandEntity>>() {
       @Override
-      public Void answer(InvocationOnMock invocation) throws Throwable {
+      public Collection<HostRoleCommandEntity> answer(InvocationOnMock invocation) throws Throwable {
         Long requestId = (Long) invocation.getArguments()[1];
+        List<HostRoleCommandEntity> abortedCommands = Lists.newArrayList();
         for (Stage stage : stages) {
           if (requestId.equals(stage.getRequestId())) {
             for (HostRoleCommand command : stage.getOrderedHostRoleCommands()) {
@@ -519,12 +521,17 @@ public class TestActionScheduler {
                 command.getStatus() == HostRoleStatus.IN_PROGRESS ||
                 command.getStatus() == HostRoleStatus.PENDING) {
                 command.setStatus(HostRoleStatus.ABORTED);
+
+                HostRoleCommandEntity hostRoleCommandEntity = command.constructNewPersistenceEntity();
+                hostRoleCommandEntity.setStage(stage.constructNewPersistenceEntity());
+
+                abortedCommands.add(hostRoleCommandEntity);
               }
             }
           }
         }
 
-        return null;
+        return abortedCommands;
       }
     }).when(db).abortHostRole(anyString(), anyLong(), anyLong(), anyString(), anyString());
 
@@ -1390,10 +1397,12 @@ public class TestActionScheduler {
         return null;
       }
     });
-    doAnswer(new Answer<Void>() {
+    doAnswer(new Answer<Collection<HostRoleCommandEntity>>() {
       @Override
-      public Void answer(InvocationOnMock invocation) throws Throwable {
+      public Collection<HostRoleCommandEntity> answer(InvocationOnMock invocation) throws Throwable {
         Long requestId = (Long) invocation.getArguments()[0];
+        List<HostRoleCommandEntity> abortedCommands = Lists.newArrayList();
+
         for (Stage stage : stages) {
           if (requestId.equals(stage.getRequestId())) {
             for (HostRoleCommand command : stage.getOrderedHostRoleCommands()) {
@@ -1401,12 +1410,17 @@ public class TestActionScheduler {
                   command.getStatus() == HostRoleStatus.IN_PROGRESS ||
                   command.getStatus() == HostRoleStatus.PENDING) {
                 command.setStatus(HostRoleStatus.ABORTED);
+
+                HostRoleCommandEntity hostRoleCommandEntity = command.constructNewPersistenceEntity();
+                hostRoleCommandEntity.setStage(stage.constructNewPersistenceEntity());
+
+                abortedCommands.add(hostRoleCommandEntity);
               }
             }
           }
         }
 
-        return null;
+        return abortedCommands;
       }
     }).when(db).abortOperation(anyLong());
 
@@ -1570,10 +1584,12 @@ public class TestActionScheduler {
         return null;
       }
     });
-    doAnswer(new Answer<Void>() {
+    doAnswer(new Answer<Collection<HostRoleCommandEntity>>() {
       @Override
-      public Void answer(InvocationOnMock invocation) throws Throwable {
+      public Collection<HostRoleCommandEntity> answer(InvocationOnMock invocation) throws Throwable {
         Long requestId = (Long) invocation.getArguments()[0];
+        List<HostRoleCommandEntity> abortedCommands = Lists.newArrayList();
+
         for (Stage stage : stages) {
           if (requestId.equals(stage.getRequestId())) {
             for (HostRoleCommand command : stage.getOrderedHostRoleCommands()) {
@@ -1581,12 +1597,17 @@ public class TestActionScheduler {
                   command.getStatus() == HostRoleStatus.IN_PROGRESS ||
                   command.getStatus() == HostRoleStatus.PENDING) {
                 command.setStatus(HostRoleStatus.ABORTED);
+
+                HostRoleCommandEntity hostRoleCommandEntity = command.constructNewPersistenceEntity();
+                hostRoleCommandEntity.setStage(stage.constructNewPersistenceEntity());
+
+                abortedCommands.add(hostRoleCommandEntity);
               }
             }
           }
         }
 
-        return null;
+        return abortedCommands;
       }
     }).when(db).abortOperation(anyLong());
 
@@ -1755,10 +1776,12 @@ public class TestActionScheduler {
         return null;
       }
     });
-    doAnswer(new Answer<Void>() {
+    doAnswer(new Answer<Collection<HostRoleCommandEntity>>() {
       @Override
-      public Void answer(InvocationOnMock invocation) throws Throwable {
+      public Collection<HostRoleCommandEntity> answer(InvocationOnMock invocation) throws Throwable {
         Long requestId = (Long) invocation.getArguments()[0];
+        List<HostRoleCommandEntity> abortedCommands = Lists.newArrayList();
+
         for (Stage stage : stages) {
           if (requestId.equals(stage.getRequestId())) {
             for (HostRoleCommand command : stage.getOrderedHostRoleCommands()) {
@@ -1766,12 +1789,17 @@ public class TestActionScheduler {
                   command.getStatus() == HostRoleStatus.IN_PROGRESS ||
                   command.getStatus() == HostRoleStatus.PENDING) {
                 command.setStatus(HostRoleStatus.ABORTED);
+
+                HostRoleCommandEntity hostRoleCommandEntity = command.constructNewPersistenceEntity();
+                hostRoleCommandEntity.setStage(stage.constructNewPersistenceEntity());
+
+                abortedCommands.add(hostRoleCommandEntity);
               }
             }
           }
         }
 
-        return null;
+        return abortedCommands;
       }
     }).when(db).abortOperation(anyLong());
 
@@ -2316,10 +2344,12 @@ public class TestActionScheduler {
       }
     });
 
-    doAnswer(new Answer<Void>() {
+    doAnswer(new Answer<Collection<HostRoleCommandEntity>>() {
       @Override
-      public Void answer(InvocationOnMock invocation) throws Throwable {
+      public Collection<HostRoleCommandEntity> answer(InvocationOnMock invocation) throws Throwable {
         Long requestId = (Long) invocation.getArguments()[0];
+        List<HostRoleCommandEntity> abortedCommands = Lists.newArrayList();
+
         for (Stage stage : stagesInProgress) {
           if (requestId.equals(stage.getRequestId())) {
             for (HostRoleCommand command : stage.getOrderedHostRoleCommands()) {
@@ -2327,12 +2357,17 @@ public class TestActionScheduler {
                       command.getStatus() == HostRoleStatus.IN_PROGRESS ||
                       command.getStatus() == HostRoleStatus.PENDING) {
                 command.setStatus(HostRoleStatus.ABORTED);
+
+                HostRoleCommandEntity hostRoleCommandEntity = command.constructNewPersistenceEntity();
+                hostRoleCommandEntity.setStage(stage.constructNewPersistenceEntity());
+
+                abortedCommands.add(hostRoleCommandEntity);
               }
             }
           }
         }
 
-        return null;
+        return abortedCommands;
       }
     }).when(db).abortOperation(anyLong());
 


[10/50] [abbrv] ambari git commit: AMBARI-19971. HiveServerInteractive. (1). Use the correct value for Node(s) used for running LLAP Daemon(s). (2). Set 'num_llap_nodes' calculated value only for non Ambari managed queue.

Posted by nc...@apache.org.
AMBARI-19971. HiveServerInteractive. (1). Use the correct value for Node(s) used for running LLAP Daemon(s). (2). Set 'num_llap_nodes' calculated value only for non Ambari managed queue.


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: f4c83843674764918bd50443705af1fce9852a2b
Parents: 38a17a7
Author: Swapan Shridhar <ss...@hortonworks.com>
Authored: Fri Feb 10 13:29:41 2017 -0800
Committer: Swapan Shridhar <ss...@hortonworks.com>
Committed: Fri Feb 10 15:13:48 2017 -0800

----------------------------------------------------------------------
 .../package/scripts/hive_server_interactive.py  | 12 ++---
 .../0.12.0.2.0/package/scripts/params_linux.py  |  2 +
 .../HIVE/configuration/hive-interactive-env.xml |  4 +-
 .../stacks/HDP/2.5/services/stack_advisor.py    |  9 +++-
 .../HIVE/configuration/hive-interactive-env.xml | 31 ++++++++++++-
 .../stacks/2.5/common/test_stack_advisor.py     | 49 ++++++++++++++------
 6 files changed, 83 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f4c83843/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
index 1f1d9a8..2ab48ae 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
@@ -281,10 +281,9 @@ class HiveServerInteractiveDefault(HiveServerInteractive):
 
       unique_name = "llap-slider%s" % datetime.utcnow().strftime('%Y-%m-%d_%H-%M-%S')
 
-      cmd = format("{stack_root}/current/hive-server2-hive2/bin/hive --service llap --instances {params.num_llap_nodes}"
-                   " --slider-am-container-mb {params.slider_am_container_mb} --size {params.llap_daemon_container_size}m"
-                   " --cache {params.hive_llap_io_mem_size}m --xmx {params.llap_heap_size}m --loglevel {params.llap_log_level}"
-                   " {params.llap_extra_slider_opts} --output {LLAP_PACKAGE_CREATION_PATH}/{unique_name}")
+      cmd = format("{stack_root}/current/hive-server2-hive2/bin/hive --service llap --slider-am-container-mb {params.slider_am_container_mb} "
+                   "--size {params.llap_daemon_container_size}m --cache {params.hive_llap_io_mem_size}m --xmx {params.llap_heap_size}m "
+                   "--loglevel {params.llap_log_level} {params.llap_extra_slider_opts} --output {LLAP_PACKAGE_CREATION_PATH}/{unique_name}")
 
       # Append params that are supported from Hive llap GA version.
       if params.stack_supports_hive_interactive_ga:
@@ -300,11 +299,12 @@ class HiveServerInteractiveDefault(HiveServerInteractive):
         else:
           Logger.info("Setting slider_placement: 4, as llap_daemon_container_size : {0} <= 0.5 * "
                      "YARN NodeManager Memory({1})".format(params.llap_daemon_container_size, params.yarn_nm_mem))
-        cmd += format(" --slider-placement {slider_placement} --skiphadoopversion --skiphbasecp")
+        cmd += format(" --slider-placement {slider_placement} --skiphadoopversion --skiphbasecp --instances {params.num_llap_daemon_running_nodes}")
 
         # Setup the logger for the ga version only
         cmd += format(" --logger {params.llap_logger}")
-
+      else:
+        cmd += format(" --instances {params.num_llap_nodes}")
       if params.security_enabled:
         llap_keytab_splits = params.hive_llap_keytab_file.split("/")
         Logger.debug("llap_keytab_splits : {0}".format(llap_keytab_splits))

http://git-wip-us.apache.org/repos/asf/ambari/blob/f4c83843/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
index a5618ca..936b194 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
@@ -685,6 +685,8 @@ if has_hive_interactive:
   num_retries_for_checking_llap_status = default('/configurations/hive-interactive-env/num_retries_for_checking_llap_status', 10)
   # Used in LLAP slider package creation
   yarn_nm_mem = config['configurations']['yarn-site']['yarn.nodemanager.resource.memory-mb']
+  if stack_supports_hive_interactive_ga:
+    num_llap_daemon_running_nodes = config['configurations']['hive-interactive-env']['num_llap_nodes_for_llap_daemons']
   num_llap_nodes = config['configurations']['hive-interactive-env']['num_llap_nodes']
   llap_daemon_container_size = config['configurations']['hive-interactive-site']['hive.llap.daemon.yarn.container.mb']
   llap_log_level = config['configurations']['hive-interactive-env']['llap_log_level']

http://git-wip-us.apache.org/repos/asf/ambari/blob/f4c83843/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-interactive-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-interactive-env.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-interactive-env.xml
index e636e0c..ef9be76 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-interactive-env.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-interactive-env.xml
@@ -45,8 +45,8 @@
   <property>
     <name>num_llap_nodes</name>
     <value>1</value>
-    <description>The number of Hive LLAP daemons to run.</description>
-    <display-name>Number of LLAP Nodes</display-name>
+    <description>Number of nodes used by Hive's LLAP, which includes nodes running : LLAP daemon, Slider and Tez App Master(s).</description>
+    <display-name>Number of nodes used by Hive's LLAP</display-name>
     <value-attributes>
       <type>int</type>
       <minimum>1</minimum>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f4c83843/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py
index 99b6776..9fe8fc3 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py
@@ -951,10 +951,13 @@ class HDP25StackAdvisor(HDP24StackAdvisor):
       Logger.info("DBG: Calculated '{0}' queue available capacity : {1}, using following: llap_daemon_selected_queue_cap : {2}, "
                     "yarn_min_container_size : {3}".format(llap_daemon_selected_queue_name, total_llap_mem_normalized,
                                                            llap_daemon_selected_queue_cap, yarn_min_container_size))
-      '''Rounding up numNodes so that we run more daemons, and utilitze more CPUs. The rest of the calcaulkations will take care of cutting this down if required'''
+      '''Rounding up numNodes so that we run more daemons, and utilitze more CPUs. The rest of the calcaulations will take care of cutting this down if required'''
       num_llap_nodes_requested = math.ceil(total_llap_mem_normalized / yarn_nm_mem_in_mb_normalized)
       Logger.info("DBG: Calculated 'num_llap_nodes_requested' : {0}, using following: total_llap_mem_normalized : {1}, "
                     "yarn_nm_mem_in_mb_normalized : {2}".format(num_llap_nodes_requested, total_llap_mem_normalized, yarn_nm_mem_in_mb_normalized))
+      # Pouplate the 'num_llap_nodes_requested' in config 'num_llap_nodes', a read only config for non-Ambari managed queue case.
+      putHiveInteractiveEnvProperty('num_llap_nodes', num_llap_nodes_requested)
+      Logger.info("Setting config 'num_llap_nodes' as : {0}".format(num_llap_nodes_requested))
       queue_am_fraction_perc = float(self.__getQueueAmFractionFromCapacityScheduler(capacity_scheduler_properties, llap_daemon_selected_queue_name))
       hive_tez_am_cap_available = queue_am_fraction_perc * total_llap_mem_normalized
       Logger.info("DBG: Calculated 'hive_tez_am_cap_available' : {0}, using following: queue_am_fraction_perc : {1}, "
@@ -1182,7 +1185,8 @@ class HDP25StackAdvisor(HDP24StackAdvisor):
       Logger.info("User requested num_llap_nodes : {0}, but used/adjusted value for calculations is : {1}".format(num_llap_nodes_requested, num_llap_nodes))
     else:
       Logger.info("Used num_llap_nodes for calculations : {0}".format(num_llap_nodes_requested))
-    putHiveInteractiveEnvProperty('num_llap_nodes', num_llap_nodes)
+    putHiveInteractiveEnvProperty('num_llap_nodes_for_llap_daemons', num_llap_nodes)
+    Logger.info("Setting config 'num_llap_nodes_for_llap_daemons' as : {0}".format(num_llap_nodes))
 
     llap_container_size = long(llap_daemon_mem_per_node)
     putHiveInteractiveSiteProperty('hive.llap.daemon.yarn.container.mb', llap_container_size)
@@ -1243,6 +1247,7 @@ class HDP25StackAdvisor(HDP24StackAdvisor):
     putHiveInteractiveSitePropertyAttribute('hive.server2.tez.sessions.per.default.queue', "minimum", 1)
     putHiveInteractiveSitePropertyAttribute('hive.server2.tez.sessions.per.default.queue', "maximum", 1)
     putHiveInteractiveEnvProperty('num_llap_nodes', 0)
+    putHiveInteractiveEnvProperty('num_llap_nodes_for_llap_daemons', 0)
     putHiveInteractiveEnvPropertyAttribute('num_llap_nodes', "minimum", 1)
     putHiveInteractiveEnvPropertyAttribute('num_llap_nodes', "maximum", node_manager_cnt)
     putHiveInteractiveSiteProperty('hive.llap.daemon.yarn.container.mb', yarn_min_container_size)

http://git-wip-us.apache.org/repos/asf/ambari/blob/f4c83843/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/hive-interactive-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/hive-interactive-env.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/hive-interactive-env.xml
index af656f4..b659205 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/hive-interactive-env.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/hive-interactive-env.xml
@@ -62,7 +62,36 @@
     </value-attributes>
     <on-ambari-upgrade add="false"/>
   </property>
-
+  <property>
+    <name>num_llap_nodes_for_llap_daemons</name>
+    <value>1</value>
+    <description>Number of Node(s) on which Hive LLAP daemon runs.</description>
+    <display-name>Number of Node(s) for running Hive LLAP daemon</display-name>
+    <value-attributes>
+      <type>int</type>
+      <minimum>1</minimum>
+      <increment-step>1</increment-step>
+    </value-attributes>
+    <depends-on>
+      <property>
+        <type>hive-interactive-env</type>
+        <name>num_llap_nodes</name>
+      </property>
+      <property>
+        <type>hive-interactive-env</type>
+        <name>enable_hive_interactive</name>
+      </property>
+      <property>
+        <type>hive-interactive-site</type>
+        <name>hive.llap.daemon.queue.name</name>
+      </property>
+      <property>
+        <type>capacity-scheduler</type>
+        <name>yarn.scheduler.capacity.root.queues</name>
+      </property>
+    </depends-on>
+    <on-ambari-upgrade add="true"/>
+  </property>
 
 
   <!-- hive-env.sh -->

http://git-wip-us.apache.org/repos/asf/ambari/blob/f4c83843/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py
index ec56bad..ef83bca 100644
--- a/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py
@@ -1169,8 +1169,8 @@ class TestHDP25StackAdvisor(TestCase):
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.server2.tez.sessions.per.default.queue'], '1')
     self.assertEquals(configurations['hive-interactive-site']['property_attributes']['hive.server2.tez.sessions.per.default.queue'], {'minimum': '1', 'maximum': '4'})
 
-    self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes'], 3)
-
+    self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes_for_llap_daemons'], 3)
+    self.assertTrue('num_llap_nodes' not in configurations['hive-interactive-env']['properties'])
 
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.yarn.container.mb'], '9216')
 
@@ -1369,6 +1369,8 @@ class TestHDP25StackAdvisor(TestCase):
     self.assertEquals(configurations['hive-interactive-site']['property_attributes']['hive.server2.tez.sessions.per.default.queue'], {'maximum': '3.0'})
 
     self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes'], 3)
+    self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes_for_llap_daemons'], 3)
+
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.yarn.container.mb'], '9548')
 
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.num.executors'], '1')
@@ -1561,7 +1563,9 @@ class TestHDP25StackAdvisor(TestCase):
 
     self.assertEquals(configurations['hive-interactive-site']['property_attributes']['hive.server2.tez.sessions.per.default.queue'], {'maximum': '4'})
 
-    self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes'], 3)
+    self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes_for_llap_daemons'], 3)
+    self.assertTrue('num_llap_nodes' not in configurations['hive-interactive-env']['properties'])
+
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.yarn.container.mb'], '48128')
 
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.num.executors'], '1')
@@ -1762,7 +1766,9 @@ class TestHDP25StackAdvisor(TestCase):
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.server2.tez.sessions.per.default.queue'], '1')
     self.assertEquals(configurations['hive-interactive-site']['property_attributes']['hive.server2.tez.sessions.per.default.queue'], {'maximum': '4', 'minimum': '1'})
 
-    self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes'], 3)
+    self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes_for_llap_daemons'], 3)
+    self.assertTrue('num_llap_nodes' not in configurations['hive-interactive-env']['properties'])
+
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.yarn.container.mb'], '38912')
 
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.num.executors'], '4')
@@ -1953,14 +1959,15 @@ class TestHDP25StackAdvisor(TestCase):
     configurations = {
     }
 
-
     self.stackAdvisor.recommendYARNConfigurations(configurations, clusterData, services, self.hosts)
-
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.server2.tez.sessions.per.default.queue'], '1')
     self.assertEquals(configurations['hive-interactive-site']['property_attributes']['hive.server2.tez.sessions.per.default.queue'], {'minimum': '1', 'maximum': '4'})
     self.assertEqual(configurations['capacity-scheduler']['properties'], {'capacity-scheduler': 'yarn.scheduler.capacity.root.accessible-node-labels=*\nyarn.scheduler.capacity.maximum-am-resource-percent=1\nyarn.scheduler.capacity.node-locality-delay=40\nyarn.scheduler.capacity.root.capacity=100\nyarn.scheduler.capacity.root.default.state=RUNNING\nyarn.scheduler.capacity.root.default.maximum-capacity=66.0\nyarn.scheduler.capacity.root.queues=default,llap\nyarn.scheduler.capacity.maximum-applications=10000\nyarn.scheduler.capacity.root.default.user-limit-factor=1\nyarn.scheduler.capacity.root.acl_administer_queue=*\nyarn.scheduler.capacity.root.default.acl_submit_applications=*\nyarn.scheduler.capacity.root.default.capacity=66.0\nyarn.scheduler.capacity.queue-mappings-override.enable=false\nyarn.scheduler.capacity.root.llap.user-limit-factor=1\nyarn.scheduler.capacity.root.llap.state=RUNNING\nyarn.scheduler.capacity.root.llap.ordering-policy=fifo\nyarn.scheduler.capacity.root.llap.mi
 nimum-user-limit-percent=100\nyarn.scheduler.capacity.root.llap.maximum-capacity=34.0\nyarn.scheduler.capacity.root.llap.capacity=34.0\nyarn.scheduler.capacity.root.llap.acl_submit_applications=hive\nyarn.scheduler.capacity.root.llap.acl_administer_queue=hive\nyarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1'})
 
-    self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes'], 3)
+    self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes_for_llap_daemons'], 3)
+    self.assertTrue('num_llap_nodes' not in configurations['hive-interactive-env']['properties'])
+
+    self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes_for_llap_daemons'], 3)
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.yarn.container.mb'], '10571')
 
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.num.executors'], '3')
@@ -1988,7 +1995,7 @@ class TestHDP25StackAdvisor(TestCase):
   #         Small configuration test with 3 nodes - 'yarn.nodemanager.resource.memory-mb' : 2046 and 'yarn.scheduler.minimum-allocation-mb' : 682, representing a small GCE cluster.
   #
   #         Expected : Configurations values recommended for llap related configs.
-  def test_recommendYARNConfigurations_three_node_manager_llap_configs_updated_2(self):
+  def test_recommendYARNConfigurations_three_node_manager_llap_configs_updated_3(self):
     # 3 node managers and yarn.nodemanager.resource.memory-mb": "12288"
     services = {
       "services": [{
@@ -2158,7 +2165,9 @@ class TestHDP25StackAdvisor(TestCase):
     self.assertEquals(configurations['hive-interactive-site']['property_attributes']['hive.server2.tez.sessions.per.default.queue'], {'minimum': '1', 'maximum': '3.0'})
     self.assertEqual(configurations['capacity-scheduler']['properties'], {'capacity-scheduler': 'yarn.scheduler.capacity.root.accessible-node-labels=*\nyarn.scheduler.capacity.maximum-am-resource-percent=1\nyarn.scheduler.capacity.node-locality-delay=40\nyarn.scheduler.capacity.root.capacity=100\nyarn.scheduler.capacity.root.default.state=RUNNING\nyarn.scheduler.capacity.root.default.maximum-capacity=66.0\nyarn.scheduler.capacity.root.queues=default,llap\nyarn.scheduler.capacity.maximum-applications=10000\nyarn.scheduler.capacity.root.default.user-limit-factor=1\nyarn.scheduler.capacity.root.acl_administer_queue=*\nyarn.scheduler.capacity.root.default.acl_submit_applications=*\nyarn.scheduler.capacity.root.default.capacity=66.0\nyarn.scheduler.capacity.queue-mappings-override.enable=false\nyarn.scheduler.capacity.root.llap.user-limit-factor=1\nyarn.scheduler.capacity.root.llap.state=RUNNING\nyarn.scheduler.capacity.root.llap.ordering-policy=fifo\nyarn.scheduler.capacity.root.llap.mi
 nimum-user-limit-percent=100\nyarn.scheduler.capacity.root.llap.maximum-capacity=34.0\nyarn.scheduler.capacity.root.llap.capacity=34.0\nyarn.scheduler.capacity.root.llap.acl_submit_applications=hive\nyarn.scheduler.capacity.root.llap.acl_administer_queue=hive\nyarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1'})
 
-    self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes'], 3)
+    self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes_for_llap_daemons'], 3)
+    self.assertTrue('num_llap_nodes' not in configurations['hive-interactive-env']['properties'])
+
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.yarn.container.mb'], '682')
 
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.num.executors'], '1')
@@ -2354,7 +2363,8 @@ class TestHDP25StackAdvisor(TestCase):
     self.assertEqual(configurations['capacity-scheduler']['properties'], {'capacity-scheduler': 'yarn.scheduler.capacity.root.accessible-node-labels=*\nyarn.scheduler.capacity.maximum-am-resource-percent=1\nyarn.scheduler.capacity.node-locality-delay=40\nyarn.scheduler.capacity.root.capacity=100\nyarn.scheduler.capacity.root.default.state=RUNNING\nyarn.scheduler.capacity.root.default.maximum-capacity=0.0\nyarn.scheduler.capacity.root.queues=default,llap\nyarn.scheduler.capacity.maximum-applications=10000\nyarn.scheduler.capacity.root.default.user-limit-factor=1\nyarn.scheduler.capacity.root.acl_administer_queue=*\nyarn.scheduler.capacity.root.default.acl_submit_applications=*\nyarn.scheduler.capacity.root.default.capacity=0.0\nyarn.scheduler.capacity.queue-mappings-override.enable=false\nyarn.scheduler.capacity.root.llap.user-limit-factor=1\nyarn.scheduler.capacity.root.llap.state=RUNNING\nyarn.scheduler.capacity.root.llap.ordering-policy=fifo\nyarn.scheduler.capacity.root.llap.mini
 mum-user-limit-percent=100\nyarn.scheduler.capacity.root.llap.maximum-capacity=100.0\nyarn.scheduler.capacity.root.llap.capacity=100.0\nyarn.scheduler.capacity.root.llap.acl_submit_applications=hive\nyarn.scheduler.capacity.root.llap.acl_administer_queue=hive\nyarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1'})
     self.assertEquals(configurations['hive-interactive-site']['property_attributes']['hive.server2.tez.sessions.per.default.queue'], {'maximum': '4'})
 
-    self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes'], 3)
+    self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes_for_llap_daemons'], 3)
+    self.assertTrue('num_llap_nodes' not in configurations['hive-interactive-env']['properties'])
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.yarn.container.mb'], '202752')
 
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.num.executors'], '3')
@@ -2557,7 +2567,9 @@ class TestHDP25StackAdvisor(TestCase):
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.server2.tez.sessions.per.default.queue'], '1.0')
     self.assertEquals(configurations['hive-interactive-site']['property_attributes']['hive.server2.tez.sessions.per.default.queue'], {'maximum': '4', 'minimum': '1'})
 
-    self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes'], 5)
+    self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes_for_llap_daemons'], 3)
+    self.assertTrue('num_llap_nodes' not in configurations['hive-interactive-env']['properties'])
+
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.yarn.container.mb'], '36864')
 
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.num.executors'], '4')
@@ -2754,7 +2766,9 @@ class TestHDP25StackAdvisor(TestCase):
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.server2.tez.sessions.per.default.queue'], '1')
     self.assertEquals(configurations['hive-interactive-site']['property_attributes']['hive.server2.tez.sessions.per.default.queue'], {'maximum': '4', 'minimum': '1'})
 
-    self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes'], 3)
+    self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes_for_llap_daemons'], 3)
+    self.assertTrue('num_llap_nodes' not in configurations['hive-interactive-env']['properties'])
+
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.yarn.container.mb'], '203918')
 
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.num.executors'], '10')
@@ -2947,7 +2961,9 @@ class TestHDP25StackAdvisor(TestCase):
     self.assertEqual(configurations['capacity-scheduler']['properties'], {'capacity-scheduler': 'yarn.scheduler.capacity.root.accessible-node-labels=*\nyarn.scheduler.capacity.maximum-am-resource-percent=1\nyarn.scheduler.capacity.node-locality-delay=40\nyarn.scheduler.capacity.root.capacity=100\nyarn.scheduler.capacity.root.default.state=RUNNING\nyarn.scheduler.capacity.root.default.maximum-capacity=0.0\nyarn.scheduler.capacity.root.queues=default,llap\nyarn.scheduler.capacity.maximum-applications=10000\nyarn.scheduler.capacity.root.default.user-limit-factor=1\nyarn.scheduler.capacity.root.acl_administer_queue=*\nyarn.scheduler.capacity.root.default.acl_submit_applications=*\nyarn.scheduler.capacity.root.default.capacity=0.0\nyarn.scheduler.capacity.queue-mappings-override.enable=false\nyarn.scheduler.capacity.root.llap.user-limit-factor=1\nyarn.scheduler.capacity.root.llap.state=RUNNING\nyarn.scheduler.capacity.root.llap.ordering-policy=fifo\nyarn.scheduler.capacity.root.llap.mini
 mum-user-limit-percent=100\nyarn.scheduler.capacity.root.llap.maximum-capacity=100.0\nyarn.scheduler.capacity.root.llap.capacity=100.0\nyarn.scheduler.capacity.root.llap.acl_submit_applications=hive\nyarn.scheduler.capacity.root.llap.acl_administer_queue=hive\nyarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1'})
     self.assertEquals(configurations['hive-interactive-site']['property_attributes']['hive.server2.tez.sessions.per.default.queue'], {'maximum': '4'})
 
-    self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes'], 3)
+    self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes_for_llap_daemons'], 3)
+    self.assertTrue('num_llap_nodes' not in configurations['hive-interactive-env']['properties'])
+
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.yarn.container.mb'], '202752')
 
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.num.executors'], '3')
@@ -3139,6 +3155,8 @@ class TestHDP25StackAdvisor(TestCase):
     self.assertEquals(configurations['hive-interactive-site']['property_attributes']['hive.server2.tez.sessions.per.default.queue'], {'maximum': '4'})
 
     self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes'], 3)
+    self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes_for_llap_daemons'], 3)
+
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.yarn.container.mb'], '202752')
 
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.num.executors'], '3')
@@ -3361,6 +3379,8 @@ class TestHDP25StackAdvisor(TestCase):
     self.assertEquals(configurations['hive-interactive-site']['property_attributes']['hive.server2.tez.sessions.per.default.queue'], {'maximum': '4', 'minimum': '1'})
 
     self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes'], 3)
+    self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes_for_llap_daemons'], 3)
+
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.yarn.container.mb'], '204288')
 
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.num.executors'], '3')
@@ -3580,6 +3600,7 @@ class TestHDP25StackAdvisor(TestCase):
     self.stackAdvisor.recommendYARNConfigurations(configurations, clusterData, services, self.hosts)
 
     self.assertEqual(configurations['hive-interactive-env']['properties']['num_llap_nodes'], '0')
+    self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes_for_llap_daemons'], 0)
 
 
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.yarn.container.mb'], '2048')
@@ -3962,6 +3983,8 @@ class TestHDP25StackAdvisor(TestCase):
     self.assertEquals(configurations['hive-interactive-site']['property_attributes']['hive.server2.tez.sessions.per.default.queue'], {'maximum': '4', 'minimum': '1'})
 
     self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes'], 1)
+    self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes_for_llap_daemons'], 1)
+
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.yarn.container.mb'], '200704')
 
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.num.executors'], '3')


[20/50] [abbrv] ambari git commit: AMBARI-19970 : AMS graphs are not present on cluster with SSL. (avijayan)

Posted by nc...@apache.org.
AMBARI-19970 : AMS graphs are not present on cluster with SSL. (avijayan)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 6eac0f57a61da4e76b175f0de43ab315a665b9c2
Parents: d510063
Author: Aravindan Vijayan <av...@hortonworks.com>
Authored: Sun Feb 12 08:34:41 2017 -0800
Committer: Aravindan Vijayan <av...@hortonworks.com>
Committed: Sun Feb 12 08:34:58 2017 -0800

----------------------------------------------------------------------
 .../conf/hadoop-metrics2-hbase.properties.j2    | 49 -----------------
 .../src/main/conf/hadoop-metrics2.properties.j2 | 58 --------------------
 .../hadoop-metrics2-hbase.properties.j2         |  4 ++
 3 files changed, 4 insertions(+), 107 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6eac0f57/ambari-metrics/ambari-metrics-hadoop-sink/src/main/conf/hadoop-metrics2-hbase.properties.j2
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-hadoop-sink/src/main/conf/hadoop-metrics2-hbase.properties.j2 b/ambari-metrics/ambari-metrics-hadoop-sink/src/main/conf/hadoop-metrics2-hbase.properties.j2
deleted file mode 100644
index c819301..0000000
--- a/ambari-metrics/ambari-metrics-hadoop-sink/src/main/conf/hadoop-metrics2-hbase.properties.j2
+++ /dev/null
@@ -1,49 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# See http://wiki.apache.org/hadoop/GangliaMetrics
-#
-# Make sure you know whether you are using ganglia 3.0 or 3.1.
-# If 3.1, you will have to patch your hadoop instance with HADOOP-4675
-# And, yes, this file is named hadoop-metrics.properties rather than
-# hbase-metrics.properties because we're leveraging the hadoop metrics
-# package and hadoop-metrics.properties is an hardcoded-name, at least
-# for the moment.
-#
-# See also http://hadoop.apache.org/hbase/docs/current/metrics.html
-
-# HBase-specific configuration to reset long-running stats (e.g. compactions)
-# If this variable is left out, then the default is no expiration.
-hbase.extendedperiod = 3600
-
-# Configuration of the "hbase" context for timeline metrics service
-hbase.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
-hbase.period=10
-hbase.collector={{timeline_server_hosts}}:6188
-
-# Configuration of the "jvm" context for timeline metrics service
-jvm.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
-jvm.period=10
-jvm.collector={{timeline_server_hosts}}:6188
-
-# Configuration of the "rpc" context for timeline metrics service
-rpc.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
-rpc.period=10
-rpc.collector={{timeline_server_hosts}}:6188
-
-# Following hadoop example
-hbase.sink.timeline.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
-hbase.sink.timeline.period=10
-hbase.sink.timeline.collector=http://{{timeline_server_hosts}}:6188
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/6eac0f57/ambari-metrics/ambari-metrics-hadoop-sink/src/main/conf/hadoop-metrics2.properties.j2
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-hadoop-sink/src/main/conf/hadoop-metrics2.properties.j2 b/ambari-metrics/ambari-metrics-hadoop-sink/src/main/conf/hadoop-metrics2.properties.j2
deleted file mode 100644
index ec1377d..0000000
--- a/ambari-metrics/ambari-metrics-hadoop-sink/src/main/conf/hadoop-metrics2.properties.j2
+++ /dev/null
@@ -1,58 +0,0 @@
-{#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#}
-
-# 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.
-
-# syntax: [prefix].[source|sink|jmx].[instance].[options]
-# See package.html for org.apache.hadoop.metrics2 for details
-
-{% if has_ganglia_server %}
-*.period=60
-
-*.sink.timeline.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
-*.sink.timeline.period=10
-
-
-# Hook up to the server
-datanode.sink.timeline.collector=http://localhost:6188
-namenode.sink.timeline.collector=http://localhost:6188
-resourcemanager.sink.timeline.collector=http://localhost:6188
-nodemanager.sink.timeline.collector=http://localhost:6188
-historyserver.sink.timeline.collector=http://localhost:6188
-journalnode.sink.timeline.collector=http://localhost:6188
-nimbus.sink.timeline.collector=http://localhost:6188
-supervisor.sink.timeline.collector=http://localhost:6188
-maptask.sink.timeline.collector=http://localhost:6188
-reducetask.sink.timeline.collector=http://localhost:6188
-
-resourcemanager.sink.ganglia.tagsForPrefix.yarn=Queue
-
-{% endif %}

http://git-wip-us.apache.org/repos/asf/ambari/blob/6eac0f57/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/hadoop-metrics2-hbase.properties.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/hadoop-metrics2-hbase.properties.j2 b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/hadoop-metrics2-hbase.properties.j2
index 8c20f2b..8c6f86f 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/hadoop-metrics2-hbase.properties.j2
+++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/hadoop-metrics2-hbase.properties.j2
@@ -42,16 +42,19 @@ hbase.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
 hbase.period=30
 hbase.collector.hosts={{ams_collector_hosts}}
 hbase.port={{metric_collector_port}}
+hbase.protocol={{metric_collector_protocol}}
 
 jvm.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
 jvm.period=30
 jvm.collector.hosts={{ams_collector_hosts}}
 jvm.port={{metric_collector_port}}
+jvm.protocol={{metric_collector_protocol}}
 
 rpc.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
 rpc.period=30
 rpc.collector.hosts={{ams_collector_hosts}}
 rpc.port={{metric_collector_port}}
+rpc.protocol={{metric_collector_protocol}}
 
 *.timeline.plugin.urls=file:///usr/lib/ambari-metrics-hadoop-sink/ambari-metrics-hadoop-sink.jar
 *.sink.timeline.slave.host.name={{hostname}}
@@ -60,6 +63,7 @@ hbase.sink.timeline.period={{metrics_collection_period}}
 hbase.sink.timeline.sendInterval={{metrics_report_interval}}000
 hbase.sink.timeline.collector.hosts={{ams_collector_hosts}}
 hbase.sink.timeline.port={{metric_collector_port}}
+hbase.sink.timeline.protocol={{metric_collector_protocol}}
 hbase.sink.timeline.serviceName-prefix=ams
 
 # HTTPS properties


[44/50] [abbrv] ambari git commit: AMBARI-19795 Ambari upgrade to not add ranger plugin configs under ranger plugin supported services (mugdha)

Posted by nc...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-security.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-security.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-security.xml
index 3c0b29f..562684b 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-security.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-security.xml
@@ -23,19 +23,19 @@
     <name>ranger.plugin.yarn.service.name</name>
     <value>{{repo_name}}</value>
     <description>Name of the Ranger service containing policies for this Yarn instance</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.yarn.policy.source.impl</name>
     <value>org.apache.ranger.admin.client.RangerAdminRESTClient</value>
     <description>Class to retrieve policies from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.yarn.policy.rest.url</name>
     <value>{{policymgr_mgr_url}}</value>
     <description>URL to Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
     <depends-on>
       <property>
         <type>admin-properties</type>
@@ -47,18 +47,18 @@
     <name>ranger.plugin.yarn.policy.rest.ssl.config.file</name>
     <value>/etc/hadoop/conf/ranger-policymgr-ssl-yarn.xml</value>
     <description>Path to the file containing SSL details to contact Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.yarn.policy.pollIntervalMs</name>
     <value>30000</value>
     <description>How often to poll for changes in policies?</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.yarn.policy.cache.dir</name>
     <value>/etc/ranger/{{repo_name}}/policycache</value>
     <description>Directory where Ranger policies are cached after successful retrieval from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-audit.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-audit.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-audit.xml
index efeea5f..0044680 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-audit.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-audit.xml
@@ -24,7 +24,7 @@
     <name>xasecure.audit.is.enabled</name>
     <value>true</value>
     <description>Is Audit enabled?</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
@@ -41,7 +41,7 @@
         <name>xasecure.audit.destination.hdfs</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
@@ -54,14 +54,14 @@
         <name>xasecure.audit.destination.hdfs.dir</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
     <name>xasecure.audit.destination.hdfs.batch.filespool.dir</name>
     <value>/var/log/atlas/audit/hdfs/spool</value>
     <description>/var/log/atlas/audit/hdfs/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
@@ -78,7 +78,7 @@
         <name>xasecure.audit.destination.solr</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
@@ -94,7 +94,7 @@
         <name>ranger.audit.solr.urls</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
@@ -107,14 +107,14 @@
         <name>ranger.audit.solr.zookeepers</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
     <name>xasecure.audit.destination.solr.batch.filespool.dir</name>
     <value>/var/log/atlas/audit/solr/spool</value>
     <description>/var/log/atlas/audit/solr/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
@@ -125,7 +125,7 @@
     <value-attributes>
       <type>boolean</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-plugin-properties.xml
index 977127c..fd623cb 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-plugin-properties.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-plugin-properties.xml
@@ -26,7 +26,7 @@
     <display-name>Policy user for Atlas</display-name>
     <description>This user must be system user and also present at Ranger
       admin portal</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
@@ -36,7 +36,7 @@
     <value-attributes>
       <empty-value-valid>true</empty-value-valid>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
@@ -54,7 +54,7 @@
       <type>boolean</type>
       <overridable>false</overridable>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
@@ -63,7 +63,7 @@
     <display-name>Ranger repository config user</display-name>
     <description>Used for repository creation on ranger admin
     </description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
@@ -76,55 +76,7 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_admin_username</name>
-    <value></value>
-    <display-name>External Ranger admin username</display-name>
-    <description>Add ranger default admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_admin_password</name>
-    <value></value>
-    <display-name>External Ranger admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_username</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin username</display-name>
-    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_password</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
 </configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-policymgr-ssl.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-policymgr-ssl.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-policymgr-ssl.xml
index 349c829..dcffb63 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-policymgr-ssl.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-policymgr-ssl.xml
@@ -24,7 +24,7 @@
     <name>xasecure.policymgr.clientssl.keystore</name>
     <value>/usr/hdp/current/atlas-server/conf/ranger-plugin-keystore.jks</value>
     <description>Java Keystore files</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
@@ -35,14 +35,14 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
     <name>xasecure.policymgr.clientssl.truststore</name>
     <value>/usr/hdp/current/atlas-server/conf/ranger-plugin-truststore.jks</value>
     <description>java truststore file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
@@ -53,21 +53,21 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
     <property>
     <name>xasecure.policymgr.clientssl.keystore.credential.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>java keystore credential file</description>
-      <on-ambari-upgrade add="true"/>
+      <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
     <name>xasecure.policymgr.clientssl.truststore.credential.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>java truststore credential file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
 </configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-security.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-security.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-security.xml
index c5588d1..8fac342 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-security.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-security.xml
@@ -23,21 +23,21 @@
     <name>ranger.plugin.atlas.service.name</name>
     <value>{{repo_name}}</value>
     <description>Name of the Ranger service containing Atlas policies</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
     <name>ranger.plugin.atlas.policy.source.impl</name>
     <value>org.apache.ranger.admin.client.RangerAdminRESTClient</value>
     <description>Class to retrieve policies from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
     <name>ranger.plugin.atlas.policy.rest.url</name>
     <value>{{policymgr_mgr_url}}</value>
     <description>URL to Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
     <depends-on>
       <property>
         <type>admin-properties</type>
@@ -50,28 +50,28 @@
     <name>ranger.plugin.atlas.policy.rest.ssl.config.file</name>
     <value>/usr/hdp/current/atlas-server/conf/ranger-policymgr-ssl.xml</value>
     <description>Path to the file containing SSL details to contact Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
     <name>ranger.plugin.atlas.policy.pollIntervalMs</name>
     <value>30000</value>
     <description>How often to poll for changes in policies?</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
     <name>ranger.plugin.atlas.policy.cache.dir</name>
     <value>/etc/ranger/{{repo_name}}/policycache</value>
     <description>Directory where Ranger policies are cached after successful retrieval from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
     <name>xasecure.add-hadoop-authorization</name>
     <value>true</value>
     <description>Enable/Disable the default hadoop authorization (based on rwxrwxrwx permission on the resource) if Ranger Authorization fails.</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
 </configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.5/services/HBASE/configuration/ranger-hbase-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HBASE/configuration/ranger-hbase-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HBASE/configuration/ranger-hbase-plugin-properties.xml
deleted file mode 100644
index 3450970..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HBASE/configuration/ranger-hbase-plugin-properties.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<configuration>
-
-  <property>
-    <name>external_admin_username</name>
-    <value></value>
-    <display-name>External Ranger admin username</display-name>
-    <description>Add ranger default admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_admin_password</name>
-    <value></value>
-    <display-name>External Ranger admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_username</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin username</display-name>
-    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_password</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.5/services/HDFS/configuration/ranger-hdfs-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HDFS/configuration/ranger-hdfs-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HDFS/configuration/ranger-hdfs-plugin-properties.xml
index 953e42e..77f7be2 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HDFS/configuration/ranger-hdfs-plugin-properties.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HDFS/configuration/ranger-hdfs-plugin-properties.xml
@@ -26,54 +26,6 @@
     <value-attributes>
       <empty-value-valid>true</empty-value-valid>
     </value-attributes>
-    <on-ambari-upgrade add="true" />
-  </property>
-
-  <property>
-    <name>external_admin_username</name>
-    <value></value>
-    <display-name>External Ranger admin username</display-name>
-    <description>Add ranger default admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_admin_password</name>
-    <value></value>
-    <display-name>External Ranger admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_username</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin username</display-name>
-    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_password</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false" />
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/ranger-hive-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/ranger-hive-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/ranger-hive-plugin-properties.xml
deleted file mode 100644
index 3450970..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/ranger-hive-plugin-properties.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<configuration>
-
-  <property>
-    <name>external_admin_username</name>
-    <value></value>
-    <display-name>External Ranger admin username</display-name>
-    <description>Add ranger default admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_admin_password</name>
-    <value></value>
-    <display-name>External Ranger admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_username</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin username</display-name>
-    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_password</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/ranger-hive-security.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/ranger-hive-security.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/ranger-hive-security.xml
index 7f0bb99..5bc8c9c 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/ranger-hive-security.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/ranger-hive-security.xml
@@ -23,6 +23,6 @@
     <name>ranger.plugin.hive.policy.rest.ssl.config.file</name>
     <value>{{stack_root}}/current/{{ranger_hive_component}}/conf/conf.server/ranger-policymgr-ssl.xml</value>
     <description>Path to the file containing SSL details to contact Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.5/services/KAFKA/configuration/ranger-kafka-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/KAFKA/configuration/ranger-kafka-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/KAFKA/configuration/ranger-kafka-plugin-properties.xml
deleted file mode 100644
index 3450970..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/KAFKA/configuration/ranger-kafka-plugin-properties.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<configuration>
-
-  <property>
-    <name>external_admin_username</name>
-    <value></value>
-    <display-name>External Ranger admin username</display-name>
-    <description>Add ranger default admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_admin_password</name>
-    <value></value>
-    <display-name>External Ranger admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_username</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin username</display-name>
-    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_password</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.5/services/KNOX/configuration/ranger-knox-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/KNOX/configuration/ranger-knox-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/KNOX/configuration/ranger-knox-plugin-properties.xml
deleted file mode 100644
index 3450970..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/KNOX/configuration/ranger-knox-plugin-properties.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<configuration>
-
-  <property>
-    <name>external_admin_username</name>
-    <value></value>
-    <display-name>External Ranger admin username</display-name>
-    <description>Add ranger default admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_admin_password</name>
-    <value></value>
-    <display-name>External Ranger admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_username</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin username</display-name>
-    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_password</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.5/services/STORM/configuration/ranger-storm-policymgr-ssl.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/STORM/configuration/ranger-storm-policymgr-ssl.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/STORM/configuration/ranger-storm-policymgr-ssl.xml
index 21658e7..5672f04 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/STORM/configuration/ranger-storm-policymgr-ssl.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/STORM/configuration/ranger-storm-policymgr-ssl.xml
@@ -23,12 +23,12 @@
     <name>xasecure.policymgr.clientssl.keystore</name>
     <value>/usr/hdp/current/storm-client/conf/ranger-plugin-keystore.jks</value>
     <description>Java Keystore files</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore</name>
     <value>/usr/hdp/current/storm-client/conf/ranger-plugin-truststore.jks</value>
     <description>java truststore file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.5/services/STORM/configuration/ranger-storm-security.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/STORM/configuration/ranger-storm-security.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/STORM/configuration/ranger-storm-security.xml
index 8a3dd2e..f3d7530 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/STORM/configuration/ranger-storm-security.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/STORM/configuration/ranger-storm-security.xml
@@ -23,6 +23,6 @@
     <name>ranger.plugin.storm.policy.rest.ssl.config.file</name>
     <value>/usr/hdp/current/storm-client/conf/ranger-policymgr-ssl.xml</value>
     <description>Path to the file containing SSL details to contact Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.5/services/YARN/configuration/ranger-yarn-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/YARN/configuration/ranger-yarn-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/YARN/configuration/ranger-yarn-plugin-properties.xml
deleted file mode 100644
index 3450970..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/YARN/configuration/ranger-yarn-plugin-properties.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<configuration>
-
-  <property>
-    <name>external_admin_username</name>
-    <value></value>
-    <display-name>External Ranger admin username</display-name>
-    <description>Add ranger default admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_admin_password</name>
-    <value></value>
-    <display-name>External Ranger admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_username</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin username</display-name>
-    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_password</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.6/services/ATLAS/configuration/ranger-atlas-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/ATLAS/configuration/ranger-atlas-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/ATLAS/configuration/ranger-atlas-plugin-properties.xml
new file mode 100644
index 0000000..d8885e5
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/ATLAS/configuration/ranger-atlas-plugin-properties.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<configuration>
+
+  <property>
+    <name>external_admin_username</name>
+    <value></value>
+    <display-name>External Ranger admin username</display-name>
+    <description>Add ranger default admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_admin_password</name>
+    <value></value>
+    <display-name>External Ranger admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_username</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin username</display-name>
+    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_password</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.6/services/HBASE/configuration/ranger-hbase-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/HBASE/configuration/ranger-hbase-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HBASE/configuration/ranger-hbase-plugin-properties.xml
new file mode 100644
index 0000000..d8885e5
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HBASE/configuration/ranger-hbase-plugin-properties.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<configuration>
+
+  <property>
+    <name>external_admin_username</name>
+    <value></value>
+    <display-name>External Ranger admin username</display-name>
+    <description>Add ranger default admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_admin_password</name>
+    <value></value>
+    <display-name>External Ranger admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_username</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin username</display-name>
+    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_password</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.6/services/HDFS/configuration/ranger-hdfs-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/HDFS/configuration/ranger-hdfs-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HDFS/configuration/ranger-hdfs-plugin-properties.xml
new file mode 100644
index 0000000..6e93879
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HDFS/configuration/ranger-hdfs-plugin-properties.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<configuration>
+
+  <property>
+    <name>external_admin_username</name>
+    <value></value>
+    <display-name>External Ranger admin username</display-name>
+    <description>Add ranger default admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_admin_password</name>
+    <value></value>
+    <display-name>External Ranger admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_username</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin username</display-name>
+    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_password</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/ranger-hive-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/ranger-hive-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/ranger-hive-plugin-properties.xml
new file mode 100644
index 0000000..d8885e5
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/ranger-hive-plugin-properties.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<configuration>
+
+  <property>
+    <name>external_admin_username</name>
+    <value></value>
+    <display-name>External Ranger admin username</display-name>
+    <description>Add ranger default admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_admin_password</name>
+    <value></value>
+    <display-name>External Ranger admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_username</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin username</display-name>
+    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_password</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.6/services/KAFKA/configuration/ranger-kafka-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/KAFKA/configuration/ranger-kafka-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/KAFKA/configuration/ranger-kafka-plugin-properties.xml
new file mode 100644
index 0000000..d8885e5
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/KAFKA/configuration/ranger-kafka-plugin-properties.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<configuration>
+
+  <property>
+    <name>external_admin_username</name>
+    <value></value>
+    <display-name>External Ranger admin username</display-name>
+    <description>Add ranger default admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_admin_password</name>
+    <value></value>
+    <display-name>External Ranger admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_username</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin username</display-name>
+    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_password</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.6/services/KNOX/configuration/ranger-knox-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/KNOX/configuration/ranger-knox-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/KNOX/configuration/ranger-knox-plugin-properties.xml
new file mode 100644
index 0000000..d8885e5
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/KNOX/configuration/ranger-knox-plugin-properties.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<configuration>
+
+  <property>
+    <name>external_admin_username</name>
+    <value></value>
+    <display-name>External Ranger admin username</display-name>
+    <description>Add ranger default admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_admin_password</name>
+    <value></value>
+    <display-name>External Ranger admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_username</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin username</display-name>
+    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_password</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.6/services/STORM/configuration/ranger-storm-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/STORM/configuration/ranger-storm-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/STORM/configuration/ranger-storm-plugin-properties.xml
new file mode 100644
index 0000000..d8885e5
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/STORM/configuration/ranger-storm-plugin-properties.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<configuration>
+
+  <property>
+    <name>external_admin_username</name>
+    <value></value>
+    <display-name>External Ranger admin username</display-name>
+    <description>Add ranger default admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_admin_password</name>
+    <value></value>
+    <display-name>External Ranger admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_username</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin username</display-name>
+    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_password</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d9361e/ambari-server/src/main/resources/stacks/HDP/2.6/services/YARN/configuration/ranger-yarn-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/YARN/configuration/ranger-yarn-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/YARN/configuration/ranger-yarn-plugin-properties.xml
new file mode 100644
index 0000000..d8885e5
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/YARN/configuration/ranger-yarn-plugin-properties.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<configuration>
+
+  <property>
+    <name>external_admin_username</name>
+    <value></value>
+    <display-name>External Ranger admin username</display-name>
+    <description>Add ranger default admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_admin_password</name>
+    <value></value>
+    <display-name>External Ranger admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_username</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin username</display-name>
+    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_password</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+</configuration>
\ No newline at end of file


[29/50] [abbrv] ambari git commit: AMBARI-19967 - Ambari Server Unit Test Failures (jonathanhurley)

Posted by nc...@apache.org.
AMBARI-19967 - Ambari Server Unit Test Failures (jonathanhurley)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: fa32fec6d891745885b976cc2dc13512706dfed9
Parents: 6c4cbc4
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Fri Feb 10 12:09:38 2017 -0500
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Mon Feb 13 11:23:33 2017 -0500

----------------------------------------------------------------------
 .../server/orm/dao/AlertDefinitionDAO.java      |  7 ++-
 .../ambari/server/orm/dao/AlertDispatchDAO.java | 45 ++++++++------------
 .../server/orm/entities/AlertGroupEntity.java   |  9 ++--
 .../server/orm/dao/AlertDispatchDAOTest.java    | 20 ++++-----
 .../state/cluster/AlertDataManagerTest.java     |  5 ++-
 5 files changed, 36 insertions(+), 50 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/fa32fec6/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAO.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAO.java
index 703ff58..c3e3a9f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAO.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAO.java
@@ -321,16 +321,15 @@ public class AlertDefinitionDAO {
     EntityManager entityManager = entityManagerProvider.get();
     entityManager.persist(alertDefinition);
 
-    AlertGroupEntity group = dispatchDao.findDefaultServiceGroup(
-        alertDefinition.getClusterId(), alertDefinition.getServiceName());
+    AlertGroupEntity group = dispatchDao.findDefaultServiceGroup(alertDefinition.getClusterId(),
+        alertDefinition.getServiceName());
 
     if (null == group) {
       // create the default alert group for the new service; this MUST be done
       // before adding definitions so that they are properly added to the
       // default group
       String serviceName = alertDefinition.getServiceName();
-      group = dispatchDao.createDefaultGroup(alertDefinition.getClusterId(),
-          serviceName);
+      group = dispatchDao.createDefaultGroup(alertDefinition.getClusterId(), serviceName);
     }
 
     group.addAlertDefinition(alertDefinition);

http://git-wip-us.apache.org/repos/asf/ambari/blob/fa32fec6/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDispatchDAO.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDispatchDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDispatchDAO.java
index 3b9c97a..5bd84ad 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDispatchDAO.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDispatchDAO.java
@@ -22,7 +22,6 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantLock;
 
 import javax.persistence.EntityManager;
 import javax.persistence.TypedQuery;
@@ -52,6 +51,7 @@ import org.eclipse.persistence.config.QueryHints;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.util.concurrent.Striped;
 import com.google.inject.Inject;
 import com.google.inject.Provider;
 import com.google.inject.Singleton;
@@ -83,10 +83,11 @@ public class AlertDispatchDAO {
   private Provider<Clusters> m_clusters;
 
   /**
-   * A lock that ensures that group writes are protected. This is useful since
-   * groups can be created through different events/threads in the system.
+   * Used for ensuring that the concurrent nature of the event handler methods
+   * don't collide when attempting to creation alert groups for the same
+   * service.
    */
-  private final Lock m_groupLock = new ReentrantLock();
+  private Striped<Lock> m_locksByService = Striped.lazyWeakLock(20);
 
   private static final Logger LOG = LoggerFactory.getLogger(AlertDispatchDAO.class);
 
@@ -195,24 +196,6 @@ public class AlertDispatchDAO {
   }
 
   /**
-   * Gets an alert group with the specified name across all clusters. Alert
-   * group names are unique within a cluster.
-   *
-   * @param groupName
-   *          the name of the group (not {@code null}).
-   * @return the alert group or {@code null} if none exists.
-   */
-  @RequiresSession
-  public AlertGroupEntity findGroupByName(String groupName) {
-    TypedQuery<AlertGroupEntity> query = entityManagerProvider.get().createNamedQuery(
-        "AlertGroupEntity.findByName", AlertGroupEntity.class);
-
-    query.setParameter("groupName", groupName);
-
-    return daoUtils.selectSingle(query);
-  }
-
-  /**
    * Gets an alert group with the specified name for the given cluster. Alert
    * group names are unique within a cluster.
    *
@@ -390,7 +373,7 @@ public class AlertDispatchDAO {
     }
 
     // sorting
-    JpaSortBuilder<AlertNoticeEntity> sortBuilder = new JpaSortBuilder<AlertNoticeEntity>();
+    JpaSortBuilder<AlertNoticeEntity> sortBuilder = new JpaSortBuilder<>();
     List<Order> sortOrders = sortBuilder.buildSortOrders(request.Sort, visitor);
     query.orderBy(sortOrders);
 
@@ -466,6 +449,7 @@ public class AlertDispatchDAO {
   @Transactional
   public AlertGroupEntity createDefaultGroup(long clusterId, String serviceName)
       throws AmbariException {
+
     // AMBARI is a special service that we let through, otherwise we need to
     // verify that the service exists before we create the default group
     String ambariServiceName = Services.AMBARI.name();
@@ -481,21 +465,26 @@ public class AlertDispatchDAO {
       }
     }
 
-    AlertGroupEntity group = new AlertGroupEntity();
+    Lock lock = m_locksByService.get(serviceName);
+    lock.lock();
 
-    m_groupLock.lock();
     try {
+      AlertGroupEntity group = findDefaultServiceGroup(clusterId, serviceName);
+      if (null != group) {
+        return group;
+      }
+
+      group = new AlertGroupEntity();
       group.setClusterId(clusterId);
       group.setDefault(true);
       group.setGroupName(serviceName);
       group.setServiceName(serviceName);
 
       create(group);
+      return group;
     } finally {
-      m_groupLock.unlock();
+      lock.unlock();
     }
-
-    return group;
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/fa32fec6/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertGroupEntity.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertGroupEntity.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertGroupEntity.java
index b660631..7ca26e6 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertGroupEntity.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertGroupEntity.java
@@ -62,9 +62,6 @@ import javax.persistence.UniqueConstraint;
         name = "AlertGroupEntity.findAllInCluster",
         query = "SELECT alertGroup FROM AlertGroupEntity alertGroup WHERE alertGroup.clusterId = :clusterId"),
     @NamedQuery(
-        name = "AlertGroupEntity.findByName",
-        query = "SELECT alertGroup FROM AlertGroupEntity alertGroup WHERE alertGroup.groupName = :groupName"),
-    @NamedQuery(
         name = "AlertGroupEntity.findByNameInCluster",
         query = "SELECT alertGroup FROM AlertGroupEntity alertGroup WHERE alertGroup.groupName = :groupName AND alertGroup.clusterId = :clusterId"),
     @NamedQuery(
@@ -226,7 +223,7 @@ public class AlertGroupEntity {
    */
   public Set<AlertDefinitionEntity> getAlertDefinitions() {
     if (null == alertDefinitions) {
-      alertDefinitions = new HashSet<AlertDefinitionEntity>();
+      alertDefinitions = new HashSet<>();
     }
 
     return Collections.unmodifiableSet(alertDefinitions);
@@ -263,7 +260,7 @@ public class AlertGroupEntity {
    */
   public void addAlertDefinition(AlertDefinitionEntity definition) {
     if (null == alertDefinitions) {
-      alertDefinitions = new HashSet<AlertDefinitionEntity>();
+      alertDefinitions = new HashSet<>();
     }
 
     alertDefinitions.add(definition);
@@ -308,7 +305,7 @@ public class AlertGroupEntity {
    */
   public void addAlertTarget(AlertTargetEntity alertTarget) {
     if (null == alertTargets) {
-      alertTargets = new HashSet<AlertTargetEntity>();
+      alertTargets = new HashSet<>();
     }
 
     alertTargets.add(alertTarget);

http://git-wip-us.apache.org/repos/asf/ambari/blob/fa32fec6/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertDispatchDAOTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertDispatchDAOTest.java b/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertDispatchDAOTest.java
index 1ec6d40..0bdd5b2 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertDispatchDAOTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertDispatchDAOTest.java
@@ -158,7 +158,7 @@ public class AlertDispatchDAOTest {
     assertEquals(1, targets.size());
 
     // find by ids
-    List<Long> ids = new ArrayList<Long>();
+    List<Long> ids = new ArrayList<>();
     ids.add(targets.get(0).getTargetId());
     ids.add(99999L);
 
@@ -213,7 +213,7 @@ public class AlertDispatchDAOTest {
     assertEquals(group, actual);
 
     //find by id
-    List<Long> ids = new ArrayList<Long>();
+    List<Long> ids = new ArrayList<>();
     ids.add(groups.get(0).getGroupId());
     ids.add(groups.get(1).getGroupId());
     ids.add(99999L);
@@ -243,7 +243,7 @@ public class AlertDispatchDAOTest {
   public void testCreateUpdateRemoveGroup() throws Exception {
     // create group
     AlertTargetEntity target = m_helper.createAlertTarget();
-    Set<AlertTargetEntity> targets = new HashSet<AlertTargetEntity>();
+    Set<AlertTargetEntity> targets = new HashSet<>();
     targets.add(target);
 
     AlertGroupEntity group = m_helper.createAlertGroup(
@@ -299,7 +299,7 @@ public class AlertDispatchDAOTest {
     int targetCount = m_dao.findAllTargets().size();
 
     AlertTargetEntity target = m_helper.createAlertTarget();
-    Set<AlertTargetEntity> targets = new HashSet<AlertTargetEntity>();
+    Set<AlertTargetEntity> targets = new HashSet<>();
     targets.add(target);
 
     AlertGroupEntity group = m_helper.createAlertGroup(
@@ -430,7 +430,7 @@ public class AlertDispatchDAOTest {
   @Test
   public void testDeleteAssociatedTarget() throws Exception {
     AlertTargetEntity target = m_helper.createAlertTarget();
-    Set<AlertTargetEntity> targets = new HashSet<AlertTargetEntity>();
+    Set<AlertTargetEntity> targets = new HashSet<>();
     targets.add(target);
 
     AlertGroupEntity group = m_helper.createAlertGroup(
@@ -473,7 +473,7 @@ public class AlertDispatchDAOTest {
 
     m_dao.merge(group);
 
-    group = m_dao.findGroupByName(group.getGroupName());
+    group = m_dao.findGroupByName(m_cluster.getClusterId(), group.getGroupName());
     assertEquals(definitions.size(), group.getAlertDefinitions().size());
 
     // assert that the definition is now part of 2 groups (the default group
@@ -690,7 +690,7 @@ public class AlertDispatchDAOTest {
 
     m_alertHelper.populateData(m_cluster);
 
-    List<SortRequestProperty> sortProperties = new ArrayList<SortRequestProperty>();
+    List<SortRequestProperty> sortProperties = new ArrayList<>();
     SortRequest sortRequest = new SortRequestImpl(sortProperties);
 
     AlertNoticeRequest request = new AlertNoticeRequest();
@@ -850,7 +850,7 @@ public class AlertDispatchDAOTest {
    * @throws Exception
    */
   private Set<AlertTargetEntity> createTargets(int numberOfTargets) throws Exception {
-    Set<AlertTargetEntity> targets = new HashSet<AlertTargetEntity>();
+    Set<AlertTargetEntity> targets = new HashSet<>();
     for (int i = 0; i < numberOfTargets; i++) {
       AlertTargetEntity target = new AlertTargetEntity();
       target.setDescription("Target Description " + i);
@@ -883,7 +883,7 @@ public class AlertDispatchDAOTest {
 
     m_dao.merge(group);
 
-    group = m_dao.findGroupByName(group.getGroupName());
+    group = m_dao.findGroupByName(m_cluster.getClusterId(), group.getGroupName());
     assertEquals(definitions.size(), group.getAlertDefinitions().size());
 
     for (AlertDefinitionEntity definition : definitions) {
@@ -894,7 +894,7 @@ public class AlertDispatchDAOTest {
     m_definitionDao.remove(definitions.get(0));
     definitions.remove(0);
 
-    group = m_dao.findGroupByName(group.getGroupName());
+    group = m_dao.findGroupByName(m_cluster.getClusterId(), group.getGroupName());
     assertEquals(definitions.size(), group.getAlertDefinitions().size());
 
     for (AlertDefinitionEntity definition : definitions) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/fa32fec6/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/AlertDataManagerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/AlertDataManagerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/AlertDataManagerTest.java
index 4ad93e6..1e74658 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/AlertDataManagerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/AlertDataManagerTest.java
@@ -113,6 +113,7 @@ public class AlertDataManagerTest {
   public void setup() throws Exception {
     m_injector = Guice.createInjector(new InMemoryDefaultTestModule());
     EventBusSynchronizer.synchronizeAlertEventPublisher(m_injector);
+    EventBusSynchronizer.synchronizeAmbariEventPublisher(m_injector);
     m_injector.getInstance(GuiceJpaInitializer.class);
     m_injector.getInstance(UnitOfWork.class).begin();
 
@@ -311,7 +312,7 @@ public class AlertDataManagerTest {
     m_dao.create(currentAlert);
 
     AlertTargetEntity target = m_helper.createAlertTarget();
-    Set<AlertTargetEntity> targets = new HashSet<AlertTargetEntity>();
+    Set<AlertTargetEntity> targets = new HashSet<>();
     targets.add(target);
 
     AlertGroupEntity group = m_helper.createAlertGroup(
@@ -419,7 +420,7 @@ public class AlertDataManagerTest {
     AlertEventPublisher publisher = m_injector.getInstance(AlertEventPublisher.class);
     EventBusSynchronizer.synchronizeAlertEventPublisher(m_injector);
 
-    final AtomicReference<Alert> ref = new AtomicReference<Alert>();
+    final AtomicReference<Alert> ref = new AtomicReference<>();
     publisher.register(new TestListener() {
       @Override
       @Subscribe


[03/50] [abbrv] ambari git commit: AMBARI-19960 No config properties are changed after deleting service if it's performed after service page refresh. (ababiichuk)

Posted by nc...@apache.org.
AMBARI-19960 No config properties are changed after deleting service if it's performed after service page refresh. (ababiichuk)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: eecb5a311626f2bab09688d37949f0ccedde86a8
Parents: c9bea4a
Author: ababiichuk <ab...@hortonworks.com>
Authored: Fri Feb 10 16:02:12 2017 +0200
Committer: ababiichuk <ab...@hortonworks.com>
Committed: Fri Feb 10 18:22:30 2017 +0200

----------------------------------------------------------------------
 ambari-web/app/controllers/main/service/item.js | 67 +++++++++++---------
 .../test/controllers/main/service/item_test.js  | 46 +++++++++++++-
 2 files changed, 81 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/eecb5a31/ambari-web/app/controllers/main/service/item.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/item.js b/ambari-web/app/controllers/main/service/item.js
index 7010ab5..a7ed493 100644
--- a/ambari-web/app/controllers/main/service/item.js
+++ b/ambari-web/app/controllers/main/service/item.js
@@ -144,8 +144,9 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
    * @type {String[]}
    */
   dependentServiceNames: function() {
-    return App.StackService.find(this.get('content.serviceName')).get('dependentServiceNames');
-  }.property('content.serviceName'),
+    return App.get('router.clusterController.isConfigsPropertiesLoaded') ?
+      App.StackService.find(this.get('content.serviceName')).get('dependentServiceNames') : [];
+  }.property('content.serviceName', 'App.router.clusterController.isConfigsPropertiesLoaded'),
 
   /**
    * List of service names that could be deleted
@@ -204,32 +205,35 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
    */
   onLoadConfigsTags: function (data) {
     var self = this;
-    var sitesToLoad = this.get('sitesToLoad'), allConfigs = [];
-    var loadedSites = data.Clusters.desired_configs;
-    var siteTagsToLoad = [];
-    for (var site in loadedSites) {
-      if (sitesToLoad.contains(site)) {
-        siteTagsToLoad.push({
-          siteName: site,
-          tagName: loadedSites[site].tag
-        });
+    App.get('router.mainController.isLoading').call(App.get('router.clusterController'), 'isConfigsPropertiesLoaded').done(function () {
+      var sitesToLoad = self.get('sitesToLoad'),
+        allConfigs = [],
+        loadedSites = data.Clusters.desired_configs,
+        siteTagsToLoad = [];
+      for (var site in loadedSites) {
+        if (sitesToLoad.contains(site)) {
+          siteTagsToLoad.push({
+            siteName: site,
+            tagName: loadedSites[site].tag
+          });
+        }
       }
-    }
-    App.router.get('configurationController').getConfigsByTags(siteTagsToLoad).done(function (configs) {
-      configs.forEach(function (site) {
-        self.get('configs')[site.type] = site.properties;
-        allConfigs = allConfigs.concat(App.config.getConfigsFromJSON(site, true));
-      });
+      App.router.get('configurationController').getConfigsByTags(siteTagsToLoad).done(function (configs) {
+        configs.forEach(function (site) {
+          self.get('configs')[site.type] = site.properties;
+          allConfigs = allConfigs.concat(App.config.getConfigsFromJSON(site, true));
+        });
 
-      self.get('dependentServiceNames').forEach(function(serviceName) {
-        var configTypes = App.StackService.find(serviceName).get('configTypeList');
-        var configsByService = allConfigs.filter(function (c) {
-          return configTypes.contains(App.config.getConfigTagFromFileName(c.get('filename')));
+        self.get('dependentServiceNames').forEach(function(serviceName) {
+          var configTypes = App.StackService.find(serviceName).get('configTypeList');
+          var configsByService = allConfigs.filter(function (c) {
+            return configTypes.contains(App.config.getConfigTagFromFileName(c.get('filename')));
+          });
+          self.get('stepConfigs').pushObject(App.config.createServiceConfig(serviceName, [], configsByService));
         });
-        self.get('stepConfigs').pushObject(App.config.createServiceConfig(serviceName, [], configsByService));
-      });
 
-      self.set('isServiceConfigsLoaded', true);
+        self.set('isServiceConfigsLoaded', true);
+      });
     });
   },
 
@@ -1290,7 +1294,13 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
       popupHeader = Em.I18n.t('services.service.delete.popup.header'),
       popupPrimary = Em.I18n.t('common.delete'),
       warningMessage = Em.I18n.t('services.service.delete.popup.warning').format(displayName) +
-        (interDependentServices.length ? Em.I18n.t('services.service.delete.popup.warning.dependent').format(dependentServicesToDeleteFmt) : '');
+        (interDependentServices.length ? Em.I18n.t('services.service.delete.popup.warning.dependent').format(dependentServicesToDeleteFmt) : ''),
+      callback = this.loadConfigRecommendations.bind(this, null, function () {
+        var serviceNames = self.get('changedProperties').mapProperty('serviceName').uniq();
+        self.loadConfigGroups(serviceNames).done(function () {
+          self.set('isRecommendationInProgress', false);
+        })
+      });
     this.clearRecommendations();
     this.setProperties({
       isRecommendationInProgress: true,
@@ -1298,12 +1308,7 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
         isDefault: true
       })
     });
-    this.loadConfigRecommendations(null, function () {
-      var serviceNames = self.get('changedProperties').mapProperty('serviceName').uniq();
-      self.loadConfigGroups(serviceNames).done(function () {
-        self.set('isRecommendationInProgress', false);
-      })
-    });
+    App.get('router.mainController.isLoading').call(this, 'isServiceConfigsLoaded').done(callback);
     return App.ModalPopup.show({
       controller: self,
       header: popupHeader,

http://git-wip-us.apache.org/repos/asf/ambari/blob/eecb5a31/ambari-web/test/controllers/main/service/item_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/service/item_test.js b/ambari-web/test/controllers/main/service/item_test.js
index 302a9a5..6430ab6 100644
--- a/ambari-web/test/controllers/main/service/item_test.js
+++ b/ambari-web/test/controllers/main/service/item_test.js
@@ -1719,7 +1719,7 @@ describe('App.MainServiceItemController', function () {
       mainServiceItemController.deleteServiceCall.restore();
     });
 
-    it("window.location.reload should be called", function() {
+    it("saveConfigs should be called", function() {
       mainServiceItemController.deleteServiceCallSuccessCallback([], null, {});
       expect(mainServiceItemController.deleteServiceCall.called).to.be.false;
       expect(mainServiceItemController.saveConfigs.calledOnce).to.be.true;
@@ -1878,4 +1878,48 @@ describe('App.MainServiceItemController', function () {
       expect(mainServiceItemController.isRangerPluginEnabled()).to.be.true;
     });
   });
+
+  describe('#dependentServiceNames', function () {
+
+    var controller,
+      serviceName = 's0',
+      dependentServiceNames = ['s1', 's2'],
+      testCases = [
+        {
+          isConfigsPropertiesLoaded: true,
+          dependentServiceNames: dependentServiceNames,
+          message: 'model is ready'
+        },
+        {
+          isConfigsPropertiesLoaded: false,
+          dependentServiceNames: [],
+          message: 'model is not ready'
+        }
+      ];
+
+    beforeEach(function () {
+      controller = App.MainServiceItemController.create({
+        content: {
+          serviceName: serviceName
+        }
+      });
+      sinon.stub(App.StackService, 'find').returns(Em.Object.create({
+        dependentServiceNames: dependentServiceNames
+      }));
+    });
+
+    afterEach(function () {
+      App.StackService.find.restore();
+    });
+
+    testCases.forEach(function (test) {
+
+      it(test.message, function () {
+        App.set('router.clusterController.isConfigsPropertiesLoaded', test.isConfigsPropertiesLoaded);
+        expect(controller.get('dependentServiceNames')).to.eql(test.dependentServiceNames);
+      });
+
+    });
+
+  });
 });


[43/50] [abbrv] ambari git commit: AMBARI-19864 : Zookeeper namespace for Hive service should be taken from hive-interactive-site, when only Hive-server Interactive is installed (Vishal Suvagia via mugdha)

Posted by nc...@apache.org.
AMBARI-19864 : Zookeeper namespace for Hive service should be taken from hive-interactive-site, when only Hive-server Interactive is installed (Vishal Suvagia via mugdha)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 4061cbab874fb05eab46f0e85d3ba243bb1bf3ee
Parents: 9670245
Author: Vishal Suvagia <vi...@yahoo.com>
Authored: Mon Feb 6 11:49:38 2017 +0530
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Mon Feb 13 15:45:36 2017 -0500

----------------------------------------------------------------------
 .../HIVE/0.12.0.2.0/package/scripts/params_linux.py             | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4061cbab/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
index 211fe0a..9191c12 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
@@ -705,7 +705,10 @@ if has_hive_interactive:
     hive_llap_principal = (config['configurations']['hive-interactive-site']['hive.llap.zk.sm.principal']).replace('_HOST',hostname.lower())
   pass
 
-hive_server2_zookeeper_namespace = config['configurations']['hive-site']['hive.server2.zookeeper.namespace']
+if len(hive_server_hosts) == 0 and len(hive_server_interactive_hosts) > 0:
+  hive_server2_zookeeper_namespace = config['configurations']['hive-interactive-site']['hive.server2.zookeeper.namespace']
+else:
+  hive_server2_zookeeper_namespace = config['configurations']['hive-site']['hive.server2.zookeeper.namespace']
 hive_zookeeper_quorum = config['configurations']['hive-site']['hive.zookeeper.quorum']
 
 if security_enabled:


[32/50] [abbrv] ambari git commit: AMBARI-19813: findLatestServiceConfigsByStack query returns deleted config group (Amruta Borkar via dili)

Posted by nc...@apache.org.
AMBARI-19813: findLatestServiceConfigsByStack query returns deleted config group (Amruta Borkar via dili)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 68f3a4a05e14a0957e1531a68a8b1b748f33481c
Parents: 40f8ee9
Author: Di Li <di...@apache.org>
Authored: Fri Feb 3 14:15:19 2017 -0500
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Mon Feb 13 15:45:35 2017 -0500

----------------------------------------------------------------------
 .../server/orm/entities/ServiceConfigEntity.java       |  2 +-
 .../ambari/server/orm/dao/ServiceConfigDAOTest.java    | 13 ++++++++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/68f3a4a0/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceConfigEntity.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceConfigEntity.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceConfigEntity.java
index 8a1b316..dae7ef8 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceConfigEntity.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceConfigEntity.java
@@ -49,7 +49,7 @@ import javax.persistence.TableGenerator;
     @NamedQuery(name = "ServiceConfigEntity.findAll", query = "SELECT serviceConfig FROM ServiceConfigEntity serviceConfig WHERE serviceConfig.clusterId=:clusterId ORDER BY serviceConfig.version DESC"),
     @NamedQuery(name = "ServiceConfigEntity.findNextServiceConfigVersion", query = "SELECT COALESCE(MAX(serviceConfig.version), 0) + 1 AS nextVersion FROM ServiceConfigEntity serviceConfig WHERE serviceConfig.serviceName=:serviceName AND serviceConfig.clusterId=:clusterId"),
     @NamedQuery(name = "ServiceConfigEntity.findAllServiceConfigsByStack", query = "SELECT serviceConfig FROM ServiceConfigEntity serviceConfig WHERE serviceConfig.clusterId=:clusterId AND serviceConfig.stack=:stack"),
-    @NamedQuery(name = "ServiceConfigEntity.findLatestServiceConfigsByStack", query = "SELECT serviceConfig FROM ServiceConfigEntity serviceConfig WHERE serviceConfig.clusterId = :clusterId AND serviceConfig.version = (SELECT MAX(serviceConfig2.version) FROM ServiceConfigEntity serviceConfig2 WHERE serviceConfig2.clusterId=:clusterId AND serviceConfig2.stack=:stack AND serviceConfig2.serviceName = serviceConfig.serviceName)"),
+    @NamedQuery(name = "ServiceConfigEntity.findLatestServiceConfigsByStack", query = "SELECT serviceConfig FROM ServiceConfigEntity serviceConfig WHERE serviceConfig.clusterId = :clusterId AND (serviceConfig.groupId = null OR serviceConfig.groupId IN (SELECT cg.groupId from ConfigGroupEntity cg)) AND serviceConfig.version = (SELECT MAX(serviceConfig2.version) FROM ServiceConfigEntity serviceConfig2 WHERE serviceConfig2.clusterId= :clusterId AND serviceConfig2.stack = :stack AND serviceConfig2.serviceName = serviceConfig.serviceName)"),
     @NamedQuery(name = "ServiceConfigEntity.findLatestServiceConfigsByService", query = "SELECT scv FROM ServiceConfigEntity scv WHERE scv.clusterId = :clusterId AND scv.serviceName = :serviceName AND (scv.groupId = null OR scv.groupId IN (SELECT cg.groupId from ConfigGroupEntity cg)) AND scv.version = (SELECT MAX(scv2.version) FROM ServiceConfigEntity scv2 WHERE (scv2.serviceName = :serviceName AND scv2.clusterId = :clusterId) AND (scv2.groupId = scv.groupId OR (scv2.groupId IS NULL AND scv.groupId IS NULL)))"),
     @NamedQuery(name = "ServiceConfigEntity.findLatestServiceConfigsByCluster", query = "SELECT scv FROM ServiceConfigEntity scv WHERE scv.clusterId = :clusterId AND scv.serviceConfigId IN (SELECT MAX(scv1.serviceConfigId) FROM ServiceConfigEntity scv1 WHERE (scv1.clusterId = :clusterId) AND (scv1.groupId IS NULL) GROUP BY scv1.serviceName)")})
 public class ServiceConfigEntity {

http://git-wip-us.apache.org/repos/asf/ambari/blob/68f3a4a0/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/ServiceConfigDAOTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/ServiceConfigDAOTest.java b/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/ServiceConfigDAOTest.java
index e29c276..a0732ab 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/ServiceConfigDAOTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/ServiceConfigDAOTest.java
@@ -412,6 +412,16 @@ public class ServiceConfigDAOTest {
     clusterEntity.setDesiredStack(stackEntity);
     clusterDAO.merge(clusterEntity);
 
+    ConfigGroupEntity configGroupEntity1 = new ConfigGroupEntity();
+    configGroupEntity1.setClusterEntity(clusterEntity);
+    configGroupEntity1.setClusterId(clusterEntity.getClusterId());
+    configGroupEntity1.setGroupName("group1");
+    configGroupEntity1.setDescription("group1_desc");
+    configGroupEntity1.setTag("HDFS");
+    configGroupEntity1.setServiceName("HDFS");
+    configGroupDAO.create(configGroupEntity1);
+    ConfigGroupEntity group1 = configGroupDAO.findByName("group1");
+    createServiceConfigWithGroup("HDFS", "admin", 3L, 8L, 2222L, null, group1.getGroupId());
     // create some for HDP 0.2
     serviceConfigEntity = createServiceConfig("HDFS", "admin", 4L, 5L, 50L, null);
     serviceConfigEntity = createServiceConfig("HDFS", "admin", 5L, 6L, 60L, null);
@@ -420,7 +430,8 @@ public class ServiceConfigDAOTest {
     long clusterId = serviceConfigEntity.getClusterId();
 
     List<ServiceConfigEntity> serviceConfigs = serviceConfigDAO.getLatestServiceConfigs(clusterId, HDP_01);
-    Assert.assertEquals(2, serviceConfigs.size());
+    Assert.assertEquals(3, serviceConfigs.size());
+    configGroupDAO.remove(configGroupEntity1);
 
     serviceConfigs = serviceConfigDAO.getLatestServiceConfigs(clusterId, HDP_02);
     Assert.assertEquals(2, serviceConfigs.size());


[26/50] [abbrv] ambari git commit: AMBARI-19058. Perf: Deploy 3000 Agent cluster and find perf bugs. Part5.(vbrodetskyi)

Posted by nc...@apache.org.
AMBARI-19058. Perf: Deploy 3000 Agent cluster and find perf bugs. Part5.(vbrodetskyi)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: a7eafd59db2f9771b9e2b08d6a71406e05309b5c
Parents: b8176ff
Author: Vitaly Brodetskyi <vb...@hortonworks.com>
Authored: Mon Feb 13 14:10:21 2017 +0200
Committer: Vitaly Brodetskyi <vb...@hortonworks.com>
Committed: Mon Feb 13 14:10:21 2017 +0200

----------------------------------------------------------------------
 .../resources/stacks/PERF/1.0/services/FAKEHBASE/metainfo.xml   | 2 +-
 contrib/utils/perf/deploy-gce-perf-cluster.py                   | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a7eafd59/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEHBASE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEHBASE/metainfo.xml b/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEHBASE/metainfo.xml
index 4dbd2bb..059deff 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEHBASE/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEHBASE/metainfo.xml
@@ -41,7 +41,7 @@
               </auto-deploy>
             </dependency>
             <dependency>
-              <name>FAKEZOOKEEPER/FAKEZOOKEEPER_SERVER</name>
+              <name>ZOOKEEPER/ZOOKEEPER_SERVER</name>
               <scope>cluster</scope>
               <auto-deploy>
                 <enabled>true</enabled>

http://git-wip-us.apache.org/repos/asf/ambari/blob/a7eafd59/contrib/utils/perf/deploy-gce-perf-cluster.py
----------------------------------------------------------------------
diff --git a/contrib/utils/perf/deploy-gce-perf-cluster.py b/contrib/utils/perf/deploy-gce-perf-cluster.py
index 6364122..7431ae9 100644
--- a/contrib/utils/perf/deploy-gce-perf-cluster.py
+++ b/contrib/utils/perf/deploy-gce-perf-cluster.py
@@ -338,7 +338,10 @@ def create_server_script(server_host_name):
   "sed -i -f /home/ambari/ambari-server/src/main/resources/stacks/PERF/install_packages.sed /var/lib/ambari-agent/cache/custom_actions/scripts/install_packages.py\n" + \
   "\n" + \
   "\n" + \
-  "yum install mysql-connector-java* -y\n" + \
+  "cd /; wget http://central.maven.org/maven2/mysql/mysql-connector-java/5.1.40/mysql-connector-java-5.1.40.jar;\n" + \
+  "mkdir /usr/share/java; chmod 777 /usr/share/java;" + \
+  "cp mysql-connector-java-5.1.40.jar /usr/share/java/; chmod 777 /usr/share/java/mysql-connector-java-5.1.40.jar;\n" + \
+  "ln -s /usr/share/java/mysql-connector-java-5.1.40.jar /usr/share/java/mysql-connector-java.jar;\n" + \
   "cd /etc/yum.repos.d/; wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm; rpm -ivh mysql-community-release-el6-5.noarch.rpm;" + \
   "yum clean all; yum install mysql-server -y\n" + \
   "sed -i -e 's/mysqld]/mysqld]\\nmax_allowed_packet=1024M\\njoin_buffer_size=512M\\nsort_buffer_size=128M\\nread_rnd_buffer_size=128M\\ninnodb_buffer_pool_size=16G" \


[06/50] [abbrv] ambari git commit: AMBARI-19963 Deviation alerts fail with "No JSON object could be decoded" (dsen)

Posted by nc...@apache.org.
AMBARI-19963 Deviation alerts fail with "No JSON object could be decoded" (dsen)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: fe1704e12287685f8ca0fed179eb471556eee37b
Parents: 33caec2
Author: Dmytro Sen <ds...@apache.org>
Authored: Fri Feb 10 19:52:40 2017 +0200
Committer: Dmytro Sen <ds...@apache.org>
Committed: Fri Feb 10 19:52:40 2017 +0200

----------------------------------------------------------------------
 .../src/main/python/ambari_commons/network.py   | 39 ++++++++++++++++++++
 .../package/scripts/metrics_grafana_util.py     |  2 +-
 .../0.1.0/package/scripts/network.py            | 39 --------------------
 .../0.1.0/package/scripts/service_check.py      |  2 +-
 .../package/alerts/alert_metrics_deviation.py   | 14 +++++--
 .../package/alerts/alert_metrics_deviation.py   | 14 +++++--
 .../2.0.6/HDFS/test_alert_metrics_deviation.py  |  2 +
 7 files changed, 65 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/fe1704e1/ambari-common/src/main/python/ambari_commons/network.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/ambari_commons/network.py b/ambari-common/src/main/python/ambari_commons/network.py
new file mode 100644
index 0000000..b5b1cd6
--- /dev/null
+++ b/ambari-common/src/main/python/ambari_commons/network.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.
+
+"""
+
+import httplib
+import ssl
+
+from resource_management.core.exceptions import Fail
+
+def get_http_connection(host, port, https_enabled=False, ca_certs=None):
+  if https_enabled:
+    if ca_certs:
+      check_ssl_certificate(host, port, ca_certs)
+    return httplib.HTTPSConnection(host, port)
+  else:
+    return httplib.HTTPConnection(host, port)
+
+def check_ssl_certificate(host, port, ca_certs):
+  try:
+    ssl.get_server_certificate((host, port), ssl_version=ssl.PROTOCOL_SSLv23, ca_certs=ca_certs)
+  except (ssl.SSLError) as ssl_error:
+    raise Fail("Failed to verify the SSL certificate for https://{0}:{1} with CA certificate in {2}"
+               .format(host, port, ca_certs))

http://git-wip-us.apache.org/repos/asf/ambari/blob/fe1704e1/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
index 84dcd99..a751330 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
+++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
@@ -31,7 +31,7 @@ import random
 import time
 import socket
 import ambari_simplejson as json
-import network
+import ambari_commons.network as network
 import os
 
 GRAFANA_CONNECT_TRIES = 15

http://git-wip-us.apache.org/repos/asf/ambari/blob/fe1704e1/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/network.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/network.py b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/network.py
deleted file mode 100644
index 672ee53..0000000
--- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/network.py
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/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 httplib
-import ssl
-
-from resource_management.core.exceptions import Fail
-
-def get_http_connection(host, port, https_enabled=False, ca_certs=None):
-  if https_enabled:
-    if ca_certs:
-      check_ssl_certificate(host, port, ca_certs)
-    return httplib.HTTPSConnection(host, port)
-  else:
-    return httplib.HTTPConnection(host, port)
-
-def check_ssl_certificate(host, port, ca_certs):
-  try:
-    ssl.get_server_certificate((host, port), ssl_version=ssl.PROTOCOL_SSLv23, ca_certs=ca_certs)
-  except (ssl.SSLError) as ssl_error:
-    raise Fail("Failed to verify the SSL certificate for AMS Collector https://{0}:{1} with CA certificate in {2}"
-               .format(host, port, ca_certs))

http://git-wip-us.apache.org/repos/asf/ambari/blob/fe1704e1/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/service_check.py
index 2bc4363..e753958 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/service_check.py
+++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/service_check.py
@@ -28,7 +28,7 @@ from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl
 from ambari_commons.parallel_processing import PrallelProcessResult, execute_in_parallel, SUCCESS
 
 import httplib
-import network
+import ambari_commons.network as network
 import urllib
 import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set.
 import os

http://git-wip-us.apache.org/repos/asf/ambari/blob/fe1704e1/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_metrics_deviation.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_metrics_deviation.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_metrics_deviation.py
index 8a06f56..bc2102a 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_metrics_deviation.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_metrics_deviation.py
@@ -24,6 +24,8 @@ import logging
 import urllib
 import time
 import urllib2
+import os
+import ambari_commons.network as network
 
 from resource_management import Environment
 from ambari_commons.aggregate_functions import sample_standard_deviation, mean
@@ -55,6 +57,7 @@ SECURITY_ENABLED_KEY = '{{cluster-env/security_enabled}}'
 SMOKEUSER_KEY = '{{cluster-env/smokeuser}}'
 EXECUTABLE_SEARCH_PATHS = '{{kerberos-env/executable_search_paths}}'
 
+AMS_HTTP_POLICY = '{{ams-site/timeline.metrics.service.http.policy}}'
 METRICS_COLLECTOR_WEBAPP_ADDRESS_KEY = '{{ams-site/timeline.metrics.service.webapp.address}}'
 METRICS_COLLECTOR_VIP_HOST_KEY = '{{cluster-env/metrics_collector_vip_host}}'
 METRICS_COLLECTOR_VIP_PORT_KEY = '{{cluster-env/metrics_collector_vip_port}}'
@@ -105,7 +108,7 @@ def get_tokens():
           EXECUTABLE_SEARCH_PATHS, NN_HTTPS_ADDRESS_KEY, SMOKEUSER_KEY,
           KERBEROS_KEYTAB, KERBEROS_PRINCIPAL, SECURITY_ENABLED_KEY,
           METRICS_COLLECTOR_VIP_HOST_KEY, METRICS_COLLECTOR_VIP_PORT_KEY,
-          METRICS_COLLECTOR_WEBAPP_ADDRESS_KEY)
+          METRICS_COLLECTOR_WEBAPP_ADDRESS_KEY, AMS_HTTP_POLICY)
 
 def execute(configurations={}, parameters={}, host_name=None):
   """
@@ -310,9 +313,14 @@ def execute(configurations={}, parameters={}, host_name=None):
 
   encoded_get_metrics_parameters = urllib.urlencode(get_metrics_parameters)
 
+  ams_monitor_conf_dir = "/etc/ambari-metrics-monitor/conf"
+  metric_truststore_ca_certs='ca.pem'
+  ca_certs = os.path.join(ams_monitor_conf_dir,
+                          metric_truststore_ca_certs)
+  metric_collector_https_enabled = str(configurations[AMS_HTTP_POLICY]) == "HTTPS_ONLY"
+
   try:
-    conn = httplib.HTTPConnection(collector_host, int(collector_port),
-                                  timeout=connection_timeout)
+    conn = network.get_http_connection(collector_host, int(collector_port), metric_collector_https_enabled, ca_certs)
     conn.request("GET", AMS_METRICS_GET_URL % encoded_get_metrics_parameters)
     response = conn.getresponse()
     data = response.read()

http://git-wip-us.apache.org/repos/asf/ambari/blob/fe1704e1/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/alerts/alert_metrics_deviation.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/alerts/alert_metrics_deviation.py b/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/alerts/alert_metrics_deviation.py
index 8a06f56..bc2102a 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/alerts/alert_metrics_deviation.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/alerts/alert_metrics_deviation.py
@@ -24,6 +24,8 @@ import logging
 import urllib
 import time
 import urllib2
+import os
+import ambari_commons.network as network
 
 from resource_management import Environment
 from ambari_commons.aggregate_functions import sample_standard_deviation, mean
@@ -55,6 +57,7 @@ SECURITY_ENABLED_KEY = '{{cluster-env/security_enabled}}'
 SMOKEUSER_KEY = '{{cluster-env/smokeuser}}'
 EXECUTABLE_SEARCH_PATHS = '{{kerberos-env/executable_search_paths}}'
 
+AMS_HTTP_POLICY = '{{ams-site/timeline.metrics.service.http.policy}}'
 METRICS_COLLECTOR_WEBAPP_ADDRESS_KEY = '{{ams-site/timeline.metrics.service.webapp.address}}'
 METRICS_COLLECTOR_VIP_HOST_KEY = '{{cluster-env/metrics_collector_vip_host}}'
 METRICS_COLLECTOR_VIP_PORT_KEY = '{{cluster-env/metrics_collector_vip_port}}'
@@ -105,7 +108,7 @@ def get_tokens():
           EXECUTABLE_SEARCH_PATHS, NN_HTTPS_ADDRESS_KEY, SMOKEUSER_KEY,
           KERBEROS_KEYTAB, KERBEROS_PRINCIPAL, SECURITY_ENABLED_KEY,
           METRICS_COLLECTOR_VIP_HOST_KEY, METRICS_COLLECTOR_VIP_PORT_KEY,
-          METRICS_COLLECTOR_WEBAPP_ADDRESS_KEY)
+          METRICS_COLLECTOR_WEBAPP_ADDRESS_KEY, AMS_HTTP_POLICY)
 
 def execute(configurations={}, parameters={}, host_name=None):
   """
@@ -310,9 +313,14 @@ def execute(configurations={}, parameters={}, host_name=None):
 
   encoded_get_metrics_parameters = urllib.urlencode(get_metrics_parameters)
 
+  ams_monitor_conf_dir = "/etc/ambari-metrics-monitor/conf"
+  metric_truststore_ca_certs='ca.pem'
+  ca_certs = os.path.join(ams_monitor_conf_dir,
+                          metric_truststore_ca_certs)
+  metric_collector_https_enabled = str(configurations[AMS_HTTP_POLICY]) == "HTTPS_ONLY"
+
   try:
-    conn = httplib.HTTPConnection(collector_host, int(collector_port),
-                                  timeout=connection_timeout)
+    conn = network.get_http_connection(collector_host, int(collector_port), metric_collector_https_enabled, ca_certs)
     conn.request("GET", AMS_METRICS_GET_URL % encoded_get_metrics_parameters)
     response = conn.getresponse()
     data = response.read()

http://git-wip-us.apache.org/repos/asf/ambari/blob/fe1704e1/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_alert_metrics_deviation.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_alert_metrics_deviation.py b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_alert_metrics_deviation.py
index 1e35e6f..09e8886 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_alert_metrics_deviation.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_alert_metrics_deviation.py
@@ -81,6 +81,7 @@ class TestAlertMetricsDeviation(RMFTestCase):
       '{{hdfs-site/dfs.namenode.https-address}}': 'c6401.ambari.apache.org:50470',
       '{{hdfs-site/dfs.http.policy}}': 'HTTP_ONLY',
       '{{ams-site/timeline.metrics.service.webapp.address}}': '0.0.0.0:6188',
+      '{{ams-site/timeline.metrics.service.http.policy}}' : 'HTTP_ONLY',
       '{{hdfs-site/dfs.namenode.http-address}}': 'c6401.ambari.apache.org:50070',
       '{{cluster-env/security_enabled}}': 'false',
       '{{cluster-env/smokeuser}}': 'ambari-qa',
@@ -105,6 +106,7 @@ class TestAlertMetricsDeviation(RMFTestCase):
       '{{hdfs-site/dfs.namenode.https-address}}': 'c6401.ambari.apache.org:50470',
       '{{hdfs-site/dfs.http.policy}}': 'HTTP_ONLY',
       '{{ams-site/timeline.metrics.service.webapp.address}}': '0.0.0.0:6188',
+      '{{ams-site/timeline.metrics.service.http.policy}}' : 'HTTP_ONLY',
       '{{hdfs-site/dfs.namenode.http-address}}': 'c6401.ambari.apache.org:50070',
       '{{cluster-env/security_enabled}}': 'false',
       '{{cluster-env/smokeuser}}': 'ambari-qa',


[35/50] [abbrv] ambari git commit: AMBARI-19859. The user must be clearly communicated about YARN pre-emption requirements when Hive LLAP is enabled. (Vivek Subramanian via yusaku)

Posted by nc...@apache.org.
AMBARI-19859. The user must be clearly communicated about YARN pre-emption requirements when Hive LLAP is enabled. (Vivek Subramanian via yusaku)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: f27beb111995f473ba4ed43c235d6300a2fc2f94
Parents: 4f39bdf
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Fri Feb 3 15:17:35 2017 -0800
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Mon Feb 13 15:45:35 2017 -0500

----------------------------------------------------------------------
 .../HDP/2.5/services/HIVE/configuration/hive-interactive-env.xml | 4 ++--
 .../HDP/2.6/services/HIVE/configuration/hive-interactive-env.xml | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f27beb11/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-interactive-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-interactive-env.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-interactive-env.xml
index 89eccc6..e636e0c 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-interactive-env.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-interactive-env.xml
@@ -23,8 +23,8 @@
   <property>
     <name>enable_hive_interactive</name>
     <value>false</value>
-    <description>Enable or disable interactive query in this cluster.</description>
-    <display-name>Enable Interactive Query (Tech Preview)</display-name>
+    <description>Enable or disable interactive query in this cluster. &lt;br&gt; Note: Hive LLAP may not start up on busy clusters if YARN pre-emption is not enabled. Enable via the YARN configs page.</description>
+    <display-name>Enable Interactive Query (Tech Preview, requires YARN pre-emption)</display-name>
     <value-attributes>
       <type>value-list</type>
       <overridable>false</overridable>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f27beb11/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/hive-interactive-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/hive-interactive-env.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/hive-interactive-env.xml
index 787dcb1..af656f4 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/hive-interactive-env.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/hive-interactive-env.xml
@@ -23,8 +23,8 @@
   <property>
     <name>enable_hive_interactive</name>
     <value>false</value>
-    <description>Enable or disable interactive query in this cluster.</description>
-    <display-name>Enable Interactive Query</display-name>
+    <description>Enable or disable interactive query in this cluster. &lt;br&gt; Note: Hive LLAP may not start up on busy clusters if YARN pre-emption is not enabled. Enable via the YARN configs page.</description>
+    <display-name>Enable Interactive Query (requires YARN pre-emption)</display-name>
     <value-attributes>
       <type>value-list</type>
       <overridable>false</overridable>


[17/50] [abbrv] ambari git commit: AMBARI-19977. Increase default timeout for RM (aonishuk)

Posted by nc...@apache.org.
AMBARI-19977. Increase default timeout for RM (aonishuk)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 6098d342c14ede52f2743274482ce3d37c0917b6
Parents: 77b5b16
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Sat Feb 11 18:16:48 2017 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Sat Feb 11 18:16:48 2017 +0200

----------------------------------------------------------------------
 .../stacks/HDP/2.2/services/YARN/configuration/yarn-site.xml     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6098d342/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration/yarn-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration/yarn-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration/yarn-site.xml
index fcd9380..0eb3366 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration/yarn-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration/yarn-site.xml
@@ -127,13 +127,13 @@
   </property>
   <property>
     <name>yarn.resourcemanager.connect.retry-interval.ms</name>
-    <value>30000</value>
+    <value>15000</value>
     <description>How often to try connecting to the ResourceManager.</description>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
     <name>yarn.resourcemanager.connect.max-wait.ms</name>
-    <value>900000</value>
+    <value>-1</value>
     <description>Maximum time to wait to establish connection to ResourceManager</description>
     <on-ambari-upgrade add="true"/>
   </property>


[42/50] [abbrv] ambari git commit: AMBARI-19876. Popup with alerts on the Service summary doesn't have arrows for alerts with state "None" (onechiporenko)

Posted by nc...@apache.org.
AMBARI-19876. Popup with alerts on the Service summary doesn't have arrows for alerts with state "None" (onechiporenko)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 9670245d38031e707fcb633a31f0998770cd8724
Parents: 94d9361
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Mon Feb 6 11:32:12 2017 +0200
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Mon Feb 13 15:45:36 2017 -0500

----------------------------------------------------------------------
 ambari-web/app/controllers/main/service/info/summary.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9670245d/ambari-web/app/controllers/main/service/info/summary.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/summary.js b/ambari-web/app/controllers/main/service/info/summary.js
index 9bdf83a..0ca9775 100644
--- a/ambari-web/app/controllers/main/service/info/summary.js
+++ b/ambari-web/app/controllers/main/service/info/summary.js
@@ -394,9 +394,9 @@ App.MainServiceInfoSummaryController = Em.Controller.extend(App.WidgetSectionMix
           };
 
           serviceDefinitions.forEach(function (definition) {
+            definition.set('isCollapsed', true);
             Object.keys(definitionTypes).forEach(function (type) {
               if (definition.get(type)) {
-                definition.set('isCollapsed', true);
                 definitionTypes[type].push(definition);
                 serviceDefinitions = serviceDefinitions.without(definition);
               }


[12/50] [abbrv] ambari git commit: AMBARI-19577. Add Livy session recovery configurations in Ambari - fix merge issue (Saisai Shao via smohanty)

Posted by nc...@apache.org.
AMBARI-19577. Add Livy session recovery configurations in Ambari - fix merge issue (Saisai Shao via smohanty)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: b00cf74f6cecb984381eeed9e464ad1db6461a18
Parents: e7d0e78
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Fri Feb 10 16:53:45 2017 -0800
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Fri Feb 10 16:53:45 2017 -0800

----------------------------------------------------------------------
 .../stacks/HDP/2.6/services/SPARK2/configuration/livy2-conf.xml    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b00cf74f/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK2/configuration/livy2-conf.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK2/configuration/livy2-conf.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK2/configuration/livy2-conf.xml
index c8a65bd..c21a5e6 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK2/configuration/livy2-conf.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK2/configuration/livy2-conf.xml
@@ -85,8 +85,8 @@
             Whether to enable HiveContext in livy interpreter
         </description>
         <on-ambari-upgrade add="false"/>
-    <property>
     </property>
+    <property>
         <name>livy.server.recovery.mode</name>
         <value>recovery</value>
         <description>


[47/50] [abbrv] ambari git commit: AMBARI-19846. ambari-agent.out getting filled with dummy traceback. (Attila Doroszlai via stoader)

Posted by nc...@apache.org.
AMBARI-19846. ambari-agent.out getting filled with dummy traceback. (Attila Doroszlai via stoader)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 97f8ba813bd5591694e28ec22e1372464423d519
Parents: 4ce8641
Author: Attila Doroszlai <ad...@hortonworks.com>
Authored: Mon Feb 6 15:54:55 2017 +0100
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Mon Feb 13 15:45:36 2017 -0500

----------------------------------------------------------------------
 .../ambari_agent/CustomServiceOrchestrator.py     | 12 ++++--------
 .../ambari_agent/TestCustomServiceOrchestrator.py | 18 ++++++++++++++++++
 2 files changed, 22 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/97f8ba81/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
index 9baaf08..e70c2d2 100644
--- a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
+++ b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
@@ -309,14 +309,10 @@ class CustomServiceOrchestrator():
         server_url_prefix = command['hostLevelParams']['jdk_location']
       else:
         server_url_prefix = command['commandParams']['jdk_location']
-        
-      task_id = "status"
-      
-      try:
-        task_id = command['taskId']
-        command_name = command['roleCommand']
-      except KeyError:
-        pass  # Status commands have no taskId
+
+      # Status commands have no taskId nor roleCommand
+      task_id = command['taskId'] if 'taskId' in command else 'status'
+      command_name = command['roleCommand'] if 'roleCommand' in command else None
 
       if forced_command_name is not None:  # If not supplied as an argument
         command_name = forced_command_name

http://git-wip-us.apache.org/repos/asf/ambari/blob/97f8ba81/ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py b/ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py
index 3985c5a..8e5e9a3 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py
@@ -28,6 +28,7 @@ from unittest import TestCase
 import threading
 import tempfile
 import time
+import traceback
 from threading import Thread
 
 from mock.mock import MagicMock, patch
@@ -278,6 +279,23 @@ class TestCustomServiceOrchestrator(TestCase):
     self.assertTrue(run_file_mock.called)
     self.assertEqual(run_file_mock.call_count, 3)
 
+    # running a status command
+    run_file_mock.reset_mock()
+    def return_traceback(*args, **kwargs):
+      return {
+        'stderr': traceback.format_exc(),
+        'stdout': '',
+        'exitcode': 0,
+      }
+    run_file_mock.side_effect = return_traceback
+
+    status_command = dict(command)
+    status_command['commandType'] = 'STATUS_COMMAND'
+    del status_command['taskId']
+    del status_command['roleCommand']
+    ret = orchestrator.runCommand(status_command, "out.txt", "err.txt")
+    self.assertEqual('None\n', ret['stderr'])
+
     run_file_mock.reset_mock()
 
     # Case when we force another command


[15/50] [abbrv] ambari git commit: AMBARI-19975. Hive2. Visual Explain -Show additional info when you click on a box, i.e. can drill down to get more info on operators. (pallavkul)

Posted by nc...@apache.org.
AMBARI-19975. Hive2. Visual Explain -Show additional info when you click on a box, i.e. can drill down to get more info on operators. (pallavkul)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 1d1253a6471113a78dd22faf453439ab13a19e48
Parents: 2364295
Author: pallavkul <pa...@gmail.com>
Authored: Sat Feb 11 17:06:43 2017 +0530
Committer: pallavkul <pa...@gmail.com>
Committed: Sat Feb 11 17:06:43 2017 +0530

----------------------------------------------------------------------
 .../ui/app/components/visual-explain-detail.js  | 31 +++++++++++++
 .../ui/app/components/visual-explain.js         | 26 ++++++++++-
 .../resources/ui/app/routes/queries/query.js    | 13 ++++--
 .../src/main/resources/ui/app/styles/app.scss   | 49 ++++++++++++++++++++
 .../components/visual-explain-detail.hbs        | 29 ++++++++++++
 .../app/templates/components/visual-explain.hbs |  5 ++
 6 files changed, 148 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/1d1253a6/contrib/views/hive20/src/main/resources/ui/app/components/visual-explain-detail.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/visual-explain-detail.js b/contrib/views/hive20/src/main/resources/ui/app/components/visual-explain-detail.js
new file mode 100644
index 0000000..2c9ba00
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/visual-explain-detail.js
@@ -0,0 +1,31 @@
+/**
+ * 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 Ember from 'ember';
+
+export default Ember.Component.extend({
+
+  classNames:['visual-explain-detail-container'],
+
+  actions:{
+    closeModal(){
+      this.sendAction('closeModal');
+    }
+  }
+
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/1d1253a6/contrib/views/hive20/src/main/resources/ui/app/components/visual-explain.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/visual-explain.js b/contrib/views/hive20/src/main/resources/ui/app/components/visual-explain.js
index 6551974..6805bb8 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/components/visual-explain.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/visual-explain.js
@@ -20,8 +20,13 @@ import Ember from 'ember';
 import explain from '../utils/hive-explainer';
 
 export default Ember.Component.extend({
+
   visualExplainJson:'',
 
+  showDetailsModal: false,
+
+  explainDetailData: '',
+
   visualExplainInput: Ember.computed('visualExplainJson', function () {
     return this.get('visualExplainJson');
   }),
@@ -39,6 +44,7 @@ export default Ember.Component.extend({
       .attr('height', height);
 
     const container = svg.append('g');
+
     const zoom =
       d3.zoom()
         .scaleExtent([1 / 10, 4])
@@ -49,16 +55,34 @@ export default Ember.Component.extend({
       svg
         .call(zoom);
 
-    const onRequestDetail = data => this.sendAction('showStepDetail', data);
+    const onRequestDetail = data => this.set('explainDetailData', JSON.stringify( data, null, '  ') );
 
     explain(JSON.parse(this.get('visualExplainInput')), svg, container, zoom, onRequestDetail);
 
   },
 
+  click(event){
+
+    if(this.get('explainDetailData') === ''){
+      return;
+    }
+
+    Ember.run.later(() => {
+      this.set('showDetailsModal', true);
+    }, 100);
+  },
+
   actions:{
     expandQueryResultPanel(){
       this.sendAction('expandQueryResultPanel');
+    },
+
+    closeModal(){
+      this.set('showDetailsModal', false);
+      this.set('explainDetailData', '');
+      false;
     }
+
   }
 
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/1d1253a6/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js b/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js
index 4f60229..72682f5 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js
@@ -221,11 +221,8 @@ export default Ember.Route.extend({
           .then((status) => {
 
               self.get('controller').set('isJobSuccess', true);
-              self.send('getJob', data);
 
-              if(isVisualExplainQuery){
-                self.send('showVisualExplain');
-              }
+              self.send('getJob', data);
 
               //Last log
               self.send('fetchLogs');
@@ -290,6 +287,8 @@ export default Ember.Route.extend({
       var self = this;
       var data = data;
 
+      let isVisualExplainQuery = this.get('controller').get('isVisualExplainQuery');
+
       let jobId = data.job.id;
       let dateSubmitted = data.job.dateSubmitted;
 
@@ -312,6 +311,12 @@ export default Ember.Route.extend({
         self.get('controller.model').set('previousPage', previousPage + 1 );
         self.get('controller.model').set('nextPage', nextPage + 1);
 
+        if(isVisualExplainQuery){
+          Ember.run.later(() => {
+            self.send('showVisualExplain');
+          }, 500);
+        }
+
       }, function(reason) {
         // on rejection
         console.log('reason' , reason);

http://git-wip-us.apache.org/repos/asf/ambari/blob/1d1253a6/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss b/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss
index 1dc86d7..6469b2e 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss
+++ b/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss
@@ -318,6 +318,7 @@ pre {
 
 .query-editor-results {
   padding-right: 15px;
+  position: relative;
 }
 
 .query-result-table {
@@ -980,3 +981,51 @@ ul.dropdown-menu {
 .break-word{
   word-break: break-all;
 }
+
+.visual-explain-detail-container {
+  width: 500px;
+  position: absolute;
+  top: 50px;
+  right: 0;
+  background-color: #FFF;
+  max-height: 70vh;
+  overflow-y: auto;
+}
+
+.visual-explain-detail{
+  border: 1px solid #DDD;
+  .close{
+    margin: 10px 15px;
+    z-index: 9999;
+  }
+
+  .header{
+    border-bottom: 1px solid #DDD; padding: 10px 0;
+    .icon{
+      padding:10px;
+    }
+    .join-type {
+      font-size: 20px; font-weight: bold
+    }
+  }
+
+  .vector-info{
+    border: 1px solid #DDD; padding:20px; background-color:#ED6265; color:#FFF; font-weight: bold; margin: 10px 0;
+  }
+  .block{
+    border: 1px solid #DDD; padding:20px; margin: 10px 0;
+
+    .block-header{
+      font-size: 20px; font-weight: bold;
+    }
+    .block-body{
+      padding: 10px 0;
+    }
+
+    .divider{
+      height: 1px; border-top:1px solid #DDD; margin: 10px 0;
+    }
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/1d1253a6/contrib/views/hive20/src/main/resources/ui/app/templates/components/visual-explain-detail.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/visual-explain-detail.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/visual-explain-detail.hbs
new file mode 100644
index 0000000..3df8e94
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/visual-explain-detail.hbs
@@ -0,0 +1,29 @@
+{{!
+* 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.
+}}
+
+<div class="clearfix visual-explain-detail">
+  <div class="pull-right close">  <a href="javascript:void(0)" {{action "closeModal"}}>{{fa-icon "close"}}</a></div>
+  <div class="clearfix header" >
+  </div>
+  <div class="col-md-12">
+    <div>&nbsp;</div>
+    <pre class="prettyprint">{{explainDetailData}}</pre>
+  </div>
+</div>
+
+{{yield}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/1d1253a6/contrib/views/hive20/src/main/resources/ui/app/templates/components/visual-explain.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/visual-explain.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/visual-explain.hbs
index 4238d43..e0ceaa2 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/templates/components/visual-explain.hbs
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/visual-explain.hbs
@@ -34,4 +34,9 @@
   <div id="explain-container" ></div>
 {{/unless}}
 
+{{#if showDetailsModal}}
+  {{visual-explain-detail closeModal='closeModal' explainDetailData=explainDetailData}}
+{{/if}}
+
+
 {{yield}}


[37/50] [abbrv] ambari git commit: AMBARI-19830. HDP 3.0 TP - Support changed configs and scripts for HDFS (alejandro)

Posted by nc...@apache.org.
AMBARI-19830. HDP 3.0 TP - Support changed configs and scripts for HDFS (alejandro)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: fe27598ad828b51fa2740bed042224b7169e7b76
Parents: f27beb1
Author: Alejandro Fernandez <af...@hortonworks.com>
Authored: Thu Jan 26 17:58:13 2017 -0800
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Mon Feb 13 15:45:35 2017 -0500

----------------------------------------------------------------------
 .../HDFS/3.0.0.3.0/configuration/hdfs-site.xml  |   4 +
 .../3.0.0.3.0/package/scripts/params_linux.py   |   2 +-
 .../HDFS/3.0.0.3.0/package/scripts/utils.py     |   8 +-
 .../stacks/2.5/HIVE/test_hive_server_int.py     |   2 +-
 ambari-server/src/test/python/unitTests.py      | 106 +++++++++++++++++--
 5 files changed, 106 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/fe27598a/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/configuration/hdfs-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/configuration/hdfs-site.xml b/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/configuration/hdfs-site.xml
index 689b6d08..60fde60 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/configuration/hdfs-site.xml
+++ b/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/configuration/hdfs-site.xml
@@ -35,13 +35,17 @@
     </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
+  <!--
+  This property is deleted in Hadoop 3.0. Need to remove it during Stack Upgrade.
   <property>
     <name>dfs.support.append</name>
     <value>true</value>
     <description>to enable dfs append</description>
     <final>true</final>
     <on-ambari-upgrade add="true"/>
+    <deleted>true</deleted>
   </property>
+  -->
   <property>
     <name>dfs.webhdfs.enabled</name>
     <value>true</value>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fe27598a/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/scripts/params_linux.py
index f7aa4c9..62a5edd 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/scripts/params_linux.py
@@ -96,7 +96,7 @@ namenode_backup_dir = default("/configurations/hadoop-env/namenode_backup_dir",
 # hadoop default parameters
 mapreduce_libs_path = "/usr/lib/hadoop-mapreduce/*"
 hadoop_libexec_dir = stack_select.get_hadoop_dir("libexec")
-hadoop_bin = stack_select.get_hadoop_dir("sbin")
+hadoop_bin = stack_select.get_hadoop_dir("bin")
 hadoop_bin_dir = stack_select.get_hadoop_dir("bin")
 hadoop_home = stack_select.get_hadoop_dir("home")
 hadoop_secure_dn_user = hdfs_user

http://git-wip-us.apache.org/repos/asf/ambari/blob/fe27598a/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/scripts/utils.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/scripts/utils.py b/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/scripts/utils.py
index 48f5a1f..ab4308c 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/scripts/utils.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/scripts/utils.py
@@ -250,19 +250,19 @@ def service(action=None, name=None, user=None, options="", create_pid_dir=False,
         except ComponentIsNotRunning:
           pass
 
-  hadoop_daemon = format("{hadoop_bin}/hadoop-daemon.sh")
+  hdfs_bin = format("{hadoop_bin}/hdfs")
 
   if user == "root":
-    cmd = [hadoop_daemon, "--config", params.hadoop_conf_dir, action, name]
+    cmd = [hdfs_bin, "--config", params.hadoop_conf_dir, "--daemon", action, name]
     if options:
       cmd += [options, ]
     daemon_cmd = as_sudo(cmd)
   else:
-    cmd = format("{ulimit_cmd} {hadoop_daemon} --config {hadoop_conf_dir} {action} {name}")
+    cmd = format("{ulimit_cmd} {hdfs_bin} --config {hadoop_conf_dir} --daemon {action} {name}")
     if options:
       cmd += " " + options
     daemon_cmd = as_user(cmd, user)
-     
+
   if action == "start":
     # remove pid file from dead process
     File(pid_file, action="delete", not_if=process_id_exists_command)

http://git-wip-us.apache.org/repos/asf/ambari/blob/fe27598a/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py b/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
index fb97612..6f53762 100644
--- a/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
+++ b/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
@@ -243,7 +243,7 @@ class TestHiveServerInteractive(RMFTestCase):
     self.assertNoMoreResources()
 
   '''
-  restart should not call slider destroy
+  #restart should not call slider destroy
   '''
   @patch("os.path.isfile")
   @patch("resource_management.libraries.functions.copy_tarball.copy_to_hdfs")

http://git-wip-us.apache.org/repos/asf/ambari/blob/fe27598a/ambari-server/src/test/python/unitTests.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/unitTests.py b/ambari-server/src/test/python/unitTests.py
index 7941ed3..a8e72e9 100644
--- a/ambari-server/src/test/python/unitTests.py
+++ b/ambari-server/src/test/python/unitTests.py
@@ -20,6 +20,7 @@ import unittest
 import multiprocessing
 import os
 import sys
+import re
 import traceback
 from Queue import Empty
 from random import shuffle
@@ -86,6 +87,99 @@ def get_stack_name():
 def get_stack_name():
   return "HDP"
 
+def extract_extends_field_from_file(metainfo):
+  pattern = re.compile(r"^\s*?<extends>(.*?)</extends>", re.IGNORECASE)
+  if os.path.isfile(metainfo):
+    with open(metainfo) as f:
+        for line in f.readlines():
+          m = pattern.match(line)
+          if m and len(m.groups()) == 1:
+            extract = m.groups(1)[0]
+            return extract
+  return None
+
+def get_extends_field_from_metainfo(service_metainfo):
+  """
+  Parse the metainfo.xml file to retrieve the <extends> value.
+  
+  @param service_metainfo: Path to the service metainfo.xml file
+  :return Extract the "extends" field if it exists and return its value. Otherwise, return None.
+  """
+  extract = extract_extends_field_from_file(service_metainfo)
+  if extract is not None:
+    return extract
+
+  # If couldn't find it in the service's metainfo.xml, check the stack's metainfo.xml
+  stack_metainfo = os.path.join(os.path.dirname(service_metainfo), "..", "..", "metainfo.xml")
+  extract = extract_extends_field_from_file(stack_metainfo)
+
+  return extract
+
+def resolve_paths_to_import_from_common_services(metainfo_file, base_stack_folder, common_services_parent_dir, service):
+  """
+  Get a list of paths to append to sys.path in order to import all of the needed modules.
+  This is important when a service has  multiple definitions in common-services so that we import the correct one
+  instead of a higher version.
+  
+  @param metainfo_file: Path to the metainfo.xml file.
+  @param base_stack_folder: Path to stacks folder that does not include the version number. This can potentially be None.
+  @param common_services_parent_dir: Path to the common-services directory for a specified service, not including the version.
+  @param service: Service name
+  :return A list of paths to insert to sys.path by following the chain of inheritence.
+  """
+  paths_to_import = []
+
+  if metainfo_file is None or service is None:
+    return paths_to_import
+
+  # This could be either a version number of a path to common-services
+  extract = get_extends_field_from_metainfo(metainfo_file)
+  if extract is not None:
+    if "common-services" in extract:
+      # If in common-services, we are done.
+      scripts_path = os.path.join(common_services_parent_dir, extract, "package", "scripts")
+      paths_to_import.append(scripts_path)
+    else:
+      # If a version number, we need to import it and check that version as well.
+      inherited_from_older_version_path = os.path.join(base_stack_folder, "..", extract)
+
+      metainfo_file = os.path.join(inherited_from_older_version_path, "services", service, "metainfo.xml")
+      if os.path.isdir(inherited_from_older_version_path):
+        paths_to_import += resolve_paths_to_import_from_common_services(metainfo_file, inherited_from_older_version_path, common_services_parent_dir, service)
+  else:
+    print "Service %s. Could not get extract <extends></extends> from metainfo file: %s. This may prevent modules from being imported." % (service, str(metainfo_file))
+
+  return paths_to_import
+
+def append_paths(server_src_dir, base_stack_folder, service):
+  """
+  Append paths to sys.path in order to import modules.
+  
+  @param server_src_dir: Server source directory
+  @param base_stack_folder: If present, the directory of the stack.
+  @param service: Service name.
+  """
+  paths_to_add = []
+  if base_stack_folder is not None:
+    # Append paths
+    metainfo_file = None
+    if base_stack_folder is not None:
+      metainfo_file = os.path.join(base_stack_folder, "services", service, "metainfo.xml")
+
+    common_services_parent_dir = os.path.join(server_src_dir, "main", "resources")
+    paths_to_add = resolve_paths_to_import_from_common_services(metainfo_file, base_stack_folder, common_services_parent_dir, service)
+  else:
+    # We couldn't add paths using the base directory, be greedy and add all available for this service in common-services.
+    # Add the common-services scripts directories to the PATH
+    base_common_services_folder = os.path.join(server_src_dir, "main", "resources", "common-services")
+    for folder, subFolders, files in os.walk(os.path.join(base_common_services_folder, service)):
+      if "package/scripts" in folder:
+        paths_to_add.append(folder)
+
+  for path in paths_to_add:
+    if os.path.exists(path) and path not in sys.path:
+      sys.path.append(path)
+
 def stack_test_executor(base_folder, service, stack, test_mask, executor_result):
   """
   Stack tests executor. Must be executed in separate process to prevent module
@@ -95,6 +189,7 @@ def stack_test_executor(base_folder, service, stack, test_mask, executor_result)
   server_src_dir = get_parent_path(base_folder, 'src')
   script_folders = set()
 
+  base_stack_folder = None
   if stack is not None:
     base_stack_folder = os.path.join(server_src_dir,
                                      "main", "resources", "stacks", get_stack_name(), stack)
@@ -104,16 +199,7 @@ def stack_test_executor(base_folder, service, stack, test_mask, executor_result)
       if os.path.split(root)[-1] in ["scripts", "files"] and service in root:
         script_folders.add(root)
 
-  # Add the common-services scripts directories to the PATH
-  base_commserv_folder = os.path.join(server_src_dir, "main", "resources", "common-services")
-  for folder, subFolders, files in os.walk(os.path.join(base_commserv_folder, service)):
-    # folder will return the versions of the services
-    scripts_dir = os.path.join(folder, "package", "scripts")
-    if os.path.exists(scripts_dir):
-      script_folders.add(scripts_dir)
-
-  sys.path.extend(script_folders)
-
+  append_paths(server_src_dir, base_stack_folder, service)
   tests = get_test_files(base_folder, mask = test_mask)
 
   #TODO Add an option to randomize the tests' execution


[08/50] [abbrv] ambari git commit: AMBARI-19831. ADDENDUM. HDP 3.0 TP - Support changed configs and scripts for YARN/MR (alejandro)

Posted by nc...@apache.org.
AMBARI-19831. ADDENDUM. HDP 3.0 TP - Support changed configs and scripts for YARN/MR (alejandro)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 4381561f92aeb91b1a2b3cafff4a860efde81dff
Parents: e8a9961
Author: Alejandro Fernandez <af...@hortonworks.com>
Authored: Fri Feb 10 13:09:12 2017 -0800
Committer: Alejandro Fernandez <af...@hortonworks.com>
Committed: Fri Feb 10 13:16:34 2017 -0800

----------------------------------------------------------------------
 .../common-services/YARN/3.0.0.3.0/package/scripts/service.py    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4381561f/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/package/scripts/service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/package/scripts/service.py b/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/package/scripts/service.py
index 78b2428..e0d6475 100644
--- a/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/package/scripts/service.py
+++ b/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/package/scripts/service.py
@@ -44,7 +44,7 @@ def service(componentName, action='start', serviceName='yarn'):
   if serviceName == 'mapreduce' and componentName == 'historyserver':
     delete_pid_file = True
     daemon = format("{mapred_bin}/mr-jobhistory-daemon.sh")
-    pid_file = format("{mapred_pid_dir}/mapred-{mapred_user}-{componentName}.pid")
+    pid_file = format("{mapred_pid_dir}/hadoop-{mapred_user}-{componentName}.pid")
     usr = params.mapred_user
     log_dir = params.mapred_log_dir
   else:
@@ -52,7 +52,7 @@ def service(componentName, action='start', serviceName='yarn'):
     # may not work correctly when stopping the service
     delete_pid_file = False
     daemon = format("{yarn_bin}/yarn-daemon.sh")
-    pid_file = format("{yarn_pid_dir}/yarn-{yarn_user}-{componentName}.pid")
+    pid_file = format("{yarn_pid_dir}/hadoop-{yarn_user}-{componentName}.pid")
     usr = params.yarn_user
     log_dir = params.yarn_log_dir
 


[50/50] [abbrv] ambari git commit: Merge branch 'trunk' into branch-dev-patch-upgrade

Posted by nc...@apache.org.
Merge branch 'trunk' into branch-dev-patch-upgrade


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: a8fb4c6d4170d25eade589d1b9f2f59c9584ee16
Parents: 97f8ba8 7cb9a6a
Author: Nate Cole <nc...@hortonworks.com>
Authored: Mon Feb 13 16:03:10 2017 -0500
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Mon Feb 13 16:03:10 2017 -0500

----------------------------------------------------------------------
 .../controllers/clusters/UserAccessListCtrl.js  |    5 +-
 .../clusters/UserAccessListCtrl_test.js         |   90 -
 ambari-agent/conf/unix/ambari-agent             |    7 +-
 ambari-agent/pom.xml                            |    3 +
 .../ambari_agent/CustomServiceOrchestrator.py   |   15 +-
 .../python/ambari_agent/TestProcessUtils.py     |  224 ++
 .../src/test/python/ambari_agent/TestShell.py   |    5 +-
 .../resource_management/TestContentSources.py   |   11 +-
 .../ambari_commons/credential_store_helper.py   |   45 +
 .../src/main/python/ambari_commons/firewall.py  |    3 +
 .../src/main/python/ambari_commons/network.py   |   39 +
 .../main/python/ambari_commons/process_utils.py |  100 +
 .../src/main/python/ambari_commons/shell.py     |   54 +-
 .../python/resource_management/core/logger.py   |    4 +
 .../python/resource_management/core/shell.py    |    6 +-
 .../python/resource_management/core/source.py   |    8 +-
 .../functions/get_not_managed_resources.py      |   19 +-
 .../HDP/2.1.1/services/STORM/metrics.json       |   10 +-
 .../ambari-infra-solr-plugin/pom.xml            |   56 +
 .../InfraKerberosHostValidator.java             |   54 +
 .../InfraRuleBasedAuthorizationPlugin.java      |  542 +++
 .../InfraUserRolesLookupStrategy.java           |   49 +
 .../InfraKerberosHostValidatorTest.java         |  114 +
 .../InfraRuleBasedAuthorizationPluginTest.java  |  247 ++
 .../InfraUserRolesLookupStrategyTest.java       |   83 +
 .../ambari-logsearch-assembly/pom.xml           |   15 +-
 .../logsearch/common/LogSearchConstants.java    |    1 -
 .../UserConfigRequestQueryConverter.java        |   17 +-
 .../ambari/logsearch/doc/DocConstants.java      |    3 -
 .../logsearch/manager/UserConfigManager.java    |   53 +-
 .../request/UserConfigParamDefinition.java      |    6 -
 .../model/request/impl/UserConfigRequest.java   |   15 +-
 .../model/response/UserConfigData.java          |   11 -
 .../logsearch/rest/UserConfigResource.java      |   17 +-
 .../ambari/logsearch/solr/SolrConstants.java    |    1 -
 .../src/main/webapp/index.html                  |  211 +-
 .../daterangepicker/css/daterangepicker.css     |  415 +++
 .../daterangepicker/js/daterangepicker.js       | 1560 ++++++++
 .../libs/custom/timezone/WorldMapGenerator.js   | 3474 ++++++++++++++++++
 .../libs/custom/timezone/jstz-1.0.4.min.js      |    2 +
 .../daterangepicker/css/daterangepicker.css     |  415 ---
 .../other/daterangepicker/js/daterangepicker.js | 1560 --------
 .../libs/other/timezone/WorldMapGenerator.js    | 3471 -----------------
 .../libs/other/timezone/jstz-1.0.4.min.js       |    2 -
 .../webapp/libs/other/timezone/mapdata.json     | 3158 ----------------
 .../src/main/webapp/scripts/Init.js             |  439 ++-
 .../scripts/views/common/DashboardLayout.js     |   80 -
 .../scripts/views/common/EventHistoryLayout.js  |    1 -
 .../views/dashboard/DashboardLayoutView.js      |  354 --
 .../scripts/views/dashboard/MainLayoutView.js   | 1259 ++++---
 .../views/dialog/ApplySearchFilterView.js       |   41 +-
 .../views/tabs/EventHistoryLayoutView.js        |    1 -
 .../dashboard/DashboardLayoutView_tmpl.html     |   28 -
 .../UserConfigRequestQueryConverterTest.java    |    4 +-
 ambari-logsearch/pom.xml                        |    1 +
 .../sink/flume/FlumeTimelineMetricsSink.java    |    2 +
 .../conf/hadoop-metrics2-hbase.properties.j2    |   49 -
 .../src/main/conf/hadoop-metrics2.properties.j2 |   58 -
 .../metrics/timeline/PhoenixHBaseAccessor.java  |    6 +-
 .../TimelineMetricAppAggregator.java            |    4 +-
 .../TimelineMetricClusterAggregatorSecond.java  |   92 +-
 .../aggregators/TimelineMetricReadHelper.java   |    3 +-
 ...melineMetricClusterAggregatorSecondTest.java |  114 +-
 ambari-server/src/main/assemblies/server.xml    |   21 +
 .../server/actionmanager/ActionDBAccessor.java  |    5 +-
 .../actionmanager/ActionDBAccessorImpl.java     |    6 +-
 .../server/actionmanager/ActionScheduler.java   |   53 +-
 .../query/render/ClusterBlueprintRenderer.java  |  122 +
 .../internal/ServiceResourceProvider.java       |    1 -
 .../metrics/RestMetricsPropertyProvider.java    |  106 +-
 .../metrics/timeline/AMSPropertyProvider.java   |    8 +
 .../system/impl/AmbariMetricSinkImpl.java       |   44 +-
 .../server/orm/dao/AlertDefinitionDAO.java      |    7 +-
 .../ambari/server/orm/dao/AlertDispatchDAO.java |   45 +-
 .../apache/ambari/server/orm/dao/ViewDAO.java   |    8 +-
 .../server/orm/entities/AlertGroupEntity.java   |    9 +-
 .../orm/entities/ServiceDesiredStateEntity.java |   21 -
 .../org/apache/ambari/server/state/Service.java |    8 -
 .../apache/ambari/server/state/ServiceImpl.java |   40 +-
 .../ambari/server/state/theme/TabLayout.java    |    8 +-
 .../ambari/server/topology/AmbariContext.java   |   36 +-
 .../server/upgrade/UpgradeCatalog250.java       |   85 +-
 .../apache/ambari/server/view/ViewRegistry.java |   62 +
 .../main/resources/Ambari-DDL-Derby-CREATE.sql  |    1 -
 .../main/resources/Ambari-DDL-MySQL-CREATE.sql  |    1 -
 .../main/resources/Ambari-DDL-Oracle-CREATE.sql |    1 -
 .../resources/Ambari-DDL-Postgres-CREATE.sql    |    1 -
 .../resources/Ambari-DDL-SQLAnywhere-CREATE.sql |    1 -
 .../resources/Ambari-DDL-SQLServer-CREATE.sql   |    1 -
 .../configuration/infra-solr-security-json.xml  |   62 +-
 .../0.1.0/package/scripts/params.py             |   29 +-
 .../properties/infra-solr-security.json.j2      |   46 +
 .../HDP/grafana-solr-cores-dashboard.json       | 3162 ++++++++++++++++
 .../HDP/grafana-solr-hosts-dashboard.json       |  538 +++
 .../AMBARI_METRICS/0.1.0/package/scripts/ams.py |    5 +-
 .../package/scripts/metrics_grafana_util.py     |    6 +-
 .../0.1.0/package/scripts/network.py            |   39 -
 .../0.1.0/package/scripts/params.py             |   38 +-
 .../0.1.0/package/scripts/service_check.py      |    4 +-
 .../hadoop-metrics2-hbase.properties.j2         |    4 +
 .../DRUID/0.9.2/configuration/druid-common.xml  |   10 +-
 .../0.9.2/configuration/druid-superset-env.xml  |  115 +
 .../0.9.2/configuration/druid-superset.xml      |  178 +
 .../common-services/DRUID/0.9.2/metainfo.xml    |   28 +-
 .../DRUID/0.9.2/package/scripts/druid_node.py   |    2 +-
 .../DRUID/0.9.2/package/scripts/params.py       |   45 +-
 .../0.9.2/package/scripts/status_params.py      |    2 +
 .../DRUID/0.9.2/package/scripts/superset.py     |  153 +
 .../DRUID/0.9.2/package/templates/superset.sh   |   95 +
 .../DRUID/0.9.2/quicklinks/quicklinks.json      |   13 +
 .../DRUID/0.9.2/role_command_order.json         |   18 +
 .../DRUID/0.9.2/themes/theme.json               |   84 +-
 .../hadoop-metrics2.properties.xml              |  125 -
 .../common-services/HDFS/2.1.0.2.0/metainfo.xml |    1 -
 .../package/alerts/alert_metrics_deviation.py   |   14 +-
 .../2.1.0.2.0/package/scripts/zkfc_slave.py     |    3 +-
 .../HDFS/3.0.0.3.0/configuration/core-site.xml  |   30 +-
 .../HDFS/3.0.0.3.0/configuration/hadoop-env.xml |   42 +-
 .../hadoop-metrics2.properties.xml              |    2 +-
 .../3.0.0.3.0/configuration/hadoop-policy.xml   |   22 +-
 .../HDFS/3.0.0.3.0/configuration/hdfs-log4j.xml |    2 +-
 .../configuration/hdfs-logsearch-conf.xml       |    6 +-
 .../HDFS/3.0.0.3.0/configuration/hdfs-site.xml  |  109 +-
 .../HDFS/3.0.0.3.0/configuration/ssl-client.xml |   14 +-
 .../HDFS/3.0.0.3.0/configuration/ssl-server.xml |   16 +-
 .../package/alerts/alert_metrics_deviation.py   |   14 +-
 .../3.0.0.3.0/package/scripts/zkfc_slave.py     |    1 +
 .../HIVE/0.12.0.2.0/package/scripts/hive.py     |    2 +-
 .../package/scripts/hive_interactive.py         |    6 +-
 .../package/scripts/hive_server_interactive.py  |   12 +-
 .../0.12.0.2.0/package/scripts/params_linux.py  |   43 +-
 .../0.5.0/configuration/logfeeder-env.xml       |    2 +
 .../0.5.0/configuration/logsearch-env.xml       |    2 +
 .../LOGSEARCH/0.5.0/metainfo.xml                |    6 +
 .../LOGSEARCH/0.5.0/package/scripts/params.py   |   22 +-
 .../0.5.0/package/scripts/setup_logfeeder.py    |   28 +-
 .../0.5.0/package/scripts/setup_logsearch.py    |   22 +-
 .../4.0.0.2.0/package/scripts/params_linux.py   |   20 +-
 .../SPARK/1.2.1/package/scripts/params.py       |    1 +
 .../SPARK/1.2.1/package/scripts/setup_livy.py   |    8 +
 .../SPARK2/2.0.0/package/scripts/params.py      |    1 +
 .../SPARK2/2.0.0/package/scripts/setup_livy2.py |    8 +
 .../common-services/STORM/0.10.0/metrics.json   |    8 +-
 .../common-services/STORM/0.9.1/alerts.json     |   30 +-
 .../common-services/STORM/0.9.1/metrics.json    |    8 +-
 .../STORM/0.9.1/quicklinks/quicklinks.json      |   25 +-
 .../common-services/STORM/0.9.3/metrics.json    |    8 +-
 .../configuration-mapred/mapred-env.xml         |   14 +-
 .../mapred-logsearch-conf.xml                   |    6 +-
 .../configuration-mapred/mapred-site.xml        |   90 +-
 .../YARN/3.0.0.3.0/configuration/yarn-env.xml   |   26 +-
 .../YARN/3.0.0.3.0/configuration/yarn-log4j.xml |    2 +-
 .../configuration/yarn-logsearch-conf.xml       |    6 +-
 .../YARN/3.0.0.3.0/configuration/yarn-site.xml  |  225 +-
 .../common-services/YARN/3.0.0.3.0/metainfo.xml |    6 +-
 .../YARN/3.0.0.3.0/package/scripts/service.py   |    4 +-
 .../3.0.0.3.0/package/scripts/status_params.py  |   10 +-
 .../YARN/3.0.0.3.0/service_advisor.py           |   15 +-
 .../package/scripts/livy2_config_template.py    |  107 +
 .../0.6.0.2.5/package/scripts/master.py         |   42 +-
 .../0.6.0.2.5/package/scripts/params.py         |    8 +
 .../2.0.6/hooks/before-START/scripts/params.py  |    4 +-
 .../scripts/shared_initialization.py            |   17 +-
 .../services/YARN/configuration/yarn-site.xml   |    4 +-
 .../stacks/HDP/2.3/upgrades/config-upgrade.xml  |   18 +
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml |   18 +
 .../stacks/HDP/2.3/upgrades/upgrade-2.6.xml     |    3 +
 .../stacks/HDP/2.4/upgrades/config-upgrade.xml  |   17 +
 .../HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml |   21 +
 .../stacks/HDP/2.4/upgrades/upgrade-2.6.xml     |    3 +
 .../HIVE/configuration/beeline-log4j2.xml       |    2 +-
 .../services/HIVE/configuration/hive-env.xml    |   29 +
 .../HIVE/configuration/hive-exec-log4j.xml      |  114 +
 .../HIVE/configuration/hive-exec-log4j2.xml     |    2 +-
 .../HIVE/configuration/hive-interactive-env.xml |    4 +-
 .../services/HIVE/configuration/hive-log4j.xml  |  126 +
 .../services/HIVE/configuration/hive-log4j2.xml |    2 +-
 .../HIVE/configuration/llap-cli-log4j2.xml      |    2 +-
 .../HIVE/configuration/llap-daemon-log4j.xml    |    2 +-
 .../HIVE/configuration/webhcat-log4j.xml        |   83 +
 .../HDP/2.5/services/HIVE/themes/theme.json     |   48 +
 .../services/YARN/configuration/yarn-site.xml   |    6 +
 .../stacks/HDP/2.5/services/stack_advisor.py    |   72 +-
 .../stacks/HDP/2.5/upgrades/config-upgrade.xml  |   27 +
 .../HDP/2.5/upgrades/nonrolling-upgrade-2.5.xml |    8 +-
 .../HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml |   27 +
 .../stacks/HDP/2.5/upgrades/upgrade-2.5.xml     |    2 +-
 .../stacks/HDP/2.5/upgrades/upgrade-2.6.xml     |    4 +
 .../stacks/HDP/2.6/role_command_order.json      |   19 -
 .../stacks/HDP/2.6/services/DRUID/kerberos.json |   33 +
 .../stacks/HDP/2.6/services/DRUID/metainfo.xml  |    1 +
 .../hadoop-metrics2.properties.xml              |  125 +
 .../stacks/HDP/2.6/services/HDFS/metainfo.xml   |    3 +
 .../HIVE/configuration/hive-interactive-env.xml |   31 +-
 .../configuration/hive-interactive-site.xml     |   16 +
 .../services/SPARK/configuration/livy-conf.xml  |   24 +
 .../SPARK2/configuration/livy2-conf.xml         |   24 +
 .../services/YARN/configuration/yarn-site.xml   |   14 +-
 .../stacks/HDP/2.6/services/stack_advisor.py    |   23 +
 .../services/YARN/configuration/yarn-site.xml   |   13 +
 .../PERF/1.0/hooks/before-ANY/scripts/hook.py   |    9 +
 .../PERF/1.0/hooks/before-ANY/scripts/params.py |   44 +
 .../before-ANY/scripts/shared_initialization.py |   94 +
 .../1.0/hooks/before-INSTALL/scripts/hook.py    |    1 +
 .../1.0/hooks/before-RESTART/scripts/hook.py    |    1 +
 .../PERF/1.0/hooks/before-START/scripts/hook.py |    1 +
 .../AMBARI_METRICS/configuration/ams-site.xml   |   36 +
 .../1.0/services/AMBARI_METRICS/metainfo.xml    |   46 +
 .../PERF/1.0/services/FAKEHBASE/metainfo.xml    |    2 +-
 .../PERF/1.0/services/FAKEHDFS/metainfo.xml     |    1 -
 .../PERF/1.0/services/FAKEZOOKEEPER/alerts.json |    4 +-
 .../1.0/services/FAKEZOOKEEPER/kerberos.json    |    4 +-
 .../1.0/services/FAKEZOOKEEPER/metainfo.xml     |    7 +-
 .../package/scripts/zookeeper_client.py         |    2 +-
 .../package/scripts/zookeeper_server.py         |    2 +-
 .../stacks/PERF/1.0/services/stack_advisor.py   |   37 +
 .../src/main/resources/stacks/stack_advisor.py  |   51 +-
 .../actionmanager/TestActionScheduler.java      |  119 +-
 .../render/ClusterBlueprintRendererTest.java    |  143 +
 .../RestMetricsPropertyProviderTest.java        |    4 +-
 .../server/orm/dao/AlertDispatchDAOTest.java    |   20 +-
 .../state/cluster/AlertDataManagerTest.java     |    5 +-
 .../AlertNoticeDispatchServiceTest.java         |  159 +-
 .../server/topology/AmbariContextTest.java      |   69 +-
 .../server/upgrade/UpgradeCatalog250Test.java   |  218 +-
 .../AMBARI_METRICS/test_metrics_collector.py    |    6 +-
 .../AMBARI_METRICS/test_metrics_grafana.py      |    6 +-
 .../2.0.6/HDFS/test_alert_metrics_deviation.py  |    2 +
 .../stacks/2.0.6/HIVE/test_hive_client.py       |    4 +-
 .../stacks/2.0.6/HIVE/test_hive_metastore.py    |    6 +-
 .../stacks/2.0.6/HIVE/test_hive_server.py       |    4 +-
 .../stacks/2.4/LOGSEARCH/test_logfeeder.py      |   23 +-
 .../stacks/2.4/LOGSEARCH/test_logsearch.py      |   19 +-
 .../test/python/stacks/2.4/configs/default.json |    1 +
 .../stacks/2.5/HIVE/test_hive_server_int.py     |   12 +-
 .../python/stacks/2.5/SPARK/test_spark_livy.py  |   31 +
 .../stacks/2.5/common/test_stack_advisor.py     |  320 +-
 .../test/python/stacks/2.6/DRUID/test_druid.py  |   12 +-
 .../stacks/2.6/SPARK2/test_spark_livy2.py       |   31 +
 .../test/python/stacks/2.6/configs/default.json |    3 +
 .../HDP/2.1.1/services/STORM/metrics.json       |   10 +-
 .../rangerAdmin/step3_controller.js             |   47 +-
 .../rangerAdmin/step4_controller.js             |   68 +-
 .../rangerAdmin/wizard_controller.js            |   45 +-
 ambari-web/app/controllers/main/host/details.js |   69 +-
 ambari-web/app/controllers/main/service.js      |    2 +-
 .../controllers/main/service/info/configs.js    |   13 +-
 ambari-web/app/controllers/main/service/item.js |   67 +-
 .../service/manage_config_groups_controller.js  |   10 +-
 .../app/mappers/component_config_mapper.js      |   68 +-
 .../app/mappers/components_state_mapper.js      |    5 +-
 .../app/mappers/configs/config_groups_mapper.js |    2 +-
 ambari-web/app/mappers/server_data_mapper.js    |    1 +
 ambari-web/app/messages.js                      |    3 +-
 .../app/mixins/common/configs/configs_loader.js |    2 +-
 .../app/mixins/common/track_request_mixin.js    |   36 +-
 ambari-web/app/models/client_component.js       |    1 +
 ambari-web/app/models/host_component.js         |   17 +-
 ambari-web/app/models/service.js                |   21 +-
 ambari-web/app/router.js                        |   37 +-
 ambari-web/app/routes/main.js                   |   15 +-
 .../app/routes/ra_high_availability_routes.js   |    8 +-
 .../modal_popups/cluster_check_dialog.hbs       |   12 +-
 .../templates/main/admin/service_auto_start.hbs |   28 +-
 .../app/templates/main/dashboard/widgets.hbs    |   10 +-
 ambari-web/app/utils/ajax/ajax.js               |    2 +-
 .../views/common/configs/config_history_flow.js |    8 +-
 .../common/modal_popups/cluster_check_popup.js  |   68 +-
 .../app/views/main/admin/service_auto_start.js  |    8 +-
 ambari-web/app/views/main/dashboard/widget.js   |   11 +-
 ambari-web/app/views/main/dashboard/widgets.js  |  116 +-
 ambari-web/app/views/main/host.js               |    1 +
 ambari-web/app/views/main/service/menu.js       |    4 +-
 .../rangerAdmin/step3_controller_test.js        |   44 +-
 .../main/host/configs_service_test.js           |    2 +
 .../test/controllers/main/host/details_test.js  |    7 +
 .../main/service/info/config_test.js            |   87 +-
 .../test/controllers/main/service/item_test.js  |   46 +-
 .../test/controllers/main/service_test.js       |   31 +-
 .../common/configs/configs_loader_test.js       |    7 +-
 ambari-web/test/models/service_test.js          |   66 +-
 .../modal_popups/cluster_check_popup_test.js    |   48 +-
 .../views/main/admin/service_auto_start_test.js |    2 +
 .../test/views/main/dashboard/widget_test.js    |   21 +-
 .../test/views/main/dashboard/widgets_test.js   |  161 +-
 ambari-web/test/views/main/host_test.js         |   18 +-
 contrib/utils/perf/deploy-gce-perf-cluster.py   |    5 +-
 .../main/resources/ui/app/controllers/queue.js  |  103 +-
 .../main/resources/ui/app/controllers/queues.js |    2 +-
 .../src/main/resources/ui/app/models/queue.js   |   11 +
 .../src/main/resources/ui/app/serializers.js    |    5 +
 .../src/main/resources/ui/app/store.js          |    9 +
 .../main/resources/ui/app/templates/queue.hbs   |   55 +-
 .../view/hive2/resources/uploads/CSVParams.java |    2 +-
 .../hive2/resources/uploads/UploadService.java  |    2 +-
 .../resources/uploads/query/QueryGenerator.java |    1 -
 .../resources/uploads/query/RowFormat.java      |    2 +-
 .../resources/uploads/query/TableInfo.java      |    2 +-
 .../resources/upload/QueryGeneratorTest.java    |    2 +-
 .../apache/ambari/view/hive20/DataMigrator.java |   19 +-
 .../view/hive20/internal/dto/ColumnInfo.java    |   32 +-
 .../view/hive20/internal/dto/TableStats.java    |   11 +
 .../internal/parsers/TableMetaParserImpl.java   |    8 +
 .../generators/AlterTableQueryGenerator.java    |   82 +-
 .../generators/InsertFromQueryGenerator.java    |   77 +
 .../query/generators/QueryGenerationUtils.java  |    5 +-
 .../view/hive20/resources/browser/DDLProxy.java |    2 +-
 .../view/hive20/resources/jobs/JobService.java  |    1 +
 .../resources/system/ranger/RangerService.java  |   32 +-
 .../hive20/resources/uploads/CSVParams.java     |    2 +-
 .../resources/uploads/TableDataReader.java      |    5 +-
 .../hive20/resources/uploads/TableInput.java    |   51 -
 .../resources/uploads/UploadFromHdfsInput.java  |    8 +-
 .../hive20/resources/uploads/UploadService.java |  107 +-
 .../resources/uploads/parsers/Parser.java       |   11 +-
 .../resources/uploads/parsers/PreviewData.java  |    9 +-
 .../uploads/query/InsertFromQueryInput.java     |   10 +-
 .../resources/uploads/query/QueryGenerator.java |  143 -
 .../resources/uploads/query/RowFormat.java      |   57 -
 .../resources/uploads/query/TableInfo.java      |   97 -
 .../resources/ui/app/adapters/file-resource.js  |   26 +
 .../resources/ui/app/adapters/file-uploader.js  |   28 +
 .../src/main/resources/ui/app/adapters/query.js |    5 +
 .../resources/ui/app/adapters/saved-query.js    |    2 +-
 .../src/main/resources/ui/app/adapters/table.js |    6 +
 .../src/main/resources/ui/app/adapters/udf.js   |   39 +
 .../resources/ui/app/adapters/upload-table.js   |   93 +
 .../resources/ui/app/components/column-item.js  |    1 +
 .../resources/ui/app/components/create-table.js |    6 +-
 .../ui/app/components/csv-format-params.js      |   76 +
 .../resources/ui/app/components/edit-table.js   |  220 ++
 .../ui/app/components/fileresource-item.js      |   73 +
 .../resources/ui/app/components/jobs-browser.js |   39 +-
 .../ui/app/components/property-item.js          |    1 +
 .../resources/ui/app/components/query-editor.js |   10 +-
 .../ui/app/components/query-result-table.js     |    4 +
 .../resources/ui/app/components/radio-button.js |   40 +
 .../resources/ui/app/components/simple-table.js |   22 +
 .../app/components/table-advanced-settings.js   |   10 +
 .../ui/app/components/table-columns.js          |    3 +-
 .../ui/app/components/table-properties.js       |    3 +-
 .../ui/app/components/table-statistics.js       |    2 +-
 .../resources/ui/app/components/udf-edit.js     |   40 +
 .../resources/ui/app/components/udf-item.js     |  154 +
 .../main/resources/ui/app/components/udf-new.js |   41 +
 .../ui/app/components/upload-table-source.js    |   48 +
 .../resources/ui/app/components/upload-table.js |   60 +
 .../ui/app/components/validated-text-field.js   |   62 +
 .../ui/app/components/visual-explain-detail.js  |   31 +
 .../ui/app/components/visual-explain.js         |   89 +
 .../resources/ui/app/configs/edit-table-tabs.js |   48 +
 .../resources/ui/app/configs/file-format.js     |    4 +-
 .../main/resources/ui/app/configs/helpers.js    |   14 +-
 .../resources/ui/app/controllers/messages.js    |   30 +
 .../ui/app/controllers/messages/message.js      |   31 +
 .../resources/ui/app/controllers/saved-query.js |   22 +
 .../main/resources/ui/app/controllers/udfs.js   |   22 +
 .../resources/ui/app/controllers/udfs/new.js    |   23 +
 .../app/helpers/alert-message-context-class.js  |   27 +
 .../ui/app/helpers/alert-message-icon-class.js  |   37 +
 .../resources/ui/app/helpers/shorten-text.js    |   32 +
 .../resources/ui/app/locales/en/translations.js |  111 +
 .../main/resources/ui/app/mixins/ui-logger.js   |   15 +
 .../src/main/resources/ui/app/models/column.js  |   33 +-
 .../resources/ui/app/models/file-resource.js    |   25 +
 .../src/main/resources/ui/app/models/udf.js     |   26 +
 .../hive20/src/main/resources/ui/app/router.js  |   10 +-
 .../main/resources/ui/app/routes/databases.js   |   12 +-
 .../databases/database/tables/new-database.js   |   15 +-
 .../app/routes/databases/database/tables/new.js |   84 +-
 .../routes/databases/database/tables/table.js   |    8 +-
 .../databases/database/tables/table/edit.js     |   82 +
 .../databases/database/tables/table/rename.js   |   15 +-
 .../databases/database/tables/upload-table.js   |  784 ++++
 .../src/main/resources/ui/app/routes/jobs.js    |    3 -
 .../resources/ui/app/routes/queries/query.js    |  136 +-
 .../src/main/resources/ui/app/routes/query.js   |  305 --
 .../resources/ui/app/routes/savedqueries.js     |   50 +-
 .../main/resources/ui/app/routes/settings.js    |   10 +-
 .../src/main/resources/ui/app/routes/udfs.js    |   50 +
 .../main/resources/ui/app/routes/udfs/new.js    |  161 +
 .../resources/ui/app/services/alert-messages.js |   13 +-
 .../resources/ui/app/services/file-resource.js  |   33 +
 .../src/main/resources/ui/app/services/jobs.js  |    3 +
 .../src/main/resources/ui/app/services/query.js |   14 +-
 .../resources/ui/app/services/saved-queries.js  |    5 +-
 .../ui/app/services/table-operations.js         |   32 +-
 .../src/main/resources/ui/app/services/udf.js   |   76 +
 .../src/main/resources/ui/app/styles/app.scss   |  202 +-
 .../app/templates/components/alert-message.hbs  |    2 +-
 .../ui/app/templates/components/column-item.hbs |   15 +-
 .../app/templates/components/confirm-dialog.hbs |    2 +-
 .../templates/components/csv-format-params.hbs  |  130 +
 .../ui/app/templates/components/edit-table.hbs  |   65 +
 .../app/templates/components/export-result.hbs  |    2 +-
 .../templates/components/fileresource-item.hbs  |   32 +
 .../templates/components/hdfs-viewer-modal.hbs  |    2 +-
 .../ui/app/templates/components/info-dialog.hbs |    2 +-
 .../ui/app/templates/components/job-item.hbs    |    2 +-
 .../app/templates/components/jobs-browser.hbs   |   17 +-
 .../ui/app/templates/components/list-item.hbs   |    2 +-
 .../app/templates/components/property-item.hbs  |   10 +-
 .../templates/components/query-result-table.hbs |    4 +-
 .../app/templates/components/radio-button.hbs   |   19 +
 .../app/templates/components/simple-table.hbs   |   42 +
 .../components/table-advanced-settings.hbs      |  297 +-
 .../app/templates/components/table-columns.hbs  |    1 +
 .../templates/components/table-properties.hbs   |    1 +
 .../templates/components/table-statistics.hbs   |    4 +
 .../ui/app/templates/components/udf-edit.hbs    |   67 +
 .../ui/app/templates/components/udf-item.hbs    |   76 +
 .../ui/app/templates/components/udf-new.hbs     |   61 +
 .../components/upload-table-source.hbs          |  112 +
 .../app/templates/components/upload-table.hbs   |   59 +
 .../components/validated-text-field.hbs         |   23 +
 .../components/visual-explain-detail.hbs        |   29 +
 .../app/templates/components/visual-explain.hbs |   42 +
 .../ui/app/templates/databases-loading.hbs      |   21 +
 .../resources/ui/app/templates/databases.hbs    |    2 +-
 .../databases/database/tables-loading.hbs       |   24 +
 .../templates/databases/database/tables/new.hbs |    6 +-
 .../databases/database/tables/table-loading.hbs |   21 +
 .../databases/database/tables/table.hbs         |    6 +-
 .../databases/database/tables/table/auth.hbs    |   41 +-
 .../databases/database/tables/table/edit.hbs    |   45 +
 .../databases/database/tables/upload-table.hbs  |   45 +
 .../resources/ui/app/templates/jobs-loading.hbs |   20 +
 .../resources/ui/app/templates/messages.hbs     |   14 +-
 .../ui/app/templates/messages/message.hbs       |    6 +-
 .../ui/app/templates/queries/query.hbs          |   69 +-
 .../main/resources/ui/app/templates/query.hbs   |   84 -
 .../ui/app/templates/savedqueries-loading.hbs   |   21 +
 .../resources/ui/app/templates/savedqueries.hbs |    6 +-
 .../ui/app/templates/service-check.hbs          |    2 +-
 .../ui/app/templates/settings-loading.hbs       |   21 +
 .../resources/ui/app/templates/udfs-loading.hbs |   21 +
 .../main/resources/ui/app/templates/udfs.hbs    |   28 +
 .../resources/ui/app/templates/udfs/new.hbs     |   30 +
 .../main/resources/ui/app/utils/constants.js    |   64 +
 .../resources/ui/app/utils/hive-explainer.js    |  645 ++++
 .../hive20/src/main/resources/ui/bower.json     |    5 +-
 .../src/main/resources/ui/config/environment.js |    6 +-
 .../src/main/resources/ui/ember-cli-build.js    |    3 +
 .../hive20/src/main/resources/ui/package.json   |    3 +
 .../views/hive20/src/main/resources/view.xml    |    2 +-
 .../AlterTableQueryGenerationSpecTest.groovy    |   59 -
 .../AlterTableQueryGeneratorTest.java           |  161 +-
 .../resources/upload/DataParserCSVTest.java     |   29 +-
 .../resources/upload/DataParserJSONTest.java    |   37 +-
 .../resources/upload/DataParserXMLTest.java     |   20 +-
 .../resources/upload/QueryGeneratorTest.java    |  108 -
 .../resources/upload/TableDataReaderTest.java   |    5 +-
 .../ui/app/components/bundle-config.js          |    1 +
 .../resources/ui/app/components/coord-config.js |    1 +
 .../ui/app/components/decision-add-branch.js    |    3 +-
 .../ui/app/components/designer-workspace.js     |   37 +-
 .../resources/ui/app/components/drafts-wf.js    |   55 +-
 .../ui/app/components/flow-designer.js          |   27 +-
 .../resources/ui/app/components/job-details.js  |   52 +-
 .../ui/app/components/transition-config.js      |    2 +-
 .../ui/app/domain/cytoscape-flow-renderer.js    |   38 +-
 .../resources/ui/app/domain/findnode-mixin.js   |   10 +-
 .../resources/ui/app/domain/node-handler.js     |   10 +-
 .../src/main/resources/ui/app/domain/node.js    |    2 +-
 .../main/resources/ui/app/domain/workflow.js    |    6 +-
 .../src/main/resources/ui/app/routes/design.js  |    7 -
 .../src/main/resources/ui/app/styles/app.less   |   41 +-
 .../templates/components/designer-workspace.hbs |   73 +-
 .../ui/app/templates/components/drafts-wf.hbs   |   19 +-
 .../app/templates/components/flow-designer.hbs  |    2 +-
 .../ui/app/templates/components/help-icon.hbs   |    2 +-
 .../resources/ui/app/templates/dashboard.hbs    |    2 +-
 .../main/resources/ui/app/utils/constants.js    |    4 +-
 docs/pom.xml                                    |   16 +-
 474 files changed, 23439 insertions(+), 13820 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a8fb4c6d/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/a8fb4c6d/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/a8fb4c6d/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/a8fb4c6d/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/a8fb4c6d/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/a8fb4c6d/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/a8fb4c6d/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
----------------------------------------------------------------------


[07/50] [abbrv] ambari git commit: AMBARI-19962 Clicking on the login button (or hitting page refresh) to seeing the dashboard takes a while on a 1000-node cluster. (atkach)

Posted by nc...@apache.org.
AMBARI-19962 Clicking on the login button (or hitting page refresh) to seeing the dashboard takes a while on a 1000-node cluster. (atkach)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: e8a9961841e0eaac2b471526068afabf37d10a35
Parents: fe1704e
Author: Andrii Tkach <at...@apache.org>
Authored: Fri Feb 10 17:59:58 2017 +0200
Committer: Andrii Tkach <at...@apache.org>
Committed: Fri Feb 10 21:37:29 2017 +0200

----------------------------------------------------------------------
 ambari-web/app/router.js          | 37 ++++++++++++++++++++++++++--------
 ambari-web/app/utils/ajax/ajax.js |  2 +-
 2 files changed, 30 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e8a99618/ambari-web/app/router.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/router.js b/ambari-web/app/router.js
index d671e86..df54303 100644
--- a/ambari-web/app/router.js
+++ b/ambari-web/app/router.js
@@ -256,16 +256,35 @@ App.Router = Em.Router.extend({
 
   displayLoginName: Em.computed.truncate('loginName', 10, 10),
 
+  /**
+   * @type {$.ajax|null}
+   */
+  clusterDataRequest: null,
+
+  /**
+   * If request was already sent on login then use saved clusterDataRequest and don't make second call
+   * @returns {$.ajax}
+   */
+  getClusterDataRequest: function() {
+    var clusterDataRequest = this.get('clusterDataRequest');
+    if (clusterDataRequest) {
+      this.set('clusterDataRequest', null);
+      return clusterDataRequest;
+    } else {
+      return App.ajax.send({
+        name: 'router.login.clusters',
+        sender: this,
+        success: 'onAuthenticationSuccess',
+        error: 'onAuthenticationError'
+      });
+    }
+  },
+
   getAuthenticated: function () {
     var dfd = $.Deferred();
     var self = this;
     var auth = App.db.getAuthenticated();
-    App.ajax.send({
-      name: 'router.login.clusters',
-      sender: this,
-      success: 'onAuthenticationSuccess',
-      error: 'onAuthenticationError'
-    }).complete(function (xhr) {
+    this.getClusterDataRequest().complete(function (xhr) {
       if (xhr.state() === 'resolved') {
         // if server knows the user and user authenticated by UI
         if (auth) {
@@ -535,12 +554,12 @@ App.Router = Em.Router.extend({
       this.loginGetClustersSuccessCallback(self.get('clusterData'), {}, requestData);
     }
     else {
-      App.ajax.send({
+      this.set('clusterDataRequest', App.ajax.send({
         name: 'router.login.clusters',
         sender: self,
         data: requestData,
         success: 'loginGetClustersSuccessCallback'
-      });
+      }));
     }
   },
 
@@ -584,6 +603,8 @@ App.Router = Em.Router.extend({
         router.transitionToAdminView();
       }
     }
+    // set cluster name and security type
+    App.router.get('clusterController').reloadSuccessCallback(clustersData);
     App.set('isPermissionDataLoaded', true);
     App.router.get('loginController').postLogin(true, true);
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8a99618/ambari-web/app/utils/ajax/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js
index e344128..ae3947f 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -2290,7 +2290,7 @@ var urls = {
     mock: '/data/users/privileges_{userName}.json'
   },
   'router.login.clusters': {
-    'real': '/clusters?fields=Clusters/provisioning_state',
+    'real': '/clusters?fields=Clusters/provisioning_state,Clusters/security_type',
     'mock': '/data/clusters/info.json'
   },
   'router.login.message': {


[34/50] [abbrv] ambari git commit: AMBARI-19594. configure kerberos authentication for Druid UIs (Nishant Bangarwa via smohanty)

Posted by nc...@apache.org.
AMBARI-19594. configure kerberos authentication for Druid UIs (Nishant Bangarwa via smohanty)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 4f39bdf8cc5aa58d05647725078aaa0223b7021d
Parents: ed92827
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Fri Feb 3 13:24:24 2017 -0800
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Mon Feb 13 15:45:35 2017 -0500

----------------------------------------------------------------------
 .../DRUID/0.9.2/configuration/druid-common.xml   |  6 ++++++
 .../DRUID/0.9.2/package/scripts/druid.py         |  2 ++
 .../DRUID/0.9.2/package/scripts/params.py        |  5 ++++-
 .../stacks/HDP/2.6/services/DRUID/kerberos.json  | 19 ++++++++++++++++++-
 .../test/python/stacks/2.6/DRUID/test_druid.py   |  2 ++
 .../test/python/stacks/2.6/configs/default.json  |  3 ++-
 6 files changed, 34 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4f39bdf8/ambari-server/src/main/resources/common-services/DRUID/0.9.2/configuration/druid-common.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/DRUID/0.9.2/configuration/druid-common.xml b/ambari-server/src/main/resources/common-services/DRUID/0.9.2/configuration/druid-common.xml
index e00480e..a494750 100644
--- a/ambari-server/src/main/resources/common-services/DRUID/0.9.2/configuration/druid-common.xml
+++ b/ambari-server/src/main/resources/common-services/DRUID/0.9.2/configuration/druid-common.xml
@@ -46,6 +46,12 @@
     <on-ambari-upgrade add="false"/>
   </property>
   <property>
+    <name>druid.security.extensions.loadList</name>
+    <value>[]</value>
+    <description>A comma-separated list of one or more druid security extensions to load. This property will be set via the kerberos wizard and User will not be allowed to modify this when security is enabled.</description>
+    <on-ambari-upgrade add="false"/>
+  </property>
+  <property>
     <name>druid.zk.service.host</name>
     <value>localhost:2181</value>
     <description>

http://git-wip-us.apache.org/repos/asf/ambari/blob/4f39bdf8/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/druid.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/druid.py b/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/druid.py
index 20eda92..18febeb 100644
--- a/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/druid.py
+++ b/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/druid.py
@@ -48,6 +48,8 @@ def druid(upgrade_type=None, nodeType=None):
     'druid.service']
   druid_common_config['druid.selectors.coordinator.serviceName'] = \
     params.config['configurations']['druid-coordinator']['druid.service']
+  druid_common_config['druid.extensions.loadList'] = json.dumps(eval(params.druid_extensions_load_list) +
+                                                     eval(params.druid_security_extensions_load_list))
 
   # delete the password and user if empty otherwiswe derby will fail.
   if 'derby' == druid_common_config['druid.metadata.storage.type']:

http://git-wip-us.apache.org/repos/asf/ambari/blob/4f39bdf8/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/params.py b/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/params.py
index 558087d..aed4043 100644
--- a/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/params.py
@@ -74,6 +74,9 @@ druid_log_dir = config['configurations']['druid-env']['druid_log_dir']
 druid_classpath = config['configurations']['druid-env']['druid_classpath']
 druid_extensions = config['configurations']['druid-common']['druid.extensions.pullList']
 druid_repo_list = config['configurations']['druid-common']['druid.extensions.repositoryList']
+druid_extensions_load_list = config['configurations']['druid-common']['druid.extensions.loadList']
+druid_security_extensions_load_list = config['configurations']['druid-common']['druid.security.extensions.loadList']
+
 
 # status params
 druid_pid_dir = status_params.druid_pid_dir
@@ -121,7 +124,7 @@ hdfs_site = config['configurations']['hdfs-site']
 default_fs = config['configurations']['core-site']['fs.defaultFS']
 dfs_type = default("/commandParams/dfs_type", "")
 
-# Kerberose
+# Kerberos
 druid_principal_name = default('/configurations/druid-common/druid.hadoop.security.kerberos.principal',
                                'missing_principal')
 druid_user_keytab = default('/configurations/druid-common/druid.hadoop.security.kerberos.keytab', 'missing_keytab')

http://git-wip-us.apache.org/repos/asf/ambari/blob/4f39bdf8/ambari-server/src/main/resources/stacks/HDP/2.6/services/DRUID/kerberos.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/DRUID/kerberos.json b/ambari-server/src/main/resources/stacks/HDP/2.6/services/DRUID/kerberos.json
index 1661285..251975b 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/services/DRUID/kerberos.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/DRUID/kerberos.json
@@ -4,7 +4,13 @@
       "name": "DRUID",
       "identities": [
         {
-          "name": "/spnego"
+          "name": "/spnego",
+          "principal": {
+            "configuration": "druid-common/druid.hadoop.security.spnego.principal"
+          },
+          "keytab": {
+            "configuration": "druid-common/druid.hadoop.security.spnego.keytab"
+          }
         },
         {
           "name": "druid",
@@ -72,6 +78,17 @@
             }
           ]
         }
+      ],
+      "configurations": [
+        {
+          "druid-common": {
+            "druid.hadoop.security.spnego.excludedPaths": "[\"/status\"]",
+            "druid.security.extensions.loadList" : "[\"druid-kerberos\"]"
+          }
+        }
+      ],
+      "auth_to_local_properties" : [
+        "druid-common/druid.hadoop.security.spnego.authToLocal|new_lines_escaped"
       ]
     }
   ]

http://git-wip-us.apache.org/repos/asf/ambari/blob/4f39bdf8/ambari-server/src/test/python/stacks/2.6/DRUID/test_druid.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.6/DRUID/test_druid.py b/ambari-server/src/test/python/stacks/2.6/DRUID/test_druid.py
index 0a143ae..422e9ba 100644
--- a/ambari-server/src/test/python/stacks/2.6/DRUID/test_druid.py
+++ b/ambari-server/src/test/python/stacks/2.6/DRUID/test_druid.py
@@ -445,6 +445,8 @@ class TestDruid(RMFTestCase):
     druid_common_config['druid.extensions.hadoopDependenciesDir'] = format('/usr/hdp/current/{role}/hadoop-dependencies')
     druid_common_config['druid.selectors.indexing.serviceName'] = 'druid/overlord'
     druid_common_config['druid.selectors.coordinator.serviceName'] = 'druid/coordinator'
+    druid_common_config['druid.extensions.loadList'] = '["mysql-metadata-storage", "druid-datasketches", "druid-kerberos"]'
+
 
     self.assertResourceCalled('PropertiesFile', 'common.runtime.properties',
                               dir=format("/usr/hdp/current/{role}/conf/_common"),

http://git-wip-us.apache.org/repos/asf/ambari/blob/4f39bdf8/ambari-server/src/test/python/stacks/2.6/configs/default.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.6/configs/default.json b/ambari-server/src/test/python/stacks/2.6/configs/default.json
index 963c4a4..4d9f98c 100644
--- a/ambari-server/src/test/python/stacks/2.6/configs/default.json
+++ b/ambari-server/src/test/python/stacks/2.6/configs/default.json
@@ -430,7 +430,8 @@
       "druid.indexer.logs.directory": "/user/druid/logs",
       "druid.extensions.pullList": "[\"custom-druid-extension\"]",
       "druid.extensions.repositoryList": "[\"http://custom-mvn-repo/public/release\"]",
-      "druid.extensions.loadList": "[\"mysql-metadata-storage\", \"druid-datasketches\"]"
+      "druid.extensions.loadList": "[\"mysql-metadata-storage\", \"druid-datasketches\"]",
+      "druid.security.extensions.loadList": "[\"druid-kerberos\"]"
     },
     "druid-historical" : {
       "druid.segmentCache.infoDir" : "/apps/druid/segmentCache/info_dir",


[25/50] [abbrv] ambari git commit: AMBARI-19944 Increase SNMP Unit Test Coverage (dsen)

Posted by nc...@apache.org.
AMBARI-19944 Increase SNMP Unit Test Coverage (dsen)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: b8176ff63c00115156062a2af9d2e2cae164e514
Parents: a906061
Author: Dmytro Sen <ds...@apache.org>
Authored: Mon Feb 13 12:42:06 2017 +0200
Committer: Dmytro Sen <ds...@apache.org>
Committed: Mon Feb 13 12:42:06 2017 +0200

----------------------------------------------------------------------
 .../AlertNoticeDispatchServiceTest.java         | 159 ++++++++++++++++++-
 1 file changed, 152 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b8176ff6/ambari-server/src/test/java/org/apache/ambari/server/state/services/AlertNoticeDispatchServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/services/AlertNoticeDispatchServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/services/AlertNoticeDispatchServiceTest.java
index 07094a8..8423eaf 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/services/AlertNoticeDispatchServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/services/AlertNoticeDispatchServiceTest.java
@@ -24,13 +24,16 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
+import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.EnumSet;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.TimeZone;
 import java.util.UUID;
+import java.util.Vector;
 import java.util.concurrent.Executor;
 
 import org.apache.ambari.server.api.services.AmbariMetaInfo;
@@ -38,6 +41,7 @@ import org.apache.ambari.server.notifications.DispatchFactory;
 import org.apache.ambari.server.notifications.Notification;
 import org.apache.ambari.server.notifications.NotificationDispatcher;
 import org.apache.ambari.server.notifications.TargetConfigurationResult;
+import org.apache.ambari.server.notifications.dispatchers.AmbariSNMPDispatcher;
 import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
 import org.apache.ambari.server.orm.dao.AlertDispatchDAO;
 import org.apache.ambari.server.orm.entities.AlertDefinitionEntity;
@@ -48,10 +52,24 @@ import org.apache.ambari.server.state.AlertState;
 import org.apache.ambari.server.state.NotificationState;
 import org.apache.ambari.server.state.alert.Scope;
 import org.apache.ambari.server.state.alert.SourceType;
+import org.apache.ambari.server.state.alert.TargetType;
 import org.easymock.EasyMock;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
+import org.snmp4j.CommandResponder;
+import org.snmp4j.CommandResponderEvent;
+import org.snmp4j.PDU;
+import org.snmp4j.Snmp;
+import org.snmp4j.TransportMapping;
+import org.snmp4j.mp.SnmpConstants;
+import org.snmp4j.smi.Address;
+import org.snmp4j.smi.GenericAddress;
+import org.snmp4j.smi.Integer32;
+import org.snmp4j.smi.OID;
+import org.snmp4j.smi.OctetString;
+import org.snmp4j.smi.VariableBinding;
+import org.snmp4j.transport.DefaultUdpTransportMapping;
 
 import com.google.inject.Binder;
 import com.google.inject.Guice;
@@ -240,10 +258,10 @@ public class AlertNoticeDispatchServiceTest extends AlertNoticeDispatchService {
    * @throws Exception
    */
   @Test
-  public void testSingleDispatch() throws Exception {
+  public void testSingleSnmpDispatch() throws Exception {
     MockSnmpDispatcher dispatcher = new MockSnmpDispatcher();
 
-    List<AlertNoticeEntity> notices = getSnmpMockNotices();
+    List<AlertNoticeEntity> notices = getSnmpMockNotices("SNMP");
     AlertNoticeEntity notice1 = notices.get(0);
     AlertNoticeEntity notice2 = notices.get(1);
 
@@ -269,6 +287,105 @@ public class AlertNoticeDispatchServiceTest extends AlertNoticeDispatchService {
   }
 
   /**
+   * Tests a digest dispatch for Ambari SNMP.
+   *
+   * @throws Exception
+   */
+  @Test
+  public void testAmbariSnmpSingleDispatch() throws Exception {
+    MockAmbariSnmpDispatcher dispatcher = new MockAmbariSnmpDispatcher();
+
+    List<AlertNoticeEntity> notices = getSnmpMockNotices("AMBARI_SNMP");
+    AlertNoticeEntity notice1 = notices.get(0);
+    AlertNoticeEntity notice2 = notices.get(1);
+
+    EasyMock.expect(m_dao.findPendingNotices()).andReturn(notices).once();
+    EasyMock.expect(m_dao.merge(notice1)).andReturn(notice1).once();
+    EasyMock.expect(m_dao.merge(notice2)).andReturn(notice2).once();
+    EasyMock.expect(m_dispatchFactory.getDispatcher("AMBARI_SNMP")).andReturn(dispatcher).atLeastOnce();
+
+    EasyMock.replay(m_dao, m_dispatchFactory);
+
+    // "startup" the service so that its initialization is done
+    AlertNoticeDispatchService service = m_injector.getInstance(AlertNoticeDispatchService.class);
+    service.startUp();
+
+    // service trigger with mock executor that blocks
+    service.setExecutor(new MockExecutor());
+    service.runOneIteration();
+
+    EasyMock.verify(m_dao, m_dispatchFactory);
+
+    List<Notification> notifications = dispatcher.getNotifications();
+    assertEquals(2, notifications.size());
+  }
+
+  /**
+   * Tests a real dispatch for Ambari SNMP.
+   *
+   * @throws Exception
+   */
+  @Test
+  public void testAmbariSnmpRealDispatch() throws Exception {
+    AmbariSNMPDispatcher dispatcher = new AmbariSNMPDispatcher(8081);
+
+    List<AlertNoticeEntity> notices = getSnmpMockNotices("AMBARI_SNMP");
+    AlertNoticeEntity notice1 = notices.get(0);
+    AlertNoticeEntity notice2 = notices.get(1);
+
+    EasyMock.expect(m_dao.findPendingNotices()).andReturn(notices).once();
+    EasyMock.expect(m_dao.merge(notice1)).andReturn(notice1).once();
+    EasyMock.expect(m_dao.merge(notice2)).andReturn(notice2).once();
+    EasyMock.expect(m_dispatchFactory.getDispatcher("AMBARI_SNMP")).andReturn(dispatcher).once();
+    EasyMock.expect(m_dao.findNoticeByUuid(ALERT_NOTICE_UUID_1)).andReturn(notice1).once();
+    EasyMock.expect(m_dao.merge(notice1)).andReturn(notice1).once();
+    EasyMock.expect(m_dao.findNoticeByUuid(ALERT_NOTICE_UUID_2)).andReturn(notice2).once();
+    EasyMock.expect(m_dao.merge(notice2)).andReturn(notice2).once();
+    EasyMock.replay(m_dao, m_dispatchFactory);
+
+    // "startup" the service so that its initialization is done
+    AlertNoticeDispatchService service = m_injector.getInstance(AlertNoticeDispatchService.class);
+    service.startUp();
+
+    // service trigger with mock executor that blocks
+    service.setExecutor(new MockExecutor());
+    SnmpReceiver snmpReceiver = new SnmpReceiver();
+
+    service.runOneIteration();
+    Thread.sleep(1000);
+
+    EasyMock.verify(m_dao, m_dispatchFactory);
+
+    List<Vector> expectedTrapVectors = new LinkedList<>();
+    Vector firstVector = new Vector();
+    firstVector.add(new VariableBinding(SnmpConstants.snmpTrapOID, new OID(AmbariSNMPDispatcher.AMBARI_ALERT_TRAP_OID)));
+    firstVector.add(new VariableBinding(new OID(AmbariSNMPDispatcher.AMBARI_ALERT_DEFINITION_ID_OID), new Integer32(new BigDecimal(1L).intValueExact())));
+    firstVector.add(new VariableBinding(new OID(AmbariSNMPDispatcher.AMBARI_ALERT_DEFINITION_NAME_OID), new OctetString("alert-definition-1")));
+    firstVector.add(new VariableBinding(new OID(AmbariSNMPDispatcher.AMBARI_ALERT_DEFINITION_HASH_OID), new OctetString("1")));
+    firstVector.add(new VariableBinding(new OID(AmbariSNMPDispatcher.AMBARI_ALERT_NAME_OID), new OctetString("Alert Definition 1")));
+
+    Vector secondVector = new Vector(firstVector);
+
+    firstVector.add(new VariableBinding(new OID(AmbariSNMPDispatcher.AMBARI_ALERT_TEXT_OID), new OctetString(ALERT_UNIQUE_TEXT)));
+    firstVector.add(new VariableBinding(new OID(AmbariSNMPDispatcher.AMBARI_ALERT_STATE_OID), new Integer32(0)));
+    firstVector.add(new VariableBinding(new OID(AmbariSNMPDispatcher.AMBARI_ALERT_HOST_NAME_OID), new OctetString("null")));
+    firstVector.add(new VariableBinding(new OID(AmbariSNMPDispatcher.AMBARI_ALERT_SERVICE_NAME_OID), new OctetString("HDFS")));
+    firstVector.add(new VariableBinding(new OID(AmbariSNMPDispatcher.AMBARI_ALERT_COMPONENT_NAME_OID), new OctetString("null")));
+
+    secondVector.add(new VariableBinding(new OID(AmbariSNMPDispatcher.AMBARI_ALERT_TEXT_OID), new OctetString(ALERT_UNIQUE_TEXT + " CRITICAL")));
+    secondVector.add(new VariableBinding(new OID(AmbariSNMPDispatcher.AMBARI_ALERT_STATE_OID), new Integer32(3)));
+    secondVector.add(new VariableBinding(new OID(AmbariSNMPDispatcher.AMBARI_ALERT_HOST_NAME_OID), new OctetString("null")));
+    secondVector.add(new VariableBinding(new OID(AmbariSNMPDispatcher.AMBARI_ALERT_SERVICE_NAME_OID), new OctetString("HDFS")));
+    secondVector.add(new VariableBinding(new OID(AmbariSNMPDispatcher.AMBARI_ALERT_COMPONENT_NAME_OID), new OctetString("null")));
+
+    expectedTrapVectors.add(firstVector);
+    expectedTrapVectors.add(secondVector);
+    assertNotNull(snmpReceiver.receivedTrapsVectors);
+    assertTrue(snmpReceiver.receivedTrapsVectors.size() == 2);
+    assertEquals(expectedTrapVectors, snmpReceiver.receivedTrapsVectors);
+  }
+
+  /**
    * Tests that a failed dispatch invokes the callback to mark the UUIDs of the
    * notices as FAILED.
    *
@@ -384,11 +501,11 @@ public class AlertNoticeDispatchServiceTest extends AlertNoticeDispatchService {
   }
 
   /**
-   * Gets 2 PENDING notices for SNMP.
+   * Gets 2 PENDING notices for SNMP or AMBARI_SNMP notificationType.
    *
    * @return
    */
-  private List<AlertNoticeEntity> getSnmpMockNotices() {
+  private List<AlertNoticeEntity> getSnmpMockNotices(String notificationType) {
     AlertDefinitionEntity definition = new AlertDefinitionEntity();
     definition.setDefinitionId(1L);
     definition.setDefinitionName("alert-definition-1");
@@ -417,9 +534,10 @@ public class AlertNoticeDispatchServiceTest extends AlertNoticeDispatchService {
     target.setAlertStates(EnumSet.allOf(AlertState.class));
     target.setTargetName("Alert Target");
     target.setDescription("Mock Target");
-    target.setNotificationType("SNMP");
+    target.setNotificationType(notificationType);
 
-    String properties = "{ \"foo\" : \"bar\" }";
+    String properties = "{ \"ambari.dispatch.snmp.version\": \"SNMPv1\", \"ambari.dispatch.snmp.port\": \"8000\"," +
+                         " \"ambari.dispatch.recipients\": [\"127.0.0.1\"],\"ambari.dispatch.snmp.community\":\"\" }";
     target.setProperties(properties);
 
     AlertNoticeEntity notice1 = new AlertNoticeEntity();
@@ -493,7 +611,7 @@ public class AlertNoticeDispatchServiceTest extends AlertNoticeDispatchService {
   /**
    * A mock dispatcher that captures the {@link Notification}.
    */
-  private static final class MockSnmpDispatcher implements
+  private static class MockSnmpDispatcher implements
       NotificationDispatcher {
 
     private List<Notification> m_notifications = new ArrayList<Notification>();
@@ -541,6 +659,11 @@ public class AlertNoticeDispatchServiceTest extends AlertNoticeDispatchService {
     }
   }
 
+  private static final class MockAmbariSnmpDispatcher extends MockSnmpDispatcher {
+    @Override
+    public String getType() { return TargetType.AMBARI_SNMP.name();}
+  }
+
   /**
    * A mock dispatcher that captures the {@link Notification}.
    */
@@ -624,4 +747,26 @@ public class AlertNoticeDispatchServiceTest extends AlertNoticeDispatchService {
       EasyMock.replay(m_metaInfo);
     }
   }
+
+  private class SnmpReceiver {
+    private Snmp snmp = null;
+    private Address targetAddress = GenericAddress.parse("udp:127.0.0.1/8000");
+    private TransportMapping transport = null;
+    public List<Vector> receivedTrapsVectors = null;
+    public SnmpReceiver() throws Exception{
+      transport = new DefaultUdpTransportMapping();
+      snmp = new Snmp(transport);
+      receivedTrapsVectors = new LinkedList<>();
+
+      CommandResponder trapPrinter = new CommandResponder() {
+        public synchronized void processPdu(CommandResponderEvent e){
+          PDU command = e.getPDU();
+          if (command != null) {
+            receivedTrapsVectors.add(command.getVariableBindings());
+          }
+        }
+      };
+      snmp.addNotificationListener(targetAddress, trapPrinter);
+    }
+  }
 }


[02/50] [abbrv] ambari git commit: AMBARI-19930. The service check status was set to TIMEOUT even if service check was failed. (mpapirkovskyy)

Posted by nc...@apache.org.
AMBARI-19930. The service check status was set to TIMEOUT even if service check was failed. (mpapirkovskyy)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: c9bea4ab8f8a042e60103e8bb8880fc718fa3cf3
Parents: fc9788a
Author: Myroslav Papirkovskyi <mp...@hortonworks.com>
Authored: Thu Feb 9 20:11:26 2017 +0200
Committer: Myroslav Papirkovskyi <mp...@hortonworks.com>
Committed: Fri Feb 10 16:00:21 2017 +0200

----------------------------------------------------------------------
 .../server/actionmanager/ActionScheduler.java   | 38 +++++++++++---
 .../actionmanager/TestActionScheduler.java      | 54 ++++++++------------
 2 files changed, 53 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c9bea4ab/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
index dabcb98..fa2ad4f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
@@ -845,6 +845,28 @@ class ActionScheduler implements Runnable {
             commandsToSchedule.add(c);
             LOG.trace("===> commandsToSchedule(reschedule)=" + commandsToSchedule.size());
           }
+        } else if (isHostStateUnknown(s, hostObj, roleStr)) {
+          String message = "Action was aborted due agent is not heartbeating or was restarted.";
+          LOG.warn("Host: {}, role: {}, actionId: {} . {}", host, roleStr,
+            s.getActionId(), message);
+
+          db.abortHostRole(host, s.getRequestId(), s.getStageId(), c.getRole(), message);
+
+          if (null != cluster) {
+            if (!RoleCommand.CUSTOM_COMMAND.equals(c.getRoleCommand())
+              && !RoleCommand.SERVICE_CHECK.equals(c.getRoleCommand())
+              && !RoleCommand.ACTIONEXECUTE.equals(c.getRoleCommand())) {
+              //commands above don't affect host component state (e.g. no in_progress state in process), transition will fail
+              transitionToFailedState(cluster.getClusterName(), c.getServiceName(), roleStr, host, now, false);
+            }
+            if (c.getRoleCommand().equals(RoleCommand.ACTIONEXECUTE)) {
+              processActionDeath(cluster.getClusterName(), c.getHostname(), roleStr);
+            }
+          }
+
+          // Dequeue command
+          LOG.info("Removing command from queue, host={}, commandId={} ", host, c.getCommandId());
+          actionQueue.dequeue(host, c.getCommandId());
         } else if (status.equals(HostRoleStatus.PENDING)) {
           // in case of DEPENDENCY_ORDERED stage command can be scheduled only if all of it's dependencies are
           // already finished
@@ -1030,13 +1052,6 @@ class ActionScheduler implements Runnable {
       return false;
     }
 
-    // Fast fail task if host state is unknown
-    if (null != host &&
-      (host.getState().equals(HostState.HEARTBEAT_LOST) || wasAgentRestartedDuringOperation(host, stage, role))) {
-      LOG.debug("Timing out action since agent is not heartbeating or agent was restarted.");
-      return true;
-    }
-
     // tasks are held in a variety of in-memory maps that require a hostname key
     // host being null is ok - that means it's a server-side task
     String hostName = (null == host) ? null : host.getHostName();
@@ -1053,6 +1068,15 @@ class ActionScheduler implements Runnable {
     return false;
   }
 
+  private boolean isHostStateUnknown(Stage stage, Host host, String role) {
+    if (null != host &&
+      (host.getState().equals(HostState.HEARTBEAT_LOST) || wasAgentRestartedDuringOperation(host, stage, role))) {
+      LOG.debug("Abort action since agent is not heartbeating or agent was restarted.");
+      return true;
+    }
+    return false;
+  }
+
   private boolean hasCommandInProgress(Stage stage, String host) {
     List<ExecutionCommandWrapper> commandWrappers = stage.getExecutionCommands(host);
     for (ExecutionCommandWrapper wrapper : commandWrappers) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/c9bea4ab/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
index ade625a..653ad2c 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
@@ -391,7 +391,7 @@ public class TestActionScheduler {
     when(host.getState()).thenReturn(HostState.HEARTBEAT_LOST);
     when(host.getHostName()).thenReturn(hostname);
 
-    List<Stage> stages = new ArrayList<Stage>();
+    final List<Stage> stages = new ArrayList<Stage>();
     final Stage s = StageUtils.getATestStage(1, 977, hostname, CLUSTER_HOST_INFO,
       "{\"host_param\":\"param_value\"}", "{\"stage_param\":\"param_value\"}");
     stages.add(s);
@@ -404,16 +404,26 @@ public class TestActionScheduler {
 
     when(db.getCommandsInProgressCount()).thenReturn(stages.size());
     when(db.getStagesInProgress()).thenReturn(stages);
+
     doAnswer(new Answer<Void>() {
       @Override
       public Void answer(InvocationOnMock invocation) throws Throwable {
-        String host = (String) invocation.getArguments()[0];
-        String role = (String) invocation.getArguments()[3];
-        HostRoleCommand command = s.getHostRoleCommand(host, role);
-        command.setStatus(HostRoleStatus.TIMEDOUT);
+        Long requestId = (Long) invocation.getArguments()[1];
+        for (Stage stage : stages) {
+          if (requestId.equals(stage.getRequestId())) {
+            for (HostRoleCommand command : stage.getOrderedHostRoleCommands()) {
+              if (command.getStatus() == HostRoleStatus.QUEUED ||
+                command.getStatus() == HostRoleStatus.IN_PROGRESS ||
+                command.getStatus() == HostRoleStatus.PENDING) {
+                command.setStatus(HostRoleStatus.ABORTED);
+              }
+            }
+          }
+        }
+
         return null;
       }
-    }).when(db).timeoutHostRole(anyString(), anyLong(), anyLong(), anyString(), anyBoolean());
+    }).when(db).abortHostRole(anyString(), anyLong(), anyLong(), anyString(), anyString());
 
     //Small action timeout to test rescheduling
     AmbariEventPublisher aep = EasyMock.createNiceMock(AmbariEventPublisher.class);
@@ -423,18 +433,16 @@ public class TestActionScheduler {
             mock(HostRoleCommandDAO.class), mock(HostRoleCommandFactory.class)).
         addMockedMethod("cancelHostRoleCommands").
         createMock();
-    scheduler.cancelHostRoleCommands(EasyMock.<Collection<HostRoleCommand>>anyObject(),EasyMock.anyObject(String.class));
-    EasyMock.expectLastCall();
     EasyMock.replay(scheduler);
     scheduler.setTaskTimeoutAdjustment(false);
 
     int cycleCount=0;
     while (!stages.get(0).getHostRoleStatus(hostname, "NAMENODE")
-      .equals(HostRoleStatus.TIMEDOUT) && cycleCount++ <= MAX_CYCLE_ITERATIONS) {
+      .equals(HostRoleStatus.ABORTED) && cycleCount++ <= MAX_CYCLE_ITERATIONS) {
       scheduler.doWork();
     }
 
-    Assert.assertEquals(HostRoleStatus.TIMEDOUT,stages.get(0).getHostRoleStatus(hostname, "NAMENODE"));
+    Assert.assertEquals(HostRoleStatus.ABORTED,stages.get(0).getHostRoleStatus(hostname, "NAMENODE"));
 
     EasyMock.verify(scheduler, entityManagerProviderMock);
   }
@@ -503,23 +511,7 @@ public class TestActionScheduler {
     doAnswer(new Answer<Void>() {
       @Override
       public Void answer(InvocationOnMock invocation) throws Throwable {
-        String host = (String) invocation.getArguments()[0];
-        String role = (String) invocation.getArguments()[3];
-        //HostRoleCommand command = stages.get(0).getHostRoleCommand(host, role);
-        for (HostRoleCommand command : stages.get(0).getOrderedHostRoleCommands()) {
-          if (command.getHostName().equals(host) && command.getRole().name()
-              .equals(role)) {
-            command.setStatus(HostRoleStatus.TIMEDOUT);
-          }
-        }
-        return null;
-      }
-    }).when(db).timeoutHostRole(anyString(), anyLong(), anyLong(), anyString(), anyBoolean());
-
-    doAnswer(new Answer<Void>() {
-      @Override
-      public Void answer(InvocationOnMock invocation) throws Throwable {
-        Long requestId = (Long) invocation.getArguments()[0];
+        Long requestId = (Long) invocation.getArguments()[1];
         for (Stage stage : stages) {
           if (requestId.equals(stage.getRequestId())) {
             for (HostRoleCommand command : stage.getOrderedHostRoleCommands()) {
@@ -534,7 +526,7 @@ public class TestActionScheduler {
 
         return null;
       }
-    }).when(db).abortOperation(anyLong());
+    }).when(db).abortHostRole(anyString(), anyLong(), anyLong(), anyString(), anyString());
 
     ArgumentCaptor<ServiceComponentHostEvent> eventsCapture1 =
       ArgumentCaptor.forClass(ServiceComponentHostEvent.class);
@@ -549,12 +541,12 @@ public class TestActionScheduler {
 
     int cycleCount=0;
     while (!(stages.get(0).getHostRoleStatus(hostname1, "DATANODE")
-      .equals(HostRoleStatus.TIMEDOUT) && stages.get(0).getHostRoleStatus
+      .equals(HostRoleStatus.ABORTED) && stages.get(0).getHostRoleStatus
       (hostname2, "NAMENODE").equals(HostRoleStatus.ABORTED)) && cycleCount++ <= MAX_CYCLE_ITERATIONS) {
       scheduler.doWork();
     }
 
-    Assert.assertEquals(HostRoleStatus.TIMEDOUT,
+    Assert.assertEquals(HostRoleStatus.ABORTED,
       stages.get(0).getHostRoleStatus(hostname1, "DATANODE"));
     Assert.assertEquals(HostRoleStatus.ABORTED,
       stages.get(0).getHostRoleStatus(hostname2, "NAMENODE"));
@@ -910,9 +902,7 @@ public class TestActionScheduler {
     EasyMock.expect(fsm.getCluster(EasyMock.anyString())).andReturn(cluster).anyTimes();
     EasyMock.expect(fsm.getHost(EasyMock.anyString())).andReturn(host);
     EasyMock.expect(cluster.getService(EasyMock.anyString())).andReturn(null);
-    EasyMock.expect(host.getLastRegistrationTime()).andReturn(HOST_REGISTRATION_TIME);
     EasyMock.expect(host.getHostName()).andReturn(Stage.INTERNAL_HOSTNAME).anyTimes();
-    EasyMock.expect(host.getState()).andReturn(HostState.HEALTHY);
 
     if (RoleCommand.ACTIONEXECUTE.equals(roleCommand)) {
       EasyMock.expect(cluster.getClusterName()).andReturn("clusterName").anyTimes();


[11/50] [abbrv] ambari git commit: AMBARI-19886. Update ambari managed llap queue to set preemption policy. (Siddharth Seth via Swapan Shridhar).

Posted by nc...@apache.org.
AMBARI-19886. Update ambari managed llap queue to set preemption policy. (Siddharth Seth via Swapan Shridhar).


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: e7d0e781b3506d20806f521b30ce4629e67641f5
Parents: f4c8384
Author: Swapan Shridhar <ss...@hortonworks.com>
Authored: Fri Feb 10 16:10:19 2017 -0800
Committer: Swapan Shridhar <ss...@hortonworks.com>
Committed: Fri Feb 10 16:10:25 2017 -0800

----------------------------------------------------------------------
 .../stacks/HDP/2.5/services/stack_advisor.py    | 15 +++++++-
 .../stacks/2.5/common/test_stack_advisor.py     | 36 +++++++++++++++++---
 2 files changed, 45 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e7d0e781/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py
index 9fe8fc3..4de9a41 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py
@@ -1532,13 +1532,18 @@ class HDP25StackAdvisor(HDP24StackAdvisor):
               elif prop == 'yarn.scheduler.capacity.root.default.maximum-capacity':
                 updated_cap_sched_configs_str = updated_cap_sched_configs_str \
                                             + prop + "=" + adjusted_default_queue_cap + "\n"
+              elif prop == 'yarn.scheduler.capacity.root.ordering-policy':
+                # Don't put this in again. We're re-writing the llap section.
+                pass
               elif prop.startswith('yarn.') and '.llap.' not in prop:
                 updated_cap_sched_configs_str = updated_cap_sched_configs_str + prop + "=" + val + "\n"
 
           # Now, append the 'llap' queue related properties
-          updated_cap_sched_configs_str += """yarn.scheduler.capacity.root.{0}.user-limit-factor=1
+          updated_cap_sched_configs_str += """yarn.scheduler.capacity.root.ordering-policy=priority-utilization
+yarn.scheduler.capacity.root.{0}.user-limit-factor=1
 yarn.scheduler.capacity.root.{0}.state=RUNNING
 yarn.scheduler.capacity.root.{0}.ordering-policy=fifo
+yarn.scheduler.capacity.root.{0}.priority=10
 yarn.scheduler.capacity.root.{0}.minimum-user-limit-percent=100
 yarn.scheduler.capacity.root.{0}.maximum-capacity={1}
 yarn.scheduler.capacity.root.{0}.capacity={1}
@@ -1560,13 +1565,18 @@ yarn.scheduler.capacity.root.{0}.maximum-am-resource-percent=1""".format(llap_qu
                 putCapSchedProperty(prop, adjusted_default_queue_cap)
               elif prop == 'yarn.scheduler.capacity.root.default.maximum-capacity':
                 putCapSchedProperty(prop, adjusted_default_queue_cap)
+              elif prop == 'yarn.scheduler.capacity.root.ordering-policy':
+                # Don't put this in again. We're re-writing the llap section.
+                pass
               elif prop.startswith('yarn.') and '.llap.' not in prop:
                 putCapSchedProperty(prop, val)
 
           # Add new 'llap' queue related configs.
+          putCapSchedProperty("yarn.scheduler.capacity.root.ordering-policy", "priority-utilization")
           putCapSchedProperty("yarn.scheduler.capacity.root." + llap_queue_name + ".user-limit-factor", "1")
           putCapSchedProperty("yarn.scheduler.capacity.root." + llap_queue_name + ".state", "RUNNING")
           putCapSchedProperty("yarn.scheduler.capacity.root." + llap_queue_name + ".ordering-policy", "fifo")
+          putCapSchedProperty("yarn.scheduler.capacity.root." + llap_queue_name + ".priority", "10")
           putCapSchedProperty("yarn.scheduler.capacity.root." + llap_queue_name + ".minimum-user-limit-percent", "100")
           putCapSchedProperty("yarn.scheduler.capacity.root." + llap_queue_name + ".maximum-capacity", llap_queue_cap_perc)
           putCapSchedProperty("yarn.scheduler.capacity.root." + llap_queue_name + ".capacity", llap_queue_cap_perc)
@@ -1634,6 +1644,9 @@ yarn.scheduler.capacity.root.{0}.maximum-am-resource-percent=1""".format(llap_qu
                 # Set 'default' max. capacity back to maximum val
                 updated_default_queue_configs = updated_default_queue_configs \
                                             + prop + "="+DEFAULT_MAX_CAPACITY + "\n"
+              elif prop == 'yarn.scheduler.capacity.root.ordering-policy':
+                # Don't set this property. The default will be picked up.
+                pass
               elif prop.startswith('yarn.'):
                 updated_default_queue_configs = updated_default_queue_configs + prop + "=" + val + "\n"
             else: # Update 'llap' related configs in 'updated_llap_queue_configs'

http://git-wip-us.apache.org/repos/asf/ambari/blob/e7d0e781/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py
index ef83bca..176dd99 100644
--- a/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py
@@ -158,9 +158,11 @@ class TestHDP25StackAdvisor(TestCase):
                               'yarn.scheduler.capacity.root.acl_administer_queue=*\n'
                               'yarn.scheduler.capacity.node-locality-delay=40\n'
                               'yarn.scheduler.capacity.queue-mappings-override.enable=false\n'
+                              'yarn.scheduler.capacity.root.ordering-policy=priority-utilization\n'
                               'yarn.scheduler.capacity.root.llap.user-limit-factor=1\n'
                               'yarn.scheduler.capacity.root.llap.state=RUNNING\n'
                               'yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n'
+                              'yarn.scheduler.capacity.root.llap.priority=10\n'
                               'yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n'
 
                               'yarn.scheduler.capacity.root.llap.maximum-capacity=20\n'
@@ -188,9 +190,11 @@ class TestHDP25StackAdvisor(TestCase):
                               'yarn.scheduler.capacity.root.acl_administer_queue=*\n'
                               'yarn.scheduler.capacity.node-locality-delay=40\n'
                               'yarn.scheduler.capacity.queue-mappings-override.enable=false\n'
+                              'yarn.scheduler.capacity.root.ordering-policy=priority-utilization\n'
                               'yarn.scheduler.capacity.root.llap.user-limit-factor=1\n'
                               'yarn.scheduler.capacity.root.llap.state=RUNNING\n'
                               'yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n'
+                              'yarn.scheduler.capacity.root.llap.priority=10\n'
                               'yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n'
                               'yarn.scheduler.capacity.root.llap.maximum-capacity=40\n'
                               'yarn.scheduler.capacity.root.llap.capacity=40\n'
@@ -220,6 +224,7 @@ class TestHDP25StackAdvisor(TestCase):
                               'yarn.scheduler.capacity.root.llap.user-limit-factor=1\n'
                               'yarn.scheduler.capacity.root.llap.state=STOPPED\n'
                               'yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n'
+                              'yarn.scheduler.capacity.root.llap.priority=10\n'
                               'yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n'
                               'yarn.scheduler.capacity.root.llap.maximum-capacity=0\n'
                               'yarn.scheduler.capacity.root.llap.capacity=0\n'
@@ -749,9 +754,11 @@ class TestHDP25StackAdvisor(TestCase):
                                   'yarn.scheduler.capacity.root.acl_administer_queue=*\n'
                                   'yarn.scheduler.capacity.node-locality-delay=40\n'
                                   'yarn.scheduler.capacity.queue-mappings-override.enable=false\n'
+                                  'yarn.scheduler.capacity.root.ordering-policy=priority-utilization\n'
                                   'yarn.scheduler.capacity.root.llap.user-limit-factor=1\n'
                                   'yarn.scheduler.capacity.root.llap.state=RUNNING\n'
                                   'yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n'
+                                  'yarn.scheduler.capacity.root.llap.priority=10\n'
                                   'yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n'
                                   'yarn.scheduler.capacity.root.llap.maximum-capacity=40\n'
                                   'yarn.scheduler.capacity.root.llap.capacity=40\n'
@@ -922,6 +929,7 @@ class TestHDP25StackAdvisor(TestCase):
                                   'yarn.scheduler.capacity.root.llap.user-limit-factor=1\n'
                                   'yarn.scheduler.capacity.root.llap.state=STOPPED\n'
                                   'yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n'
+                                  'yarn.scheduler.capacity.root.llap.priority=10\n'
                                   'yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n'
                                   'yarn.scheduler.capacity.root.llap.maximum-capacity=40\n'
                                   'yarn.scheduler.capacity.root.llap.capacity=40\n'
@@ -1092,9 +1100,11 @@ class TestHDP25StackAdvisor(TestCase):
                                   'yarn.scheduler.capacity.root.acl_administer_queue=*\n'
                                   'yarn.scheduler.capacity.node-locality-delay=40\n'
                                   'yarn.scheduler.capacity.queue-mappings-override.enable=false\n'
+                                  'yarn.scheduler.capacity.root.ordering-policy=priority-utilization\n'
                                   'yarn.scheduler.capacity.root.llap.user-limit-factor=1\n'
                                   'yarn.scheduler.capacity.root.llap.state=RUNNING\n'
                                   'yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n'
+                                  'yarn.scheduler.capacity.root.llap.priority=10\n'
                                   'yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n'
                                   'yarn.scheduler.capacity.root.llap.maximum-capacity=20\n'
                                   'yarn.scheduler.capacity.root.llap.capacity=20\n'
@@ -1292,9 +1302,11 @@ class TestHDP25StackAdvisor(TestCase):
                                   'yarn.scheduler.capacity.root.acl_administer_queue=*\n'
                                   'yarn.scheduler.capacity.node-locality-delay=40\n'
                                   'yarn.scheduler.capacity.queue-mappings-override.enable=false\n'
+                                  'yarn.scheduler.capacity.root.ordering-policy=priority-utilization\n'
                                   'yarn.scheduler.capacity.root.llap.user-limit-factor=1\n'
                                   'yarn.scheduler.capacity.root.llap.state=RUNNING\n'
                                   'yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n'
+                                  'yarn.scheduler.capacity.root.llap.priority=10\n'
                                   'yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n'
                                   'yarn.scheduler.capacity.root.llap.maximum-capacity=0\n'
                                   'yarn.scheduler.capacity.root.llap.capacity=0\n'
@@ -1486,9 +1498,11 @@ class TestHDP25StackAdvisor(TestCase):
                                   'yarn.scheduler.capacity.root.acl_administer_queue=*\n'
                                   'yarn.scheduler.capacity.node-locality-delay=40\n'
                                   'yarn.scheduler.capacity.queue-mappings-override.enable=false\n'
+                                  'yarn.scheduler.capacity.root.ordering-policy=priority-utilization\n'
                                   'yarn.scheduler.capacity.root.llap.user-limit-factor=1\n'
                                   'yarn.scheduler.capacity.root.llap.state=RUNNING\n'
                                   'yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n'
+                                  'yarn.scheduler.capacity.root.llap.priority=10\n'
                                   'yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n'
                                   'yarn.scheduler.capacity.root.llap.maximum-capacity=40\n'
                                   'yarn.scheduler.capacity.root.llap.capacity=40\n'
@@ -1689,9 +1703,11 @@ class TestHDP25StackAdvisor(TestCase):
                                   'yarn.scheduler.capacity.root.acl_administer_queue=*\n'
                                   'yarn.scheduler.capacity.node-locality-delay=40\n'
                                   'yarn.scheduler.capacity.queue-mappings-override.enable=false\n'
+                                  'yarn.scheduler.capacity.root.ordering-policy=priority-utilization\n'
                                   'yarn.scheduler.capacity.root.llap.user-limit-factor=1\n'
                                   'yarn.scheduler.capacity.root.llap.state=RUNNING\n'
                                   'yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n'
+                                  'yarn.scheduler.capacity.root.llap.priority=10\n'
                                   'yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n'
                                   'yarn.scheduler.capacity.root.llap.maximum-capacity=40\n'
                                   'yarn.scheduler.capacity.root.llap.capacity=40\n'
@@ -1887,9 +1903,11 @@ class TestHDP25StackAdvisor(TestCase):
                                   'yarn.scheduler.capacity.root.acl_administer_queue=*\n'
                                   'yarn.scheduler.capacity.node-locality-delay=40\n'
                                   'yarn.scheduler.capacity.queue-mappings-override.enable=false\n'
+                                  'yarn.scheduler.capacity.root.ordering-policy=priority-utilization\n'
                                   'yarn.scheduler.capacity.root.llap.user-limit-factor=1\n'
                                   'yarn.scheduler.capacity.root.llap.state=RUNNING\n'
                                   'yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n'
+                                  'yarn.scheduler.capacity.root.llap.priority=10\n'
                                   'yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n'
                                   'yarn.scheduler.capacity.root.llap.maximum-capacity=40\n'
                                   'yarn.scheduler.capacity.root.llap.capacity=40\n'
@@ -1962,7 +1980,7 @@ class TestHDP25StackAdvisor(TestCase):
     self.stackAdvisor.recommendYARNConfigurations(configurations, clusterData, services, self.hosts)
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.server2.tez.sessions.per.default.queue'], '1')
     self.assertEquals(configurations['hive-interactive-site']['property_attributes']['hive.server2.tez.sessions.per.default.queue'], {'minimum': '1', 'maximum': '4'})
-    self.assertEqual(configurations['capacity-scheduler']['properties'], {'capacity-scheduler': 'yarn.scheduler.capacity.root.accessible-node-labels=*\nyarn.scheduler.capacity.maximum-am-resource-percent=1\nyarn.scheduler.capacity.node-locality-delay=40\nyarn.scheduler.capacity.root.capacity=100\nyarn.scheduler.capacity.root.default.state=RUNNING\nyarn.scheduler.capacity.root.default.maximum-capacity=66.0\nyarn.scheduler.capacity.root.queues=default,llap\nyarn.scheduler.capacity.maximum-applications=10000\nyarn.scheduler.capacity.root.default.user-limit-factor=1\nyarn.scheduler.capacity.root.acl_administer_queue=*\nyarn.scheduler.capacity.root.default.acl_submit_applications=*\nyarn.scheduler.capacity.root.default.capacity=66.0\nyarn.scheduler.capacity.queue-mappings-override.enable=false\nyarn.scheduler.capacity.root.llap.user-limit-factor=1\nyarn.scheduler.capacity.root.llap.state=RUNNING\nyarn.scheduler.capacity.root.llap.ordering-policy=fifo\nyarn.scheduler.capacity.root.llap.mi
 nimum-user-limit-percent=100\nyarn.scheduler.capacity.root.llap.maximum-capacity=34.0\nyarn.scheduler.capacity.root.llap.capacity=34.0\nyarn.scheduler.capacity.root.llap.acl_submit_applications=hive\nyarn.scheduler.capacity.root.llap.acl_administer_queue=hive\nyarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1'})
+    self.assertEqual(configurations['capacity-scheduler']['properties'], {'capacity-scheduler': 'yarn.scheduler.capacity.root.accessible-node-labels=*\nyarn.scheduler.capacity.maximum-am-resource-percent=1\nyarn.scheduler.capacity.node-locality-delay=40\nyarn.scheduler.capacity.root.capacity=100\nyarn.scheduler.capacity.root.default.state=RUNNING\nyarn.scheduler.capacity.root.default.maximum-capacity=66.0\nyarn.scheduler.capacity.root.queues=default,llap\nyarn.scheduler.capacity.maximum-applications=10000\nyarn.scheduler.capacity.root.default.user-limit-factor=1\nyarn.scheduler.capacity.root.acl_administer_queue=*\nyarn.scheduler.capacity.root.default.acl_submit_applications=*\nyarn.scheduler.capacity.root.default.capacity=66.0\nyarn.scheduler.capacity.queue-mappings-override.enable=false\nyarn.scheduler.capacity.root.ordering-policy=priority-utilization\nyarn.scheduler.capacity.root.llap.user-limit-factor=1\nyarn.scheduler.capacity.root.llap.state=RUNNING\nyarn.scheduler.capacity.r
 oot.llap.ordering-policy=fifo\nyarn.scheduler.capacity.root.llap.priority=10\nyarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\nyarn.scheduler.capacity.root.llap.maximum-capacity=34.0\nyarn.scheduler.capacity.root.llap.capacity=34.0\nyarn.scheduler.capacity.root.llap.acl_submit_applications=hive\nyarn.scheduler.capacity.root.llap.acl_administer_queue=hive\nyarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1'})
 
     self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes_for_llap_daemons'], 3)
     self.assertTrue('num_llap_nodes' not in configurations['hive-interactive-env']['properties'])
@@ -2087,9 +2105,11 @@ class TestHDP25StackAdvisor(TestCase):
                                   'yarn.scheduler.capacity.root.acl_administer_queue=*\n'
                                   'yarn.scheduler.capacity.node-locality-delay=40\n'
                                   'yarn.scheduler.capacity.queue-mappings-override.enable=false\n'
+                                  'yarn.scheduler.capacity.root.ordering-policy=priority-utilization\n'
                                   'yarn.scheduler.capacity.root.llap.user-limit-factor=1\n'
                                   'yarn.scheduler.capacity.root.llap.state=RUNNING\n'
                                   'yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n'
+                                  'yarn.scheduler.capacity.root.llap.priority=10\n'
                                   'yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n'
                                   'yarn.scheduler.capacity.root.llap.maximum-capacity=40\n'
                                   'yarn.scheduler.capacity.root.llap.capacity=40\n'
@@ -2360,7 +2380,7 @@ class TestHDP25StackAdvisor(TestCase):
 
     self.stackAdvisor.recommendYARNConfigurations(configurations, clusterData, services, self.hosts)
 
-    self.assertEqual(configurations['capacity-scheduler']['properties'], {'capacity-scheduler': 'yarn.scheduler.capacity.root.accessible-node-labels=*\nyarn.scheduler.capacity.maximum-am-resource-percent=1\nyarn.scheduler.capacity.node-locality-delay=40\nyarn.scheduler.capacity.root.capacity=100\nyarn.scheduler.capacity.root.default.state=RUNNING\nyarn.scheduler.capacity.root.default.maximum-capacity=0.0\nyarn.scheduler.capacity.root.queues=default,llap\nyarn.scheduler.capacity.maximum-applications=10000\nyarn.scheduler.capacity.root.default.user-limit-factor=1\nyarn.scheduler.capacity.root.acl_administer_queue=*\nyarn.scheduler.capacity.root.default.acl_submit_applications=*\nyarn.scheduler.capacity.root.default.capacity=0.0\nyarn.scheduler.capacity.queue-mappings-override.enable=false\nyarn.scheduler.capacity.root.llap.user-limit-factor=1\nyarn.scheduler.capacity.root.llap.state=RUNNING\nyarn.scheduler.capacity.root.llap.ordering-policy=fifo\nyarn.scheduler.capacity.root.llap.mini
 mum-user-limit-percent=100\nyarn.scheduler.capacity.root.llap.maximum-capacity=100.0\nyarn.scheduler.capacity.root.llap.capacity=100.0\nyarn.scheduler.capacity.root.llap.acl_submit_applications=hive\nyarn.scheduler.capacity.root.llap.acl_administer_queue=hive\nyarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1'})
+    self.assertEqual(configurations['capacity-scheduler']['properties'], {'capacity-scheduler': 'yarn.scheduler.capacity.root.accessible-node-labels=*\nyarn.scheduler.capacity.maximum-am-resource-percent=1\nyarn.scheduler.capacity.node-locality-delay=40\nyarn.scheduler.capacity.root.capacity=100\nyarn.scheduler.capacity.root.default.state=RUNNING\nyarn.scheduler.capacity.root.default.maximum-capacity=0.0\nyarn.scheduler.capacity.root.queues=default,llap\nyarn.scheduler.capacity.maximum-applications=10000\nyarn.scheduler.capacity.root.default.user-limit-factor=1\nyarn.scheduler.capacity.root.acl_administer_queue=*\nyarn.scheduler.capacity.root.default.acl_submit_applications=*\nyarn.scheduler.capacity.root.default.capacity=0.0\nyarn.scheduler.capacity.queue-mappings-override.enable=false\nyarn.scheduler.capacity.root.ordering-policy=priority-utilization\nyarn.scheduler.capacity.root.llap.user-limit-factor=1\nyarn.scheduler.capacity.root.llap.state=RUNNING\nyarn.scheduler.capacity.roo
 t.llap.ordering-policy=fifo\nyarn.scheduler.capacity.root.llap.priority=10\nyarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\nyarn.scheduler.capacity.root.llap.maximum-capacity=100.0\nyarn.scheduler.capacity.root.llap.capacity=100.0\nyarn.scheduler.capacity.root.llap.acl_submit_applications=hive\nyarn.scheduler.capacity.root.llap.acl_administer_queue=hive\nyarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1'})
     self.assertEquals(configurations['hive-interactive-site']['property_attributes']['hive.server2.tez.sessions.per.default.queue'], {'maximum': '4'})
 
     self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes_for_llap_daemons'], 3)
@@ -2488,9 +2508,11 @@ class TestHDP25StackAdvisor(TestCase):
                                   'yarn.scheduler.capacity.root.acl_administer_queue=*\n'
                                   'yarn.scheduler.capacity.node-locality-delay=40\n'
                                   'yarn.scheduler.capacity.queue-mappings-override.enable=false\n'
+                                  'yarn.scheduler.capacity.root.ordering-policy=priority-utilization\n'
                                   'yarn.scheduler.capacity.root.llap.user-limit-factor=1\n'
                                   'yarn.scheduler.capacity.root.llap.state=RUNNING\n'
                                   'yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n'
+                                  'yarn.scheduler.capacity.root.llap.priority=10\n'
                                   'yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n'
                                   'yarn.scheduler.capacity.root.llap.maximum-capacity=40\n'
                                   'yarn.scheduler.capacity.root.llap.capacity=40\n'
@@ -2563,7 +2585,7 @@ class TestHDP25StackAdvisor(TestCase):
 
     self.stackAdvisor.recommendYARNConfigurations(configurations, clusterData, services, self.hosts)
 
-    self.assertEqual(configurations['capacity-scheduler']['properties'], {'capacity-scheduler': 'yarn.scheduler.capacity.root.accessible-node-labels=*\nyarn.scheduler.capacity.maximum-am-resource-percent=1\nyarn.scheduler.capacity.node-locality-delay=40\nyarn.scheduler.capacity.root.capacity=100\nyarn.scheduler.capacity.root.default.state=RUNNING\nyarn.scheduler.capacity.root.default.maximum-capacity=2.0\nyarn.scheduler.capacity.root.queues=default,llap\nyarn.scheduler.capacity.maximum-applications=10000\nyarn.scheduler.capacity.root.default.user-limit-factor=1\nyarn.scheduler.capacity.root.acl_administer_queue=*\nyarn.scheduler.capacity.root.default.acl_submit_applications=*\nyarn.scheduler.capacity.root.default.capacity=2.0\nyarn.scheduler.capacity.queue-mappings-override.enable=false\nyarn.scheduler.capacity.root.llap.user-limit-factor=1\nyarn.scheduler.capacity.root.llap.state=RUNNING\nyarn.scheduler.capacity.root.llap.ordering-policy=fifo\nyarn.scheduler.capacity.root.llap.mini
 mum-user-limit-percent=100\nyarn.scheduler.capacity.root.llap.maximum-capacity=98.0\nyarn.scheduler.capacity.root.llap.capacity=98.0\nyarn.scheduler.capacity.root.llap.acl_submit_applications=hive\nyarn.scheduler.capacity.root.llap.acl_administer_queue=hive\nyarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1'})
+    self.assertEqual(configurations['capacity-scheduler']['properties'], {'capacity-scheduler': 'yarn.scheduler.capacity.root.accessible-node-labels=*\nyarn.scheduler.capacity.maximum-am-resource-percent=1\nyarn.scheduler.capacity.node-locality-delay=40\nyarn.scheduler.capacity.root.capacity=100\nyarn.scheduler.capacity.root.default.state=RUNNING\nyarn.scheduler.capacity.root.default.maximum-capacity=2.0\nyarn.scheduler.capacity.root.queues=default,llap\nyarn.scheduler.capacity.maximum-applications=10000\nyarn.scheduler.capacity.root.default.user-limit-factor=1\nyarn.scheduler.capacity.root.acl_administer_queue=*\nyarn.scheduler.capacity.root.default.acl_submit_applications=*\nyarn.scheduler.capacity.root.default.capacity=2.0\nyarn.scheduler.capacity.queue-mappings-override.enable=false\nyarn.scheduler.capacity.root.ordering-policy=priority-utilization\nyarn.scheduler.capacity.root.llap.user-limit-factor=1\nyarn.scheduler.capacity.root.llap.state=RUNNING\nyarn.scheduler.capacity.roo
 t.llap.ordering-policy=fifo\nyarn.scheduler.capacity.root.llap.priority=10\nyarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\nyarn.scheduler.capacity.root.llap.maximum-capacity=98.0\nyarn.scheduler.capacity.root.llap.capacity=98.0\nyarn.scheduler.capacity.root.llap.acl_submit_applications=hive\nyarn.scheduler.capacity.root.llap.acl_administer_queue=hive\nyarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1'})
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.server2.tez.sessions.per.default.queue'], '1.0')
     self.assertEquals(configurations['hive-interactive-site']['property_attributes']['hive.server2.tez.sessions.per.default.queue'], {'maximum': '4', 'minimum': '1'})
 
@@ -2688,9 +2710,11 @@ class TestHDP25StackAdvisor(TestCase):
                                   'yarn.scheduler.capacity.root.acl_administer_queue=*\n'
                                   'yarn.scheduler.capacity.node-locality-delay=40\n'
                                   'yarn.scheduler.capacity.queue-mappings-override.enable=false\n'
+                                  'yarn.scheduler.capacity.root.ordering-policy=priority-utilization\n'
                                   'yarn.scheduler.capacity.root.llap.user-limit-factor=1\n'
                                   'yarn.scheduler.capacity.root.llap.state=RUNNING\n'
                                   'yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n'
+                                  'yarn.scheduler.capacity.root.llap.priority=10\n'
                                   'yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n'
                                   'yarn.scheduler.capacity.root.llap.maximum-capacity=40\n'
                                   'yarn.scheduler.capacity.root.llap.capacity=40\n'
@@ -2762,7 +2786,7 @@ class TestHDP25StackAdvisor(TestCase):
 
     self.stackAdvisor.recommendYARNConfigurations(configurations, clusterData, services, self.hosts)
 
-    self.assertEqual(configurations['capacity-scheduler']['properties'], {'capacity-scheduler': 'yarn.scheduler.capacity.root.accessible-node-labels=*\nyarn.scheduler.capacity.maximum-am-resource-percent=1\nyarn.scheduler.capacity.node-locality-delay=40\nyarn.scheduler.capacity.root.capacity=100\nyarn.scheduler.capacity.root.default.state=RUNNING\nyarn.scheduler.capacity.root.default.maximum-capacity=80.0\nyarn.scheduler.capacity.root.queues=default,llap\nyarn.scheduler.capacity.maximum-applications=10000\nyarn.scheduler.capacity.root.default.user-limit-factor=1\nyarn.scheduler.capacity.root.acl_administer_queue=*\nyarn.scheduler.capacity.root.default.acl_submit_applications=*\nyarn.scheduler.capacity.root.default.capacity=80.0\nyarn.scheduler.capacity.queue-mappings-override.enable=false\nyarn.scheduler.capacity.root.llap.user-limit-factor=1\nyarn.scheduler.capacity.root.llap.state=RUNNING\nyarn.scheduler.capacity.root.llap.ordering-policy=fifo\nyarn.scheduler.capacity.root.llap.mi
 nimum-user-limit-percent=100\nyarn.scheduler.capacity.root.llap.maximum-capacity=20.0\nyarn.scheduler.capacity.root.llap.capacity=20.0\nyarn.scheduler.capacity.root.llap.acl_submit_applications=hive\nyarn.scheduler.capacity.root.llap.acl_administer_queue=hive\nyarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1'})
+    self.assertEqual(configurations['capacity-scheduler']['properties'], {'capacity-scheduler': 'yarn.scheduler.capacity.root.accessible-node-labels=*\nyarn.scheduler.capacity.maximum-am-resource-percent=1\nyarn.scheduler.capacity.node-locality-delay=40\nyarn.scheduler.capacity.root.capacity=100\nyarn.scheduler.capacity.root.default.state=RUNNING\nyarn.scheduler.capacity.root.default.maximum-capacity=80.0\nyarn.scheduler.capacity.root.queues=default,llap\nyarn.scheduler.capacity.maximum-applications=10000\nyarn.scheduler.capacity.root.default.user-limit-factor=1\nyarn.scheduler.capacity.root.acl_administer_queue=*\nyarn.scheduler.capacity.root.default.acl_submit_applications=*\nyarn.scheduler.capacity.root.default.capacity=80.0\nyarn.scheduler.capacity.queue-mappings-override.enable=false\nyarn.scheduler.capacity.root.ordering-policy=priority-utilization\nyarn.scheduler.capacity.root.llap.user-limit-factor=1\nyarn.scheduler.capacity.root.llap.state=RUNNING\nyarn.scheduler.capacity.r
 oot.llap.ordering-policy=fifo\nyarn.scheduler.capacity.root.llap.priority=10\nyarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\nyarn.scheduler.capacity.root.llap.maximum-capacity=20.0\nyarn.scheduler.capacity.root.llap.capacity=20.0\nyarn.scheduler.capacity.root.llap.acl_submit_applications=hive\nyarn.scheduler.capacity.root.llap.acl_administer_queue=hive\nyarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1'})
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.server2.tez.sessions.per.default.queue'], '1')
     self.assertEquals(configurations['hive-interactive-site']['property_attributes']['hive.server2.tez.sessions.per.default.queue'], {'maximum': '4', 'minimum': '1'})
 
@@ -2886,9 +2910,11 @@ class TestHDP25StackAdvisor(TestCase):
                                   'yarn.scheduler.capacity.root.acl_administer_queue=*\n'
                                   'yarn.scheduler.capacity.node-locality-delay=40\n'
                                   'yarn.scheduler.capacity.queue-mappings-override.enable=false\n'
+                                  'yarn.scheduler.capacity.root.ordering-policy=priority-utilization\n'
                                   'yarn.scheduler.capacity.root.llap.user-limit-factor=1\n'
                                   'yarn.scheduler.capacity.root.llap.state=RUNNING\n'
                                   'yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n'
+                                  'yarn.scheduler.capacity.root.llap.priority=10\n'
                                   'yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n'
                                   'yarn.scheduler.capacity.root.llap.maximum-capacity=40\n'
                                   'yarn.scheduler.capacity.root.llap.capacity=40\n'
@@ -2958,7 +2984,7 @@ class TestHDP25StackAdvisor(TestCase):
 
     self.stackAdvisor.recommendYARNConfigurations(configurations, clusterData, services, self.hosts)
 
-    self.assertEqual(configurations['capacity-scheduler']['properties'], {'capacity-scheduler': 'yarn.scheduler.capacity.root.accessible-node-labels=*\nyarn.scheduler.capacity.maximum-am-resource-percent=1\nyarn.scheduler.capacity.node-locality-delay=40\nyarn.scheduler.capacity.root.capacity=100\nyarn.scheduler.capacity.root.default.state=RUNNING\nyarn.scheduler.capacity.root.default.maximum-capacity=0.0\nyarn.scheduler.capacity.root.queues=default,llap\nyarn.scheduler.capacity.maximum-applications=10000\nyarn.scheduler.capacity.root.default.user-limit-factor=1\nyarn.scheduler.capacity.root.acl_administer_queue=*\nyarn.scheduler.capacity.root.default.acl_submit_applications=*\nyarn.scheduler.capacity.root.default.capacity=0.0\nyarn.scheduler.capacity.queue-mappings-override.enable=false\nyarn.scheduler.capacity.root.llap.user-limit-factor=1\nyarn.scheduler.capacity.root.llap.state=RUNNING\nyarn.scheduler.capacity.root.llap.ordering-policy=fifo\nyarn.scheduler.capacity.root.llap.mini
 mum-user-limit-percent=100\nyarn.scheduler.capacity.root.llap.maximum-capacity=100.0\nyarn.scheduler.capacity.root.llap.capacity=100.0\nyarn.scheduler.capacity.root.llap.acl_submit_applications=hive\nyarn.scheduler.capacity.root.llap.acl_administer_queue=hive\nyarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1'})
+    self.assertEqual(configurations['capacity-scheduler']['properties'], {'capacity-scheduler': 'yarn.scheduler.capacity.root.accessible-node-labels=*\nyarn.scheduler.capacity.maximum-am-resource-percent=1\nyarn.scheduler.capacity.node-locality-delay=40\nyarn.scheduler.capacity.root.capacity=100\nyarn.scheduler.capacity.root.default.state=RUNNING\nyarn.scheduler.capacity.root.default.maximum-capacity=0.0\nyarn.scheduler.capacity.root.queues=default,llap\nyarn.scheduler.capacity.maximum-applications=10000\nyarn.scheduler.capacity.root.default.user-limit-factor=1\nyarn.scheduler.capacity.root.acl_administer_queue=*\nyarn.scheduler.capacity.root.default.acl_submit_applications=*\nyarn.scheduler.capacity.root.default.capacity=0.0\nyarn.scheduler.capacity.queue-mappings-override.enable=false\nyarn.scheduler.capacity.root.ordering-policy=priority-utilization\nyarn.scheduler.capacity.root.llap.user-limit-factor=1\nyarn.scheduler.capacity.root.llap.state=RUNNING\nyarn.scheduler.capacity.roo
 t.llap.ordering-policy=fifo\nyarn.scheduler.capacity.root.llap.priority=10\nyarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\nyarn.scheduler.capacity.root.llap.maximum-capacity=100.0\nyarn.scheduler.capacity.root.llap.capacity=100.0\nyarn.scheduler.capacity.root.llap.acl_submit_applications=hive\nyarn.scheduler.capacity.root.llap.acl_administer_queue=hive\nyarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1'})
     self.assertEquals(configurations['hive-interactive-site']['property_attributes']['hive.server2.tez.sessions.per.default.queue'], {'maximum': '4'})
 
     self.assertTrue(configurations['hive-interactive-env']['properties']['num_llap_nodes_for_llap_daemons'], 3)


[09/50] [abbrv] ambari git commit: AMBARI-19357. Flume metrics can't show if hostname of flume agent is not lowercase. (Yao Lei via swagle)

Posted by nc...@apache.org.
AMBARI-19357. Flume metrics can't show if hostname of flume agent  is not lowercase. (Yao Lei via swagle)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 38a17a7fb4a27c7ab2bd3d4e87d8ffd0f4150079
Parents: 4381561
Author: Siddharth Wagle <sw...@hortonworks.com>
Authored: Fri Feb 10 13:31:39 2017 -0800
Committer: Siddharth Wagle <sw...@hortonworks.com>
Committed: Fri Feb 10 13:31:39 2017 -0800

----------------------------------------------------------------------
 .../hadoop/metrics2/sink/flume/FlumeTimelineMetricsSink.java       | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/38a17a7f/ambari-metrics/ambari-metrics-flume-sink/src/main/java/org/apache/hadoop/metrics2/sink/flume/FlumeTimelineMetricsSink.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-flume-sink/src/main/java/org/apache/hadoop/metrics2/sink/flume/FlumeTimelineMetricsSink.java b/ambari-metrics/ambari-metrics-flume-sink/src/main/java/org/apache/hadoop/metrics2/sink/flume/FlumeTimelineMetricsSink.java
index 86e092a..3fdf3f4 100644
--- a/ambari-metrics/ambari-metrics-flume-sink/src/main/java/org/apache/hadoop/metrics2/sink/flume/FlumeTimelineMetricsSink.java
+++ b/ambari-metrics/ambari-metrics-flume-sink/src/main/java/org/apache/hadoop/metrics2/sink/flume/FlumeTimelineMetricsSink.java
@@ -88,6 +88,8 @@ public class FlumeTimelineMetricsSink extends AbstractTimelineMetricsSink implem
       if ((hostname == null) || (!hostname.contains("."))) {
         hostname = InetAddress.getLocalHost().getCanonicalHostName();
       }
+      hostname = hostname.toLowerCase();
+
     } catch (UnknownHostException e) {
       LOG.error("Could not identify hostname.");
       throw new FlumeException("Could not identify hostname.", e);


[14/50] [abbrv] ambari git commit: AMBARI-19958. Hive View 2.0 - deleting a saved query is buggy (pallavkul)

Posted by nc...@apache.org.
AMBARI-19958. Hive View 2.0 - deleting a saved query is buggy (pallavkul)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 23642958208fe6b3148ac157753edb13b6d31347
Parents: d96d209
Author: pallavkul <pa...@gmail.com>
Authored: Sat Feb 11 16:58:22 2017 +0530
Committer: pallavkul <pa...@gmail.com>
Committed: Sat Feb 11 16:58:22 2017 +0530

----------------------------------------------------------------------
 .../resources/ui/app/adapters/saved-query.js    |  2 +-
 .../resources/ui/app/components/query-editor.js |  2 +-
 .../resources/ui/app/controllers/saved-query.js | 22 +++++++++
 .../resources/ui/app/routes/queries/query.js    | 11 +++--
 .../resources/ui/app/routes/savedqueries.js     | 50 +++++++++++++++-----
 .../resources/ui/app/services/saved-queries.js  |  5 +-
 .../ui/app/templates/queries/query.hbs          |  2 +-
 .../resources/ui/app/templates/savedqueries.hbs |  8 ++--
 8 files changed, 75 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/23642958/contrib/views/hive20/src/main/resources/ui/app/adapters/saved-query.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/adapters/saved-query.js b/contrib/views/hive20/src/main/resources/ui/app/adapters/saved-query.js
index 5ee757b..a25adc7 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/adapters/saved-query.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/adapters/saved-query.js
@@ -21,6 +21,6 @@ import ApplicationAdapter from './application';
 
 export default ApplicationAdapter.extend({
   buildURL(){
-    return this._super(...arguments).replace('/resources','') + '/savedQueries/';
+    return this._super(...arguments).replace('/resources','');
   }
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/23642958/contrib/views/hive20/src/main/resources/ui/app/components/query-editor.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/query-editor.js b/contrib/views/hive20/src/main/resources/ui/app/components/query-editor.js
index 7bfe223..3175a35 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/components/query-editor.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/query-editor.js
@@ -101,7 +101,7 @@ export default Ember.Component.extend({
       }
     }
 
-    this.sendAction('updateQuery');
+    this.sendAction('updateQuery', query);
 
 
   }.observes('query'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/23642958/contrib/views/hive20/src/main/resources/ui/app/controllers/saved-query.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/controllers/saved-query.js b/contrib/views/hive20/src/main/resources/ui/app/controllers/saved-query.js
new file mode 100644
index 0000000..dc99fd1
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/controllers/saved-query.js
@@ -0,0 +1,22 @@
+/**
+ * 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 Ember from 'ember';
+
+export default Ember.Controller.extend({
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/23642958/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js b/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js
index dcf27b4..4f60229 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js
@@ -114,7 +114,6 @@ export default Ember.Route.extend({
     controller.set('isVisualExplainQuery', false);
     controller.set('visualExplainJson', null);
 
-
   },
 
 
@@ -122,7 +121,7 @@ export default Ember.Route.extend({
     createQuery(udfName, udfClassname, fileResourceName, fileResourcePath){
       let query = "add jar "+ fileResourcePath + ";\ncreate temporary function " + udfName + " as '"+ udfClassname+ "';";
       this.get('controller').set('currentQuery', query);
-      this.get('controller.model').set('currentQuery', query );
+      this.get('controller.model').set('query', query );
     },
 
     changeDbHandler(selectedDBs){
@@ -220,6 +219,7 @@ export default Ember.Route.extend({
 
         self.get('jobs').waitForJobToComplete(data.job.id, 2 * 1000, false)
           .then((status) => {
+
               self.get('controller').set('isJobSuccess', true);
               self.send('getJob', data);
 
@@ -318,8 +318,9 @@ export default Ember.Route.extend({
       });
     },
 
-    updateQuery(){
-      console.log('I am in update query.');
+    updateQuery(query){
+      this.get('controller').set('currentQuery', query);
+      this.get('controller.model').set('query', query);
     },
 
     goNextPage(){
@@ -411,7 +412,7 @@ export default Ember.Route.extend({
       console.log('I am in saveWorksheetModal');
       let newTitle = $('#worksheet-title').val();
 
-      let currentQuery = this.get('controller').get('currentQuery');
+      let currentQuery = this.get('controller.model').get('query');
       let selectedDb = this.get('controller.model').get('selectedDb');
       let owner = this.get('controller.model').get('owner');
       let queryFile = this.get('controller.model').get('queryFile');

http://git-wip-us.apache.org/repos/asf/ambari/blob/23642958/contrib/views/hive20/src/main/resources/ui/app/routes/savedqueries.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/savedqueries.js b/contrib/views/hive20/src/main/resources/ui/app/routes/savedqueries.js
index 7b9cb09..c2a0c8c 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/routes/savedqueries.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/routes/savedqueries.js
@@ -23,11 +23,14 @@ export default Ember.Route.extend({
   savedQueries: Ember.inject.service(),
 
   model() {
-    return this.get('savedQueries').getAllQueries();
+    return this.store.findAll('savedQuery').then(savedQueries => savedQueries.toArray());
   },
 
   setupController(controller, model) {
     this._super(...arguments);
+
+    controller.set('savedQuerylist', model);
+
     controller.set('showDeleteSaveQueryModal', false);
     controller.set('selectedSavedQueryId', null);
   },
@@ -39,19 +42,40 @@ export default Ember.Route.extend({
 
     deleteSavedQuery(){
       let queryId = this.get('controller').get('selectedSavedQueryId');
+      let self = this;
 
       console.log('deleteSavedQuery', queryId);
-      this.get('savedQueries').deleteSaveQuery(queryId)
-        .then((data) => {
-          console.log('Deleted saved query.', data);
-          this.get('controller').set('showDeleteSaveQueryModal', false );
-          //$(window).reload();
-        }, (error) => {
-          console.log("Error encountered", error);
+
+      this.get('store').queryRecord('saved-query', { filter: { id: queryId } }, {reload: true}).then(function(record) {
+        record.destroyRecord().then(function(data) {
+          self.send('deleteSavedQueryDeclined');
+          self.send('refreshSavedQueryList');
+        })
+      }, (error) => {
+        console.log('error', error);
+      });
+    },
+
+    refreshSavedQueryList(){
+      this.get('store').findAll('saved-query').then(data => {
+        let savedQueryList = [];
+        data.forEach(x => {
+          let localSavedQuery = {
+            'id': x.get('id'),
+            'dataBase': x.get('dataBase'),
+            'title': x.get('title'),
+            'queryFile': x.get('queryFile'),
+            'owner': x.get('owner'),
+            'shortQuery': x.get('shortQuery')
+          };
+          savedQueryList.pushObject(localSavedQuery);
         });
+
+        this.get('controller').set('savedQuerylist',savedQueryList);
+      })
     },
 
-    deleteSavedQuerypDeclined(){
+    deleteSavedQueryDeclined(){
       this.get('controller').set('selectedSavedQueryId', null);
       this.get('controller').set('showDeleteSaveQueryModal', false );
     },
@@ -85,10 +109,10 @@ export default Ember.Route.extend({
 
       let localWs = {
         id: worksheetId,
-        title: savedQuery.title,
-        query: savedQuery.shortQuery,
-        selectedDb : savedQuery.dataBase,
-        owner: savedQuery.owner,
+        title: savedQuery.get('title'),
+        query: savedQuery.get('shortQuery'),
+        selectedDb : savedQuery.get('dataBase'),
+        owner: savedQuery.get('owner'),
         selected: true
       };
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/23642958/contrib/views/hive20/src/main/resources/ui/app/services/saved-queries.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/services/saved-queries.js b/contrib/views/hive20/src/main/resources/ui/app/services/saved-queries.js
index 29ef4b5..80a19f3 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/services/saved-queries.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/services/saved-queries.js
@@ -30,15 +30,16 @@ export default Ember.Service.extend({
   saveQuery(payload){
     return $.ajax({
       type: "POST",
-      url: this.get('store').adapterFor('saved-query').buildURL(),
+      url: this.get('store').adapterFor('saved-query').buildURL() + '/savedQueries/',
       data: JSON.stringify({savedQuery: payload}) ,
       contentType:"application/json; charset=utf-8",
       dataType:"json",
       headers: {'X-Requested-By': 'ambari'}
     })
   },
+
   deleteSaveQuery(id){
-    let deletURL = this.get('store').adapterFor('saved-query').buildURL() + id;
+    let deletURL = this.get('store').adapterFor('saved-query').buildURL()+ '/savedQueries/' + id;
 
     return $.ajax({
       type: "DELETE",

http://git-wip-us.apache.org/repos/asf/ambari/blob/23642958/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query.hbs
index 2d6c5aa..84992d7 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query.hbs
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query.hbs
@@ -25,7 +25,7 @@
         <span class="expand-button" {{action "expandQueryEdidorPanel" }} >
           {{fa-icon "expand"}}
         </span>
-        {{query-editor query=currentQuery }}
+        {{query-editor query=currentQuery updateQuery='updateQuery' }}
       </div>
       <div class="row query-editor-controls">
         <button class="btn btn-success" {{action "executeQuery" }} disabled={{ worksheet.isQueryRunning}}>{{fa-icon "check"}} Execute</button>

http://git-wip-us.apache.org/repos/asf/ambari/blob/23642958/contrib/views/hive20/src/main/resources/ui/app/templates/savedqueries.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/savedqueries.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/savedqueries.hbs
index 36dc982..c3d907d 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/templates/savedqueries.hbs
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/savedqueries.hbs
@@ -29,7 +29,7 @@
       </tr>
       </thead>
       <tbody>
-      {{#each model.savedQueries as |savedQuery| }}
+      {{#each savedQuerylist as |savedQuery| }}
         <tr>
           <td>{{savedQuery.shortQuery}}</td>
           <td class="break-word">{{savedQuery.title}}</td>
@@ -37,8 +37,8 @@
           <td>{{savedQuery.owner}}</td>
           <td>
               <div class="dropdown">
-                <a class="dropdown-toggle" data-toggle="dropdown">{{fa-icon "cog"}}</a>
-                <ul class="dropdown-menu dropdown-menu-right"">
+                <a class="dropdown-toggle" id="dropdownMenu1121" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">{{fa-icon "cog"}}</a>
+                <ul class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenu">
                   <li><a href="#" {{action "historySavedQuery" savedQuery.id }} class="text-uppercase">{{fa-icon "history"}} History</a></li>
                   <li><a href="#" {{action "openDeleteSavedQueryModal" savedQuery.id}} class="text-uppercase">{{fa-icon "remove"}} Delete</a></li>
                   <li><a href="#" {{action "openAsWorksheet" savedQuery }} class="text-uppercase">{{fa-icon "folder-open-o"}} Open as worksheet</a></li>
@@ -63,7 +63,7 @@
   closable=false
   confirmClass="success"
   confirm="deleteSavedQuery"
-  reject="deleteSavedQuerypDeclined"
+  reject="deleteSavedQueryDeclined"
   }}
 {{/if}}
 


[21/50] [abbrv] ambari git commit: AMBARI-19970 : AMS graphs are not present on cluster with SSL. (avijayan)

Posted by nc...@apache.org.
AMBARI-19970 : AMS graphs are not present on cluster with SSL. (avijayan)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 5d695d83d8d5f2e8b622757b434133bfaa125dc8
Parents: 6eac0f5
Author: Aravindan Vijayan <av...@hortonworks.com>
Authored: Sun Feb 12 08:37:22 2017 -0800
Committer: Aravindan Vijayan <av...@hortonworks.com>
Committed: Sun Feb 12 08:37:22 2017 -0800

----------------------------------------------------------------------
 .../0.1.0/package/templates/hadoop-metrics2-hbase.properties.j2  | 4 ----
 1 file changed, 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/5d695d83/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/hadoop-metrics2-hbase.properties.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/hadoop-metrics2-hbase.properties.j2 b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/hadoop-metrics2-hbase.properties.j2
index 8c6f86f..8c20f2b 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/hadoop-metrics2-hbase.properties.j2
+++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/hadoop-metrics2-hbase.properties.j2
@@ -42,19 +42,16 @@ hbase.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
 hbase.period=30
 hbase.collector.hosts={{ams_collector_hosts}}
 hbase.port={{metric_collector_port}}
-hbase.protocol={{metric_collector_protocol}}
 
 jvm.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
 jvm.period=30
 jvm.collector.hosts={{ams_collector_hosts}}
 jvm.port={{metric_collector_port}}
-jvm.protocol={{metric_collector_protocol}}
 
 rpc.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
 rpc.period=30
 rpc.collector.hosts={{ams_collector_hosts}}
 rpc.port={{metric_collector_port}}
-rpc.protocol={{metric_collector_protocol}}
 
 *.timeline.plugin.urls=file:///usr/lib/ambari-metrics-hadoop-sink/ambari-metrics-hadoop-sink.jar
 *.sink.timeline.slave.host.name={{hostname}}
@@ -63,7 +60,6 @@ hbase.sink.timeline.period={{metrics_collection_period}}
 hbase.sink.timeline.sendInterval={{metrics_report_interval}}000
 hbase.sink.timeline.collector.hosts={{ams_collector_hosts}}
 hbase.sink.timeline.port={{metric_collector_port}}
-hbase.sink.timeline.protocol={{metric_collector_protocol}}
 hbase.sink.timeline.serviceName-prefix=ams
 
 # HTTPS properties


[48/50] [abbrv] ambari git commit: AMBARI-19877. Confirmation for deleting services show serviceName and not displayName (onechiporenko)

Posted by nc...@apache.org.
AMBARI-19877. Confirmation for deleting services show serviceName and not displayName (onechiporenko)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 1756ce5ea6afb7256c5fb7e987a1cdb91d073d71
Parents: 3436c4a
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Mon Feb 6 13:57:39 2017 +0200
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Mon Feb 13 15:45:36 2017 -0500

----------------------------------------------------------------------
 ambari-web/app/controllers/main/service/item.js | 15 ++++--
 .../test/controllers/main/service/item_test.js  | 54 ++++++++++++++++++--
 2 files changed, 62 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/1756ce5e/ambari-web/app/controllers/main/service/item.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/item.js b/ambari-web/app/controllers/main/service/item.js
index 9758ac3..7010ab5 100644
--- a/ambari-web/app/controllers/main/service/item.js
+++ b/ambari-web/app/controllers/main/service/item.js
@@ -1531,10 +1531,17 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
   },
 
   confirmServiceDeletion: function() {
-    var progressPopup = this.get('deleteServiceProgressPopup'),
-      msg = this.get('interDependentServices.length')
-        ? Em.I18n.t('services.service.delete.service.success.confirmation.plural').format(this.get('serviceNamesToDelete').join(','))
-        : Em.I18n.t('services.service.delete.service.success.confirmation').format(this.get('content.serviceName'));
+    let serviceNames, msg;
+    if (this.get('interDependentServices.length')) {
+      serviceNames = this.get('serviceNamesToDelete').map(serviceName => App.format.role(serviceName, true)).join(', ');
+      msg = Em.I18n.t('services.service.delete.service.success.confirmation.plural').format(serviceNames);
+    }
+    else {
+      serviceNames = App.format.role(this.get('content.serviceName'), true);
+      msg = Em.I18n.t('services.service.delete.service.success.confirmation').format(serviceNames);
+    }
+
+    var progressPopup = this.get('deleteServiceProgressPopup');
     if (progressPopup) {
       progressPopup.onClose();
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/1756ce5e/ambari-web/test/controllers/main/service/item_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/service/item_test.js b/ambari-web/test/controllers/main/service/item_test.js
index b582e86..302a9a5 100644
--- a/ambari-web/test/controllers/main/service/item_test.js
+++ b/ambari-web/test/controllers/main/service/item_test.js
@@ -28,7 +28,7 @@ require('controllers/main/service/reassign_controller');
 require('controllers/main/service/item');
 var batchUtils = require('utils/batch_scheduled_requests');
 var testHelpers = require('test/helpers');
-var stackSerivceModel = {
+var stackServiceModel = {
   'HDFS': Em.Object.create({
     serviceName: 'HDFS',
     requiredServices: ['ZOOKEEPER']
@@ -1352,7 +1352,7 @@ describe('App.MainServiceItemController', function () {
     beforeEach(function() {
       mainServiceItemController = App.MainServiceItemController.create({});
       sinon.stub(App.StackService, 'find', function (serviceName) {
-        return stackSerivceModel[serviceName];
+        return stackServiceModel[serviceName];
       });
       this.mockService = sinon.stub(App.Service, 'find');
     });
@@ -1644,7 +1644,7 @@ describe('App.MainServiceItemController', function () {
 
     beforeEach(function() {
       sinon.stub(App.StackService, 'find', function (serviceName) {
-        return stackSerivceModel[serviceName];
+        return stackServiceModel[serviceName];
       });
       mainServiceItemController = App.MainServiceItemController.create({
         content: {}
@@ -1802,6 +1802,54 @@ describe('App.MainServiceItemController', function () {
     });
   });
 
+  describe('#confirmServiceDeletion', function () {
+
+    var mainServiceItemController = App.MainServiceItemController.create({deleteServiceProgressPopup: null});
+
+    [
+      {
+        content: Em.Object.create({serviceName: 'DRUID'}),
+        stackServices: [
+          Em.Object.create({id: 'DRUID', displayName: 'Druid', serviceName: 'DRUID', requiredServices: []})
+        ],
+        m: 'No required services',
+        e: Em.I18n.t('services.service.delete.service.success.confirmation').format('Druid')
+      },
+      {
+        content: Em.Object.create({serviceName: 'MAPREDUCE2'}),
+        stackServices: [
+          Em.Object.create({id: 'MAPREDUCE2', serviceName: 'MAPREDUCE2', requiredServices: ['YARN'], displayName: 'MapReduce2'}),
+          Em.Object.create({id: 'YARN', serviceName: 'YARN', requiredServices: ['MAPREDUCE2'], displayName: 'YARN'}),
+        ],
+        m: 'One required service',
+        e: Em.I18n.t('services.service.delete.service.success.confirmation.plural').format('MapReduce2, YARN')
+      }
+    ].forEach(function(test) {
+      describe(test.m, function () {
+
+        beforeEach(function () {
+          sinon.stub(App.StackService, 'find', function (id) {
+            return arguments.length ? test.stackServices.findProperty('id', id) : test.stackServices;
+          });
+          sinon.spy(App, 'showAlertPopup');
+          mainServiceItemController.set('content', test.content);
+          mainServiceItemController.confirmServiceDeletion();
+        });
+
+        afterEach(function () {
+          App.StackService.find.restore();
+          App.showAlertPopup.restore();
+        });
+
+        it('Popup body has display service names', function () {
+          expect(App.showAlertPopup.args[0][1]).to.be.equal(test.e);
+        });
+
+      });
+    });
+
+  });
+
   describe("#isRangerPluginEnabled()", function () {
     var mainServiceItemController;
 


[41/50] [abbrv] ambari git commit: AMBARI-19848. Hive View 2.0: Allow user to create database. (dipayanb)

Posted by nc...@apache.org.
AMBARI-19848. Hive View 2.0: Allow user to create database. (dipayanb)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 60c353981af950d9713d9d5707c8ba8b0b08324c
Parents: fe27598
Author: Dipayan Bhowmick <di...@gmail.com>
Authored: Mon Feb 6 11:24:12 2017 +0530
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Mon Feb 13 15:45:35 2017 -0500

----------------------------------------------------------------------
 .../CreateDatabaseQueryGenerator.java           | 44 +++++++++++++
 .../DeleteDatabaseQueryGenerator.java           |  2 +-
 .../view/hive20/resources/browser/DDLProxy.java | 12 ++++
 .../hive20/resources/browser/DDLService.java    | 31 +++++++++
 .../main/resources/ui/app/adapters/database.js  |  8 +++
 .../ui/app/components/create-database-form.js   | 59 +++++++++++++++++
 .../hive20/src/main/resources/ui/app/router.js  |  1 +
 .../main/resources/ui/app/routes/databases.js   |  4 --
 .../databases/database/tables/new-database.js   | 68 ++++++++++++++++++++
 .../ui/app/services/table-operations.js         | 11 ++++
 .../components/create-database-form.hbs         | 31 +++++++++
 .../resources/ui/app/templates/databases.hbs    |  2 +-
 .../databases/database/tables/new-database.hbs  | 47 ++++++++++++++
 13 files changed, 314 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/60c35398/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/CreateDatabaseQueryGenerator.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/CreateDatabaseQueryGenerator.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/CreateDatabaseQueryGenerator.java
new file mode 100644
index 0000000..c72df03
--- /dev/null
+++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/CreateDatabaseQueryGenerator.java
@@ -0,0 +1,44 @@
+/**
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package org.apache.ambari.view.hive20.internal.query.generators;
+
+import org.apache.ambari.view.hive20.exceptions.ServiceException;
+import org.apache.commons.lang3.StringUtils;
+import com.google.common.base.Optional;
+
+public class CreateDatabaseQueryGenerator implements QueryGenerator {
+  public final String databaseName;
+
+  public CreateDatabaseQueryGenerator(String databaseName) {
+    this.databaseName = databaseName;
+  }
+
+  public String getDatabaseName() {
+    return databaseName;
+  }
+
+  @Override
+  public Optional<String> getQuery() throws ServiceException {
+    if(StringUtils.isEmpty(this.getDatabaseName())){
+      throw new ServiceException("Database name cannot be null or empty.");
+    }
+
+    return Optional.of("CREATE DATABASE `" + this.getDatabaseName() + "`");
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/60c35398/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/DeleteDatabaseQueryGenerator.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/DeleteDatabaseQueryGenerator.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/DeleteDatabaseQueryGenerator.java
index 6e1e1a5..189cd5e 100644
--- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/DeleteDatabaseQueryGenerator.java
+++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/DeleteDatabaseQueryGenerator.java
@@ -1,4 +1,4 @@
-/*
+/**
 * 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

http://git-wip-us.apache.org/repos/asf/ambari/blob/60c35398/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLProxy.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLProxy.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLProxy.java
index 7210c75..f75b008 100644
--- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLProxy.java
+++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLProxy.java
@@ -44,6 +44,7 @@ import org.apache.ambari.view.hive20.internal.dto.TableResponse;
 import org.apache.ambari.view.hive20.internal.parsers.TableMetaParserImpl;
 import org.apache.ambari.view.hive20.internal.query.generators.AlterTableQueryGenerator;
 import org.apache.ambari.view.hive20.internal.query.generators.AnalyzeTableQueryGenerator;
+import org.apache.ambari.view.hive20.internal.query.generators.CreateDatabaseQueryGenerator;
 import org.apache.ambari.view.hive20.internal.query.generators.CreateTableQueryGenerator;
 import org.apache.ambari.view.hive20.internal.query.generators.DeleteDatabaseQueryGenerator;
 import org.apache.ambari.view.hive20.internal.query.generators.DeleteTableQueryGenerator;
@@ -310,6 +311,17 @@ public class DDLProxy {
     }
   }
 
+  public Job createDatabase(String databaseName, JobResourceManager resourceManager) throws ServiceException {
+    CreateDatabaseQueryGenerator queryGenerator = new CreateDatabaseQueryGenerator(databaseName);
+    Optional<String> deleteDatabase = queryGenerator.getQuery();
+    if(deleteDatabase.isPresent()) {
+      String deleteQuery = deleteDatabase.get();
+      return createJob("default", deleteQuery, "CREATE DATABASE " + databaseName , resourceManager);
+    }else{
+      throw new ServiceException("Failed to generate create database query for database " + databaseName);
+    }
+  }
+
   public Job createJob(String databaseName, String deleteQuery, String jobTitle, JobResourceManager resourceManager)
     throws ServiceException {
     LOG.info("Creating job for : {}", deleteQuery );

http://git-wip-us.apache.org/repos/asf/ambari/blob/60c35398/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java
index 5c955a2..af8e1cd 100644
--- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java
+++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java
@@ -112,6 +112,23 @@ public class DDLService extends BaseService {
     }
   }
 
+  @POST
+  @Path("databases")
+  @Produces(MediaType.APPLICATION_JSON)
+  public Response createDatabase(CreateDatabaseRequestWrapper wrapper) {
+    String databaseId = wrapper.database.name;
+    Job job = null;
+    try {
+      job = proxy.createDatabase(databaseId, getResourceManager());
+      JSONObject response = new JSONObject();
+      response.put("job", job);
+      return Response.status(Response.Status.ACCEPTED).entity(response).build();
+    } catch (ServiceException e) {
+      LOG.error("Exception occurred while delete database {}", databaseId, e);
+      throw new ServiceFormattedException(e);
+    }
+  }
+
   @GET
   @Path("databases/{database_id}/tables")
   @Produces(MediaType.APPLICATION_JSON)
@@ -315,4 +332,18 @@ public class DDLService extends BaseService {
   public static class TableMetaRequest {
     public TableMeta tableInfo;
   }
+
+  /**
+   * Wrapper class for create database request
+   */
+  public static class CreateDatabaseRequestWrapper {
+    public CreateDatabaseRequest database;
+  }
+
+  /**
+   * Request class for create database
+   */
+  public static class CreateDatabaseRequest {
+    public String name;
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/60c35398/contrib/views/hive20/src/main/resources/ui/app/adapters/database.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/adapters/database.js b/contrib/views/hive20/src/main/resources/ui/app/adapters/database.js
index 6333ae6..8c1fb96 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/adapters/database.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/adapters/database.js
@@ -22,5 +22,13 @@ export default DDLAdapter.extend({
   deleteDatabase(databaseName) {
     let deletURL = this.urlForFindRecord(databaseName, 'database');
     return this.ajax(deletURL, 'DELETE');
+  },
+
+  createDatabase(databaseName) {
+    let createUrl = this.urlForFindAll('database');
+    let data = {
+      database: { name: databaseName}
+    };
+    return this.ajax(createUrl, 'POST', {data: data});
   }
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/60c35398/contrib/views/hive20/src/main/resources/ui/app/components/create-database-form.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/create-database-form.js b/contrib/views/hive20/src/main/resources/ui/app/components/create-database-form.js
new file mode 100644
index 0000000..5a7dd53
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/create-database-form.js
@@ -0,0 +1,59 @@
+/**
+ * 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 Ember from 'ember';
+
+export default Ember.Component.extend({
+  classNames: ['form-horizontal'],
+
+  errorCleaner: Ember.observer('newDatabaseName', function() {
+    if(this.get('error')) {
+      this.clearError();
+    }
+  }),
+
+  validate() {
+    if(Ember.isEmpty(this.get('newDatabaseName'))) {
+      this.setError("Database name cannot be empty");
+      return false;
+    }
+    return true;
+  },
+
+  setError(message) {
+    this.set('error', true);
+    this.set('errorMessage', message);
+  },
+
+  clearError() {
+    this.set('error');
+    this.set('errorMessage');
+  },
+
+  actions: {
+    rename() {
+      if(this.validate()) {
+        this.sendAction('create', this.get('newDatabaseName'));
+      }
+    },
+
+    cancel() {
+      this.sendAction('cancel');
+    }
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/60c35398/contrib/views/hive20/src/main/resources/ui/app/router.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/router.js b/contrib/views/hive20/src/main/resources/ui/app/router.js
index bc9bfa5..150a3fd 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/router.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/router.js
@@ -36,6 +36,7 @@ Router.map(function() {
     this.route('newtable');
     this.route('database', {path: '/:databaseId'}, function() {
       this.route('tables', {path: '/tables'}, function() {
+        this.route('new-database');
         this.route('new');
         this.route('table', {path: '/:name'}, function() {
           this.route('columns');

http://git-wip-us.apache.org/repos/asf/ambari/blob/60c35398/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js
index fd19905..123a93f 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js
@@ -76,10 +76,6 @@ export default Ember.Route.extend({
       this.get('controller').set('confirmDropDatabase', true);
     },
 
-    createTable() {
-      console.log("Table created");
-    },
-
     notEmptyDialogClosed() {
       this.get('controller').set('databaseNotEmpty', false);
       this.get('controller').set('databaseToDelete', undefined);

http://git-wip-us.apache.org/repos/asf/ambari/blob/60c35398/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/new-database.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/new-database.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/new-database.js
new file mode 100644
index 0000000..b421bdc
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/new-database.js
@@ -0,0 +1,68 @@
+/**
+ * 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 Ember from 'ember';
+
+export default Ember.Route.extend({
+
+  tableOperations: Ember.inject.service(),
+
+  actions: {
+    cancel() {
+      this.transitionTo('databases');
+    },
+
+    create(newDatabaseName) {
+      this._createDatabase(newDatabaseName);
+    }
+  },
+
+  _createDatabase(newDatabaseName) {
+    this._modalStatus(true, 'Submitting request to create database');
+    this.get('tableOperations').createDatabase(newDatabaseName).then((job) => {
+      this._modalStatus(true, 'Waiting for the database to be created');
+      return this.get('tableOperations').waitForJobToComplete(job.get('id'), 5 * 1000);
+    }).then((status) => {
+      this._modalStatus(true, 'Successfully created database');
+      this._transitionToDatabases(newDatabaseName);
+    }).catch((err) => {
+      this._modalStatus(true, 'Failed to create database');
+      this._alertMessage('Failed to create database', err);
+      this._transitionToDatabases();
+    });
+  },
+
+  _modalStatus(status, message) {
+    this.controller.set('showModal', status);
+    if(status) {
+      this.controller.set('modalMessage', message);
+    }
+  },
+
+  _transitionToDatabases(databaseName) {
+    Ember.run.later(() => {
+      this._modalStatus(false);
+      this.transitionTo('databases');
+    }, 2000);
+  },
+
+  _alertMessage(message, err) {
+    console.log(message, err);
+    // TODO: user alert message here
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/60c35398/contrib/views/hive20/src/main/resources/ui/app/services/table-operations.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/services/table-operations.js b/contrib/views/hive20/src/main/resources/ui/app/services/table-operations.js
index 264e617..2a0aeed 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/services/table-operations.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/services/table-operations.js
@@ -67,6 +67,17 @@ export default Ember.Service.extend({
     })
   },
 
+  createDatabase(database) {
+    return new Promise((resolve, reject) => {
+      this.get('store').adapterFor('database').createDatabase(database).then((data) => {
+        this.get('store').pushPayload(data);
+        resolve(this.get('store').peekRecord('job', data.job.id));
+      }, (err) => {
+        reject(err);
+      });
+    })
+  },
+
   waitForJobToComplete(jobId, after) {
     return new Ember.RSVP.Promise((resolve, reject) => {
       Ember.run.later(() => {

http://git-wip-us.apache.org/repos/asf/ambari/blob/60c35398/contrib/views/hive20/src/main/resources/ui/app/templates/components/create-database-form.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/create-database-form.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/create-database-form.hbs
new file mode 100644
index 0000000..00e0606
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/create-database-form.hbs
@@ -0,0 +1,31 @@
+{{!
+* 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.
+}}
+
+<div class="form-group">
+  <label class="col-sm-4 control-label">New Database Name</label>
+  <div class="col-sm-8 {{if error 'has-error'}}">
+    {{input value=newDatabaseName class="form-control" placeholder="Database Name"}}
+    <span class="help-block">{{errorMessage}}</span>
+  </div>
+</div>
+<div class="form-group">
+  <div class="col-sm-offset-4 col-sm-8">
+    <button type="submit" class="btn btn-warning" {{action "rename"}}>{{fa-icon "pencil-square-o"}} Create</button>
+    <button type="submit" class="btn btn-primary" {{action "cancel"}}>{{fa-icon "times"}} Cancel</button>
+  </div>
+</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/60c35398/contrib/views/hive20/src/main/resources/ui/app/templates/databases.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/databases.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/databases.hbs
index 9a4a892..bb4d680 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/templates/databases.hbs
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/databases.hbs
@@ -23,8 +23,8 @@
       {{fa-icon "navicon"}}
     </button>
     <ul class="dropdown-menu dropdown-menu-right">
+      <li>{{#link-to "databases.database.tables.new-database" class="text-uppercase"}}{{fa-icon "plus"}} create database{{/link-to}}</li>
       <li><a href="#" {{action "dropDatabase"}} class="text-uppercase">{{fa-icon "trash"}} drop database</a></li>
-      <li><a href="#" {{action "createTable"}} class="text-uppercase">{{fa-icon "plus"}} create table</a></li>
     </ul>
   </div>
 </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/60c35398/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/new-database.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/new-database.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/new-database.hbs
new file mode 100644
index 0000000..3b2b99f
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/new-database.hbs
@@ -0,0 +1,47 @@
+{{!
+* 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.
+}}
+
+<div class="row">
+  <div class="col-md-12">
+    <div class="alert alert-info">
+      <p class="lead">{{fa-icon "plus" size=1}} Create Database</p>
+    </div>
+  </div>
+
+</div>
+
+<div class="row stats-section">
+  <div class="col-md-6">
+    {{create-database-form create="create" cancel="cancel"}}
+  </div>
+</div>
+
+{{#if showModal}}
+  {{#modal-dialog
+    translucentOverlay=true
+    container-class="modal-dialog modal-sm"}}
+    <div class="modal-content">
+      <div class="modal-header text-danger">
+        <p class="modal-title">{{fa-icon "plus"}}&nbsp;&nbsp;&nbsp; Create Database</p>
+      </div>
+      <div class="modal-body text-center text-primary">
+        <p>{{modalMessage}}</p>
+      </div>
+    </div><!-- /.modal-content -->
+  {{/modal-dialog}}
+{{/if}}
\ No newline at end of file


[04/50] [abbrv] ambari git commit: AMBARI-19577. Add Livy session recovery configurations in Ambari (Saisai Shao via smohanty)

Posted by nc...@apache.org.
AMBARI-19577. Add Livy session recovery configurations in Ambari (Saisai Shao via smohanty)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: a0ba7fbe7f80332bcff1cab9ea7dbe27ca59a003
Parents: eecb5a3
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Fri Feb 10 08:36:58 2017 -0800
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Fri Feb 10 08:42:42 2017 -0800

----------------------------------------------------------------------
 .../SPARK/1.2.1/package/scripts/params.py       |  1 +
 .../SPARK/1.2.1/package/scripts/setup_livy.py   |  8 +++++
 .../SPARK2/2.0.0/package/scripts/params.py      |  1 +
 .../SPARK2/2.0.0/package/scripts/setup_livy2.py |  8 +++++
 .../services/SPARK/configuration/livy-conf.xml  | 24 +++++++++++++++
 .../SPARK2/configuration/livy2-conf.xml         | 24 +++++++++++++++
 .../python/stacks/2.5/SPARK/test_spark_livy.py  | 31 ++++++++++++++++++++
 .../stacks/2.6/SPARK2/test_spark_livy2.py       | 31 ++++++++++++++++++++
 8 files changed, 128 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a0ba7fbe/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/params.py b/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/params.py
index 82cd0b2..6a59caf 100644
--- a/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/params.py
@@ -222,6 +222,7 @@ if stack_version_formatted and check_stack_feature(StackFeature.SPARK_LIVY, stac
   user_group = status_params.user_group
   livy_hdfs_user_dir = format("/user/{livy_user}")
   livy_server_pid_file = status_params.livy_server_pid_file
+  livy_recovery_dir = default("/configurations/livy-conf/livy.server.recovery.state-store.url", "/livy-recovery")
 
   livy_server_start = format("{livy_home}/bin/livy-server start")
   livy_server_stop = format("{livy_home}/bin/livy-server stop")

http://git-wip-us.apache.org/repos/asf/ambari/blob/a0ba7fbe/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/setup_livy.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/setup_livy.py b/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/setup_livy.py
index 07b704f..32615c3 100644
--- a/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/setup_livy.py
+++ b/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/setup_livy.py
@@ -40,6 +40,14 @@ def setup_livy(env, type, upgrade_type = None, action = None):
     )
     params.HdfsResource(None, action="execute")
 
+    params.HdfsResource(params.livy_recovery_dir,
+                       type="directory",
+                       action="create_on_execute",
+                       owner=params.livy_user,
+                       mode=0775
+    )
+    params.HdfsResource(None, action="execute")
+
   # create livy-env.sh in etc/conf dir
   File(os.path.join(params.livy_conf, 'livy-env.sh'),
        owner=params.livy_user,

http://git-wip-us.apache.org/repos/asf/ambari/blob/a0ba7fbe/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/params.py
index c19f88c..b6889e4 100755
--- a/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/params.py
@@ -207,6 +207,7 @@ if stack_version_formatted and check_stack_feature(StackFeature.SPARK_LIVY2, sta
   user_group = status_params.user_group
   livy2_hdfs_user_dir = format("/user/{livy2_user}")
   livy2_server_pid_file = status_params.livy2_server_pid_file
+  livy2_recovery_dir = default("/configurations/livy2-conf/livy.server.recovery.state-store.url", "/livy2-recovery")
 
   livy2_server_start = format("{livy2_home}/bin/livy-server start")
   livy2_server_stop = format("{livy2_home}/bin/livy-server stop")

http://git-wip-us.apache.org/repos/asf/ambari/blob/a0ba7fbe/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/setup_livy2.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/setup_livy2.py b/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/setup_livy2.py
index f2178f7..2e92509 100644
--- a/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/setup_livy2.py
+++ b/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/setup_livy2.py
@@ -40,6 +40,14 @@ def setup_livy(env, type, upgrade_type = None, action = None):
     )
     params.HdfsResource(None, action="execute")
 
+    params.HdfsResource(params.livy2_recovery_dir,
+                        type="directory",
+                        action="create_on_execute",
+                        owner=params.livy2_user,
+                        mode=0775
+       )
+    params.HdfsResource(None, action="execute")
+
   # create livy-env.sh in etc/conf dir
   File(os.path.join(params.livy2_conf, 'livy-env.sh'),
        owner=params.livy2_user,

http://git-wip-us.apache.org/repos/asf/ambari/blob/a0ba7fbe/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK/configuration/livy-conf.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK/configuration/livy-conf.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK/configuration/livy-conf.xml
index 23583c0..28eeab5 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK/configuration/livy-conf.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK/configuration/livy-conf.xml
@@ -78,4 +78,28 @@
      </description>
      <on-ambari-upgrade add="true"/>
   </property>
+  <property>
+    <name>livy.server.recovery.mode</name>
+    <value>recovery</value>
+    <description>
+          Recovery mode for livy, either be "off" or "recovery".
+    </description>
+    <on-ambari-upgrade add="false"/>
+  </property>
+  <property>
+    <name>livy.server.recovery.state-store</name>
+    <value>filesystem</value>
+    <description>
+          Where Livy should store state for recovery.
+    </description>
+    <on-ambari-upgrade add="false"/>
+  </property>
+  <property>
+    <name>livy.server.recovery.state-store.url</name>
+    <value>/livy-recovery</value>
+    <description>
+          Where Livy should store state for recovery.
+    </description>
+    <on-ambari-upgrade add="false"/>
+  </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/a0ba7fbe/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK2/configuration/livy2-conf.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK2/configuration/livy2-conf.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK2/configuration/livy2-conf.xml
index 231ef70..c8a65bd 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK2/configuration/livy2-conf.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK2/configuration/livy2-conf.xml
@@ -85,6 +85,30 @@
             Whether to enable HiveContext in livy interpreter
         </description>
         <on-ambari-upgrade add="false"/>
+    <property>
+    </property>
+        <name>livy.server.recovery.mode</name>
+        <value>recovery</value>
+        <description>
+            Recovery mode for livy, either be "off" or "recovery".
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+    <property>
+        <name>livy.server.recovery.state-store</name>
+        <value>filesystem</value>
+        <description>
+            Where Livy should store state for recovery.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+    <property>
+        <name>livy.server.recovery.state-store.url</name>
+        <value>/livy2-recovery</value>
+        <description>
+            Where Livy should store state for recovery.
+        </description>
+        <on-ambari-upgrade add="false"/>
     </property>
 </configuration>
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/a0ba7fbe/ambari-server/src/test/python/stacks/2.5/SPARK/test_spark_livy.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.5/SPARK/test_spark_livy.py b/ambari-server/src/test/python/stacks/2.5/SPARK/test_spark_livy.py
index b56474a..b9199c7 100644
--- a/ambari-server/src/test/python/stacks/2.5/SPARK/test_spark_livy.py
+++ b/ambari-server/src/test/python/stacks/2.5/SPARK/test_spark_livy.py
@@ -84,6 +84,37 @@ class TestSparkClient(RMFTestCase):
                                   dfs_type = '',
                                   hadoop_conf_dir = '/usr/hdp/current/hadoop-client/conf',
                                   )
+        self.assertResourceCalled('HdfsResource', '/livy-recovery',
+                                  immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,
+                                  security_enabled = False,
+                                  hadoop_bin_dir = '/usr/hdp/current/hadoop-client/bin',
+                                  keytab = UnknownConfigurationMock(),
+                                  default_fs = 'hdfs://c6401.ambari.apache.org:8020',
+                                  hdfs_site = {u'a': u'b'},
+                                  kinit_path_local = '/usr/bin/kinit',
+                                  principal_name = UnknownConfigurationMock(),
+                                  user = 'hdfs',
+                                  owner = 'livy',
+                                  hadoop_conf_dir = '/usr/hdp/current/hadoop-client/conf',
+                                  type = 'directory',
+                                  action = ['create_on_execute'], hdfs_resource_ignore_file='/var/lib/ambari-agent/data/.hdfs_resource_ignore',
+                                  dfs_type = '',
+                                  mode = 0775,
+                                  )
+        self.assertResourceCalled('HdfsResource', None,
+                                  immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,
+                                  security_enabled = False,
+                                  hadoop_bin_dir = '/usr/hdp/current/hadoop-client/bin',
+                                  keytab = UnknownConfigurationMock(),
+                                  default_fs = 'hdfs://c6401.ambari.apache.org:8020',
+                                  hdfs_site = {u'a': u'b'},
+                                  kinit_path_local = '/usr/bin/kinit',
+                                  principal_name = UnknownConfigurationMock(),
+                                  user = 'hdfs',
+                                  action = ['execute'], hdfs_resource_ignore_file='/var/lib/ambari-agent/data/.hdfs_resource_ignore',
+                                  dfs_type = '',
+                                  hadoop_conf_dir = '/usr/hdp/current/hadoop-client/conf',
+                                  )
         self.assertResourceCalled('File', '/usr/hdp/current/livy-server/conf/livy-env.sh',
                                   content = InlineTemplate(self.getConfig()['configurations']['livy-env']['content']),
                                   owner = 'livy',

http://git-wip-us.apache.org/repos/asf/ambari/blob/a0ba7fbe/ambari-server/src/test/python/stacks/2.6/SPARK2/test_spark_livy2.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.6/SPARK2/test_spark_livy2.py b/ambari-server/src/test/python/stacks/2.6/SPARK2/test_spark_livy2.py
index 6244d87..75aec84 100644
--- a/ambari-server/src/test/python/stacks/2.6/SPARK2/test_spark_livy2.py
+++ b/ambari-server/src/test/python/stacks/2.6/SPARK2/test_spark_livy2.py
@@ -84,6 +84,37 @@ class TestSparkClient(RMFTestCase):
                                   dfs_type = '',
                                   hadoop_conf_dir = '/usr/hdp/current/hadoop-client/conf',
                                   )
+        self.assertResourceCalled('HdfsResource', '/livy2-recovery',
+                                  immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,
+                                  security_enabled = False,
+                                  hadoop_bin_dir = '/usr/hdp/current/hadoop-client/bin',
+                                  keytab = UnknownConfigurationMock(),
+                                  default_fs = 'hdfs://c6401.ambari.apache.org:8020',
+                                  hdfs_site = {u'a': u'b'},
+                                  kinit_path_local = '/usr/bin/kinit',
+                                  principal_name = UnknownConfigurationMock(),
+                                  user = 'hdfs',
+                                  owner = 'livy',
+                                  hadoop_conf_dir = '/usr/hdp/current/hadoop-client/conf',
+                                  type = 'directory',
+                                  action = ['create_on_execute'], hdfs_resource_ignore_file='/var/lib/ambari-agent/data/.hdfs_resource_ignore',
+                                  dfs_type = '',
+                                  mode = 0775,
+                                  )
+        self.assertResourceCalled('HdfsResource', None,
+                                  immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,
+                                  security_enabled = False,
+                                  hadoop_bin_dir = '/usr/hdp/current/hadoop-client/bin',
+                                  keytab = UnknownConfigurationMock(),
+                                  default_fs = 'hdfs://c6401.ambari.apache.org:8020',
+                                  hdfs_site = {u'a': u'b'},
+                                  kinit_path_local = '/usr/bin/kinit',
+                                  principal_name = UnknownConfigurationMock(),
+                                  user = 'hdfs',
+                                  action = ['execute'], hdfs_resource_ignore_file='/var/lib/ambari-agent/data/.hdfs_resource_ignore',
+                                  dfs_type = '',
+                                  hadoop_conf_dir = '/usr/hdp/current/hadoop-client/conf',
+                                  )
         self.assertResourceCalled('File', '/usr/hdp/current/livy2-server/conf/livy-env.sh',
                                   content = InlineTemplate(self.getConfig()['configurations']['livy2-env']['content']),
                                   owner = 'livy',


[22/50] [abbrv] ambari git commit: AMBARI-19452 : Metrics of flume shows same values for all channels, sinks or sources in host. (wangjianfei via avijayan)

Posted by nc...@apache.org.
AMBARI-19452 : Metrics of flume shows same values for all channels,sinks or sources in host. (wangjianfei via avijayan)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 3a9519279e3f3b9ba113fb1bc1d3241e6bd9f2a8
Parents: 5d695d8
Author: Aravindan Vijayan <av...@hortonworks.com>
Authored: Sun Feb 12 14:23:54 2017 -0800
Committer: Aravindan Vijayan <av...@hortonworks.com>
Committed: Sun Feb 12 14:23:54 2017 -0800

----------------------------------------------------------------------
 .../controller/metrics/timeline/AMSPropertyProvider.java     | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/3a951927/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
index f194f8e..759f595 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
@@ -441,6 +441,14 @@ public abstract class AMSPropertyProvider extends MetricsPropertyProvider {
                   } else {
                     propertyId = substituteArgument(propertyId, "$1", metric.getInstanceId());
                   }
+                }else {
+                  if(metric.getInstanceId() != null){
+                    //instanceId "CHANNEL.ch1"
+                    String instanceId = metric.getInstanceId();
+                    instanceId = instanceId.matches("^\\w+\\..+$") ? instanceId.split("\\.")[1]:"";
+                    //propertyId "metrics/flume/flume/CHANNEL/ch1/[ChannelCapacity]"
+                    if(!propertyId.contains(instanceId)) continue;
+                  }
                 }
                 Object value = getValue(metric, temporalInfo);
                 if (value != null && !containsArguments(propertyId)) {