ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject [13/50] [abbrv] ambari git commit: AMBARI-13677. hive.server2.logging.operation.log.location incorrectly set in ambari.(vbrodetskyi)
Date Wed, 04 Nov 2015 13:36:40 GMT
AMBARI-13677. hive.server2.logging.operation.log.location incorrectly set in ambari.(vbrodetskyi)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 223247120318ce9f0df9ac995d0ba6c5e7974dfa
Parents: a6f9562
Author: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Authored: Mon Nov 2 18:04:10 2015 +0200
Committer: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Committed: Mon Nov 2 18:04:10 2015 +0200

----------------------------------------------------------------------
 .../server/upgrade/UpgradeCatalog213.java       |  54 ++++++---
 .../services/HIVE/configuration/hive-site.xml   |   2 +-
 .../catalog/UpgradeCatalog_1.3_to_2.2.json      |   2 +-
 .../catalog/UpgradeCatalog_2.0_to_2.2.2.json    |   2 +-
 .../catalog/UpgradeCatalog_2.0_to_2.2.4.json    |   2 +-
 .../catalog/UpgradeCatalog_2.0_to_2.2.json      |   4 +-
 .../catalog/UpgradeCatalog_2.1_to_2.2.2.json    |   2 +-
 .../catalog/UpgradeCatalog_2.1_to_2.2.4.json    |   2 +-
 .../catalog/UpgradeCatalog_2.1_to_2.2.json      |   4 +-
 .../catalog/UpgradeCatalog_2.1_to_2.3.json      |   2 +-
 .../server/upgrade/UpgradeCatalog213Test.java   | 116 +++++++++++++------
 .../python/stacks/2.2/configs/hive-upgrade.json |   2 +-
 .../journalnode-upgrade-hdfs-secure.json        |   4 +-
 .../stacks/2.2/configs/journalnode-upgrade.json |   4 +-
 14 files changed, 134 insertions(+), 68 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/22324712/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
index 9503898..34072dc 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
@@ -18,20 +18,11 @@
 
 package org.apache.ambari.server.upgrade;
 
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-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.UUID;
-
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
+import com.google.inject.Inject;
+import com.google.inject.Injector;
+import com.google.inject.persist.Transactional;
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.api.services.AmbariMetaInfo;
 import org.apache.ambari.server.configuration.Configuration;
@@ -69,11 +60,19 @@ import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
-import com.google.inject.Inject;
-import com.google.inject.Injector;
-import com.google.inject.persist.Transactional;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+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.UUID;
 
 /**
  * Upgrade catalog for version 2.1.3.
@@ -87,9 +86,11 @@ public class UpgradeCatalog213 extends AbstractUpgradeCatalog {
   private static final String AMS_ENV = "ams-env";
   private static final String AMS_HBASE_ENV = "ams-hbase-env";
   private static final String HBASE_ENV_CONFIG = "hbase-env";
+  private static final String HIVE_SITE_CONFIG = "hive-site";
   private static final String RANGER_ENV_CONFIG = "ranger-env";
   private static final String ZOOKEEPER_LOG4J_CONFIG = "zookeeper-log4j";
   private static final String NIMBS_MONITOR_FREQ_SECS_PROPERTY = "nimbus.monitor.freq.secs";
+  private static final String HIVE_SERVER2_OPERATION_LOG_LOCATION_PROPERTY = "hive.server2.logging.operation.log.location";
   private static final String HADOOP_ENV_CONFIG = "hadoop-env";
   private static final String CONTENT_PROPERTY = "content";
   private static final String HADOOP_ENV_CONTENT_TO_APPEND = "\n{% if is_datanode_max_locked_memory_set
%}\n" +
@@ -271,6 +272,7 @@ public class UpgradeCatalog213 extends AbstractUpgradeCatalog {
     updateKafkaConfigs();
     updateRangerEnvConfig();
     updateZookeeperLog4j();
+    updateHiveConfig();
   }
 
   /**
@@ -744,6 +746,20 @@ public class UpgradeCatalog213 extends AbstractUpgradeCatalog {
     }
   }
 
+  protected void updateHiveConfig() throws AmbariException {
+    AmbariManagementController ambariManagementController = injector.getInstance(AmbariManagementController.class);
+    for (final Cluster cluster : getCheckedClusterMap(ambariManagementController.getClusters()).values())
{
+      Config hiveSiteConfig = cluster.getDesiredConfigByType(HIVE_SITE_CONFIG);
+      if (hiveSiteConfig != null) {
+        String hiveServer2OperationLogLocation = hiveSiteConfig.getProperties().get(HIVE_SERVER2_OPERATION_LOG_LOCATION_PROPERTY);
+        if (hiveServer2OperationLogLocation != null && hiveServer2OperationLogLocation.equals("${system:java.io.tmpdir}/${system:user.name}/operation_logs"))
{
+          Map<String, String> updates = Collections.singletonMap(HIVE_SERVER2_OPERATION_LOG_LOCATION_PROPERTY,
"/tmp/hive/operation_logs");
+          updateConfigurationPropertiesForCluster(cluster, HIVE_SITE_CONFIG, updates, true,
false);
+        }
+      }
+    }
+  }
+
   protected void updateHbaseEnvConfig() throws AmbariException {
     AmbariManagementController ambariManagementController = injector.getInstance(AmbariManagementController.class);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/22324712/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
index 0efceb6..fa81bf6 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
@@ -1064,7 +1064,7 @@ limitations under the License.
   </property>
   <property>
     <name>hive.server2.logging.operation.log.location</name>
-    <value>${system:java.io.tmpdir}/${system:user.name}/operation_logs</value>
+    <value>/tmp/hive/operation_logs</value>
     <description>Top level directory where operation logs are stored if logging functionality
is enabled</description>
   </property>
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/22324712/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_1.3_to_2.2.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_1.3_to_2.2.json
b/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_1.3_to_2.2.json
index 102271e..d2d059e 100644
--- a/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_1.3_to_2.2.json
+++ b/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_1.3_to_2.2.json
@@ -592,7 +592,7 @@
           "hive.orc.compute.splits.num.threads": "10",
           "hive.tez.smb.number.waves": "0.5",
           "hive.convert.join.bucket.mapjoin.tez": "false",
-          "hive.server2.logging.operation.log.location": "${system:java.io.tmpdir}/${system:user.name}/operation_logs",
+          "hive.server2.logging.operation.log.location": "/tmp/hive/operation_logs",
           "hive.tez.input.format": "org.apache.hadoop.hive.ql.io.HiveInputFormat",
           "hive.exec.orc.default.compress": "ZLIB",
           "hive.support.concurrency": "false",

http://git-wip-us.apache.org/repos/asf/ambari/blob/22324712/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.0_to_2.2.2.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.0_to_2.2.2.json
b/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.0_to_2.2.2.json
index 0d3e892..bc167ba 100644
--- a/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.0_to_2.2.2.json
+++ b/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.0_to_2.2.2.json
@@ -183,7 +183,7 @@
                     "hive.server2.authentication.spnego.keytab": "HTTP/_HOST@EXAMPLE.COM",
                     "hive.server2.authentication.spnego.principal": "/etc/security/keytabs/spnego.service.keytab",
                     "hive.server2.logging.operation.enabled": "true",
-                    "hive.server2.logging.operation.log.location": "${system:java.io.tmpdir}/${system:user.name}/operation_logs",
+                    "hive.server2.logging.operation.log.location": "/tmp/hive/operation_logs",
                     "hive.server2.table.type.mapping": "CLASSIC",
                     "hive.server2.tez.default.queues": "default",
                     "hive.server2.tez.initialize.default.sessions": "false",

http://git-wip-us.apache.org/repos/asf/ambari/blob/22324712/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.0_to_2.2.4.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.0_to_2.2.4.json
b/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.0_to_2.2.4.json
index ad360b6..a2c1ae1 100755
--- a/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.0_to_2.2.4.json
+++ b/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.0_to_2.2.4.json
@@ -216,7 +216,7 @@
                     "hive.server2.authentication.spnego.keytab": "HTTP/_HOST@EXAMPLE.COM",
                     "hive.server2.authentication.spnego.principal": "/etc/security/keytabs/spnego.service.keytab",
                     "hive.server2.logging.operation.enabled": "true",
-                    "hive.server2.logging.operation.log.location": "${system:java.io.tmpdir}/${system:user.name}/operation_logs",
+                    "hive.server2.logging.operation.log.location": "/tmp/hive/operation_logs",
                     "hive.server2.support.dynamic.service.discovery": "true",
                     "hive.server2.table.type.mapping": "CLASSIC",
                     "hive.server2.tez.default.queues": "default",

http://git-wip-us.apache.org/repos/asf/ambari/blob/22324712/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.0_to_2.2.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.0_to_2.2.json
b/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.0_to_2.2.json
index 7ecbcfd..798e276 100644
--- a/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.0_to_2.2.json
+++ b/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.0_to_2.2.json
@@ -208,7 +208,7 @@
           "hive.server2.authentication.spnego.keytab": "HTTP/_HOST@EXAMPLE.COM",
           "hive.server2.authentication.spnego.principal": "/etc/security/keytabs/spnego.service.keytab",
           "hive.server2.logging.operation.enabled": "true",
-          "hive.server2.logging.operation.log.location": "${system:java.io.tmpdir}/${system:user.name}/operation_logs",
+          "hive.server2.logging.operation.log.location": "/tmp/hive/operation_logs",
           "hive.server2.table.type.mapping": "CLASSIC",
           "hive.server2.tez.default.queues": "default",
           "hive.server2.tez.sessions.per.default.queue": "1",
@@ -272,4 +272,4 @@
       }
     }
   ]
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/22324712/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.2.2.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.2.2.json
b/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.2.2.json
index de28827..50c63de 100644
--- a/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.2.2.json
+++ b/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.2.2.json
@@ -174,7 +174,7 @@
           "hive.security.metastore.authorization.manager": "org.apache.hadoop.hive.ql.security.authorization.StorageBasedAuthorizationProvider,org.apache.hadoop.hive.ql.security.authorization.MetaStoreAuthzAPIAuthorizerEmbedOnly",

           "hive.server2.allow.user.substitution": "true",
           "hive.server2.logging.operation.enabled": "true", 
-          "hive.server2.logging.operation.log.location": "${system:java.io.tmpdir}/${system:user.name}/operation_logs",
+          "hive.server2.logging.operation.log.location": "/tmp/hive/operation_logs",
           "hive.server2.table.type.mapping": "CLASSIC",
           "hive.server2.thrift.http.path": "cliservice", 
           "hive.server2.thrift.http.port": "10001", 

http://git-wip-us.apache.org/repos/asf/ambari/blob/22324712/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.2.4.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.2.4.json
b/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.2.4.json
index 9a4d3e2..6dace0f 100644
--- a/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.2.4.json
+++ b/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.2.4.json
@@ -196,7 +196,7 @@
 		  "hive.security.metastore.authorization.manager": "org.apache.hadoop.hive.ql.security.authorization.StorageBasedAuthorizationProvider,org.apache.hadoop.hive.ql.security.authorization.MetaStoreAuthzAPIAuthorizerEmbedOnly",
 		  "hive.server2.allow.user.substitution": "true",
 		  "hive.server2.logging.operation.enabled": "true",
-		  "hive.server2.logging.operation.log.location": "${system:java.io.tmpdir}/${system:user.name}/operation_logs",
+		  "hive.server2.logging.operation.log.location": "/tmp/hive/operation_logs",
 		  "hive.server2.support.dynamic.service.discovery": "true",
 		  "hive.server2.table.type.mapping": "CLASSIC",
 		  "hive.server2.thrift.http.path": "cliservice",

http://git-wip-us.apache.org/repos/asf/ambari/blob/22324712/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.2.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.2.json
b/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.2.json
index bf9423a..207bc58 100644
--- a/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.2.json
+++ b/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.2.json
@@ -170,7 +170,7 @@
           "hive.security.metastore.authorization.auth.reads": "true",
           "hive.server2.allow.user.substitution": "true",
           "hive.server2.logging.operation.enabled": "true",
-          "hive.server2.logging.operation.log.location": "${system:java.io.tmpdir}/${system:user.name}/operation_logs",
+          "hive.server2.logging.operation.log.location": "/tmp/hive/operation_logs",
           "hive.server2.table.type.mapping": "CLASSIC",
           "hive.server2.thrift.http.path": "cliservice",
           "hive.server2.thrift.http.port": "10001",
@@ -289,4 +289,4 @@
       }
     }
   ]
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/22324712/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.3.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.3.json
b/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.3.json
index 486a856..70f1ffc 100644
--- a/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.3.json
+++ b/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.3.json
@@ -245,7 +245,7 @@
           "hive.security.metastore.authorization.auth.reads": "true",
           "hive.server2.allow.user.substitution": "true",
           "hive.server2.logging.operation.enabled": "true",
-          "hive.server2.logging.operation.log.location": "${system:java.io.tmpdir}/${system:user.name}/operation_logs",
+          "hive.server2.logging.operation.log.location": "/tmp/hive/operation_logs",
           "hive.server2.table.type.mapping": "CLASSIC",
           "hive.server2.thrift.http.path": "cliservice",
           "hive.server2.thrift.http.port": "10001",

http://git-wip-us.apache.org/repos/asf/ambari/blob/22324712/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog213Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog213Test.java
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog213Test.java
index a68d4fd..59d3f1a 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog213Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog213Test.java
@@ -18,31 +18,13 @@
 
 package org.apache.ambari.server.upgrade;
 
-import static org.easymock.EasyMock.anyLong;
-import static org.easymock.EasyMock.anyObject;
-import static org.easymock.EasyMock.capture;
-import static org.easymock.EasyMock.createMockBuilder;
-import static org.easymock.EasyMock.createNiceMock;
-import static org.easymock.EasyMock.createStrictMock;
-import static org.easymock.EasyMock.eq;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.expectLastCall;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.reset;
-import static org.easymock.EasyMock.verify;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.persistence.EntityManager;
-
+import com.google.inject.AbstractModule;
+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 com.google.inject.persist.PersistService;
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.api.services.AmbariMetaInfo;
 import org.apache.ambari.server.configuration.Configuration;
@@ -82,14 +64,29 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-import com.google.inject.AbstractModule;
-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 com.google.inject.persist.PersistService;
-import java.lang.reflect.Field;
+import javax.persistence.EntityManager;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static org.easymock.EasyMock.anyLong;
+import static org.easymock.EasyMock.anyObject;
+import static org.easymock.EasyMock.capture;
+import static org.easymock.EasyMock.createMockBuilder;
+import static org.easymock.EasyMock.createNiceMock;
+import static org.easymock.EasyMock.createStrictMock;
+import static org.easymock.EasyMock.eq;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.expectLastCall;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.reset;
+import static org.easymock.EasyMock.verify;
 
 /**
  * {@link org.apache.ambari.server.upgrade.UpgradeCatalog213} unit tests.
@@ -202,6 +199,7 @@ public class UpgradeCatalog213Test {
     Method updateHadoopEnvConfig = UpgradeCatalog213.class.getDeclaredMethod("updateHadoopEnv");
     Method updateAlertDefinitions = UpgradeCatalog213.class.getDeclaredMethod("updateAlertDefinitions");
     Method updateRangerEnvConfig = UpgradeCatalog213.class.getDeclaredMethod("updateRangerEnvConfig");
+    Method updateHiveConfig = UpgradeCatalog213.class.getDeclaredMethod("updateHiveConfig");
 
     UpgradeCatalog213 upgradeCatalog213 = createMockBuilder(UpgradeCatalog213.class)
       .addMockedMethod(updateAMSConfigs)
@@ -214,6 +212,7 @@ public class UpgradeCatalog213Test {
       .addMockedMethod(updateZookeeperLog4j)
       .addMockedMethod(updateHadoopEnvConfig)
       .addMockedMethod(updateRangerEnvConfig)
+      .addMockedMethod(updateHiveConfig)
       .createMock();
 
     upgradeCatalog213.updateHbaseEnvConfig();
@@ -236,6 +235,8 @@ public class UpgradeCatalog213Test {
     expectLastCall().once();
     upgradeCatalog213.updateRangerEnvConfig();
     expectLastCall().once();
+    upgradeCatalog213.updateHiveConfig();
+    expectLastCall().once();
 
     replay(upgradeCatalog213);
 
@@ -909,4 +910,53 @@ public class UpgradeCatalog213Test {
 
   }
 
+  @Test
+  public void testUpdateHiveConfig() throws Exception {
+    EasyMockSupport easyMockSupport = new EasyMockSupport();
+    final AmbariManagementController mockAmbariManagementController = easyMockSupport.createNiceMock(AmbariManagementController.class);
+    final Clusters mockClusters = easyMockSupport.createStrictMock(Clusters.class);
+    final Cluster mockClusterExpected = easyMockSupport.createNiceMock(Cluster.class);
+    final Map<String, String> propertiesHiveSite = new HashMap<String, String>()
{{
+      put("hive.server2.logging.operation.log.location", "${system:java.io.tmpdir}/${system:user.name}/operation_logs");
+    }};
+    final Map<String, String> propertiesHiveSiteExpected = new HashMap<String, String>()
{{
+      put("hive.server2.logging.operation.log.location", "/tmp/hive/operation_logs");
+    }};
+    final Config hiveSiteConf = easyMockSupport.createNiceMock(Config.class);
+    final Injector mockInjector = Guice.createInjector(new AbstractModule() {
+      @Override
+      protected void configure() {
+        bind(AmbariManagementController.class).toInstance(mockAmbariManagementController);
+        bind(Clusters.class).toInstance(mockClusters);
+        bind(EntityManager.class).toInstance(entityManager);
+
+        bind(DBAccessor.class).toInstance(createNiceMock(DBAccessor.class));
+        bind(OsFamily.class).toInstance(createNiceMock(OsFamily.class));
+      }
+    });
+    expect(mockAmbariManagementController.getClusters()).andReturn(mockClusters).once();
+    expect(mockClusters.getClusters()).andReturn(new HashMap<String, Cluster>() {{
+      put("normal", mockClusterExpected);
+    }}).atLeastOnce();
+    expect(mockClusterExpected.getDesiredConfigByType("hive-site")).andReturn(hiveSiteConf).atLeastOnce();
+
+    expect(hiveSiteConf.getProperties()).andReturn(propertiesHiveSite).once();
+
+    UpgradeCatalog213 upgradeCatalog213 = createMockBuilder(UpgradeCatalog213.class)
+            .withConstructor(Injector.class)
+            .withArgs(mockInjector)
+            .addMockedMethod("updateConfigurationPropertiesForCluster", Cluster.class, String.class,
+                    Map.class, boolean.class, boolean.class)
+            .createMock();
+    upgradeCatalog213.updateConfigurationPropertiesForCluster(mockClusterExpected,
+            "hive-site", propertiesHiveSiteExpected, true, false);
+    expectLastCall().once();
+
+    easyMockSupport.replayAll();
+    replay(upgradeCatalog213);
+    upgradeCatalog213.updateHiveConfig();
+    easyMockSupport.verifyAll();
+
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/22324712/ambari-server/src/test/python/stacks/2.2/configs/hive-upgrade.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.2/configs/hive-upgrade.json b/ambari-server/src/test/python/stacks/2.2/configs/hive-upgrade.json
index 99d0e83..9e597ef 100644
--- a/ambari-server/src/test/python/stacks/2.2/configs/hive-upgrade.json
+++ b/ambari-server/src/test/python/stacks/2.2/configs/hive-upgrade.json
@@ -282,7 +282,7 @@
             "hive.orc.compute.splits.num.threads": "10",
             "hive.tez.smb.number.waves": "0.5",
             "hive.convert.join.bucket.mapjoin.tez": "false",
-            "hive.server2.logging.operation.log.location": "${system:java.io.tmpdir}/${system:user.name}/operation_logs",
+            "hive.server2.logging.operation.log.location": "/tmp/hive/operation_logs",
             "hive.tez.input.format": "org.apache.hadoop.hive.ql.io.HiveInputFormat",
             "hive.exec.failure.hooks": "org.apache.hadoop.hive.ql.hooks.ATSHook",
             "hive.support.concurrency": "false",

http://git-wip-us.apache.org/repos/asf/ambari/blob/22324712/ambari-server/src/test/python/stacks/2.2/configs/journalnode-upgrade-hdfs-secure.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.2/configs/journalnode-upgrade-hdfs-secure.json
b/ambari-server/src/test/python/stacks/2.2/configs/journalnode-upgrade-hdfs-secure.json
index 8734556..494069c 100644
--- a/ambari-server/src/test/python/stacks/2.2/configs/journalnode-upgrade-hdfs-secure.json
+++ b/ambari-server/src/test/python/stacks/2.2/configs/journalnode-upgrade-hdfs-secure.json
@@ -540,7 +540,7 @@
             "hive.orc.compute.splits.num.threads": "10", 
             "hive.tez.smb.number.waves": "0.5", 
             "hive.convert.join.bucket.mapjoin.tez": "false", 
-            "hive.server2.logging.operation.log.location": "${system:java.io.tmpdir}/${system:user.name}/operation_logs",

+            "hive.server2.logging.operation.log.location": "/tmp/hive/operation_logs",
             "hive.tez.input.format": "org.apache.hadoop.hive.ql.io.HiveInputFormat", 
             "hive.exec.failure.hooks": "org.apache.hadoop.hive.ql.hooks.ATSHook", 
             "hive.support.concurrency": "false", 
@@ -1264,4 +1264,4 @@
             "c6406.ambari.apache.org"
         ]
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/22324712/ambari-server/src/test/python/stacks/2.2/configs/journalnode-upgrade.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.2/configs/journalnode-upgrade.json b/ambari-server/src/test/python/stacks/2.2/configs/journalnode-upgrade.json
index 8d9fb7b..231c395 100644
--- a/ambari-server/src/test/python/stacks/2.2/configs/journalnode-upgrade.json
+++ b/ambari-server/src/test/python/stacks/2.2/configs/journalnode-upgrade.json
@@ -540,7 +540,7 @@
             "hive.orc.compute.splits.num.threads": "10", 
             "hive.tez.smb.number.waves": "0.5", 
             "hive.convert.join.bucket.mapjoin.tez": "false", 
-            "hive.server2.logging.operation.log.location": "${system:java.io.tmpdir}/${system:user.name}/operation_logs",

+            "hive.server2.logging.operation.log.location": "/tmp/hive/operation_logs",
             "hive.tez.input.format": "org.apache.hadoop.hive.ql.io.HiveInputFormat", 
             "hive.exec.failure.hooks": "org.apache.hadoop.hive.ql.hooks.ATSHook", 
             "hive.support.concurrency": "false", 
@@ -1262,4 +1262,4 @@
             "c6406.ambari.apache.org"
         ]
     }
-}
\ No newline at end of file
+}


Mime
View raw message