Return-Path: X-Original-To: apmail-spark-commits-archive@minotaur.apache.org Delivered-To: apmail-spark-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A032C18248 for ; Fri, 29 May 2015 20:04:00 +0000 (UTC) Received: (qmail 70017 invoked by uid 500); 29 May 2015 20:04:00 -0000 Delivered-To: apmail-spark-commits-archive@spark.apache.org Received: (qmail 69990 invoked by uid 500); 29 May 2015 20:04:00 -0000 Mailing-List: contact commits-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@spark.apache.org Received: (qmail 69981 invoked by uid 99); 29 May 2015 20:04:00 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 May 2015 20:04:00 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id DF794E0329; Fri, 29 May 2015 20:03:59 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: pwendell@apache.org To: commits@spark.apache.org Message-Id: <80453825d79142279c5ce5d73421f156@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: spark git commit: Revert "[SQL] [TEST] [MINOR] Uses a temporary log4j.properties in HiveThriftServer2Test to ensure expected logging behavior" Date: Fri, 29 May 2015 20:03:59 +0000 (UTC) Repository: spark Updated Branches: refs/heads/branch-1.4 c68abaa34 -> 18811ca20 Revert "[SQL] [TEST] [MINOR] Uses a temporary log4j.properties in HiveThriftServer2Test to ensure expected logging behavior" This reverts commit 645e611644be3f62ef07e4ca7628bf298349d9a6. Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/18811ca2 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/18811ca2 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/18811ca2 Branch: refs/heads/branch-1.4 Commit: 18811ca20bc3c9c32b6bfbefb3d20092b7889ca8 Parents: c68abaa Author: Patrick Wendell Authored: Fri May 29 13:03:52 2015 -0700 Committer: Patrick Wendell Committed: Fri May 29 13:03:52 2015 -0700 ---------------------------------------------------------------------- .../thriftserver/HiveThriftServer2Suites.scala | 31 ++++---------------- 1 file changed, 6 insertions(+), 25 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/18811ca2/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suites.scala ---------------------------------------------------------------------- diff --git a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suites.scala b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suites.scala index 610939c..1fadea9 100644 --- a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suites.scala +++ b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suites.scala @@ -19,8 +19,6 @@ package org.apache.spark.sql.hive.thriftserver import java.io.File import java.net.URL -import java.nio.charset.StandardCharsets -import java.nio.file.{Files, Paths} import java.sql.{Date, DriverManager, Statement} import scala.collection.mutable.ArrayBuffer @@ -56,7 +54,7 @@ class HiveThriftBinaryServerSuite extends HiveThriftJdbcTest { override def mode: ServerMode.Value = ServerMode.binary private def withCLIServiceClient(f: ThriftCLIServiceClient => Unit): Unit = { - // Transport creation logic below mimics HiveConnection.createBinaryTransport + // Transport creation logics below mimics HiveConnection.createBinaryTransport val rawTransport = new TSocket("localhost", serverPort) val user = System.getProperty("user.name") val transport = PlainSaslHelper.getPlainTransport(user, "anonymous", rawTransport) @@ -393,10 +391,10 @@ abstract class HiveThriftJdbcTest extends HiveThriftServer2Test { val statements = connections.map(_.createStatement()) try { - statements.zip(fs).foreach { case (s, f) => f(s) } + statements.zip(fs).map { case (s, f) => f(s) } } finally { - statements.foreach(_.close()) - connections.foreach(_.close()) + statements.map(_.close()) + connections.map(_.close()) } } @@ -435,32 +433,15 @@ abstract class HiveThriftServer2Test extends FunSuite with BeforeAndAfterAll wit ConfVars.HIVE_SERVER2_THRIFT_HTTP_PORT } - val driverClassPath = { - // Writes a temporary log4j.properties and prepend it to driver classpath, so that it - // overrides all other potential log4j configurations contained in other dependency jar files. - val tempLog4jConf = Utils.createTempDir().getCanonicalPath - - Files.write( - Paths.get(s"$tempLog4jConf/log4j.properties"), - """log4j.rootCategory=INFO, console - |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{1}: %m%n - """.stripMargin.getBytes(StandardCharsets.UTF_8)) - - tempLog4jConf + File.pathSeparator + sys.props("java.class.path") - } - s"""$startScript | --master local + | --hiveconf hive.root.logger=INFO,console | --hiveconf ${ConfVars.METASTORECONNECTURLKEY}=$metastoreJdbcUri | --hiveconf ${ConfVars.METASTOREWAREHOUSE}=$warehousePath | --hiveconf ${ConfVars.HIVE_SERVER2_THRIFT_BIND_HOST}=localhost | --hiveconf ${ConfVars.HIVE_SERVER2_TRANSPORT_MODE}=$mode | --hiveconf $portConf=$port - | --driver-class-path $driverClassPath - | --driver-java-options -Dlog4j.debug + | --driver-class-path ${sys.props("java.class.path")} | --conf spark.ui.enabled=false """.stripMargin.split("\\s+").toSeq } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org For additional commands, e-mail: commits-help@spark.apache.org