You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@livy.apache.org by aj...@apache.org on 2018/01/18 00:27:14 UTC

incubator-livy git commit: [LIVY-104][CORE] Update Livy build to Scala 2.11

Repository: incubator-livy
Updated Branches:
  refs/heads/master 85e8fba3c -> 3440857a1


[LIVY-104][CORE] Update Livy build to Scala 2.11

[LIVY-104](https://issues.apache.org/jira/browse/LIVY-104)

Livy currently builds using Scala 2.10 which has been EOL for a couple years. This update switches the build to use 2.11 instead.
This does not drop Livy support for Scala 2.10, it only updates the version used to build Livy itself.
We are holding off updating to Scala 2.12 since Livy still supports Spark 1.6, which doesn't support 2.12 and such an update would break UTs for 1.6, any update to 2.12 will have to wait until Spark 1.6 support is dropped.

This update also addresses any new deprecation warning raised in the update as well as updates various ITs to pass.

This locally passes both UTs and ITs build withe all supported versions of Spark.

Author: Alex Bozarth <aj...@us.ibm.com>

Closes #72 from ajbozarth/scala211.


Project: http://git-wip-us.apache.org/repos/asf/incubator-livy/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-livy/commit/3440857a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-livy/tree/3440857a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-livy/diff/3440857a

Branch: refs/heads/master
Commit: 3440857a1f844f607215475d353e749b62819cac
Parents: 85e8fba
Author: Alex Bozarth <aj...@us.ibm.com>
Authored: Wed Jan 17 16:27:04 2018 -0800
Committer: Alex Bozarth <aj...@us.ibm.com>
Committed: Wed Jan 17 16:27:04 2018 -0800

----------------------------------------------------------------------
 .../apache/livy/test/framework/BaseIntegrationTestSuite.scala | 2 +-
 .../src/test/scala/org/apache/livy/test/InteractiveIT.scala   | 7 +++++--
 .../src/test/scala/org/apache/livy/test/JobApiIT.scala        | 4 ++--
 pom.xml                                                       | 4 ++--
 .../src/main/scala/org/apache/livy/server/JsonServlet.scala   | 2 +-
 5 files changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-livy/blob/3440857a/integration-test/src/main/scala/org/apache/livy/test/framework/BaseIntegrationTestSuite.scala
----------------------------------------------------------------------
diff --git a/integration-test/src/main/scala/org/apache/livy/test/framework/BaseIntegrationTestSuite.scala b/integration-test/src/main/scala/org/apache/livy/test/framework/BaseIntegrationTestSuite.scala
index 19a423a..81be860 100644
--- a/integration-test/src/main/scala/org/apache/livy/test/framework/BaseIntegrationTestSuite.scala
+++ b/integration-test/src/main/scala/org/apache/livy/test/framework/BaseIntegrationTestSuite.scala
@@ -54,7 +54,7 @@ abstract class BaseIntegrationTestSuite extends FunSuite with Matchers with Befo
   }
 
   protected def restartLivy(): Unit = {
-    val f = future {
+    val f = Future {
       cluster.stopLivy()
       cluster.runLivy()
     }

http://git-wip-us.apache.org/repos/asf/incubator-livy/blob/3440857a/integration-test/src/test/scala/org/apache/livy/test/InteractiveIT.scala
----------------------------------------------------------------------
diff --git a/integration-test/src/test/scala/org/apache/livy/test/InteractiveIT.scala b/integration-test/src/test/scala/org/apache/livy/test/InteractiveIT.scala
index 3e4c3fe..3777fdd 100644
--- a/integration-test/src/test/scala/org/apache/livy/test/InteractiveIT.scala
+++ b/integration-test/src/test/scala/org/apache/livy/test/InteractiveIT.scala
@@ -34,6 +34,7 @@ class InteractiveIT extends BaseIntegrationTestSuite {
   test("basic interactive session") {
     withNewSession(Spark) { s =>
       s.run("val sparkVersion = sc.version").result().left.foreach(info(_))
+      s.run("val scalaVersion = util.Properties.versionString").result().left.foreach(info(_))
       s.run("1+1").verifyResult("res0: Int = 2\n")
       s.run("""sc.getConf.get("spark.executor.instances")""").verifyResult("res1: String = 1\n")
       s.run("val sql = new org.apache.spark.sql.SQLContext(sc)").verifyResult(
@@ -74,8 +75,10 @@ class InteractiveIT extends BaseIntegrationTestSuite {
       // This is important because if YARN app state is killed, Spark history is not archived.
       val appId = s.appId()
       s.stop()
-      val appReport = cluster.yarnClient.getApplicationReport(appId)
-      appReport.getYarnApplicationState() shouldEqual YarnApplicationState.FINISHED
+      eventually(timeout(5 seconds), interval(1 seconds)) {
+        val appReport = cluster.yarnClient.getApplicationReport(appId)
+        appReport.getYarnApplicationState() shouldEqual YarnApplicationState.FINISHED
+      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-livy/blob/3440857a/integration-test/src/test/scala/org/apache/livy/test/JobApiIT.scala
----------------------------------------------------------------------
diff --git a/integration-test/src/test/scala/org/apache/livy/test/JobApiIT.scala b/integration-test/src/test/scala/org/apache/livy/test/JobApiIT.scala
index fdad6df..b10e8f6 100644
--- a/integration-test/src/test/scala/org/apache/livy/test/JobApiIT.scala
+++ b/integration-test/src/test/scala/org/apache/livy/test/JobApiIT.scala
@@ -168,10 +168,10 @@ class JobApiIT extends BaseIntegrationTestSuite with BeforeAndAfterAll with Logg
 
     val jobs = Seq(
       new ScalaEcho("abcde"),
-      new ScalaEcho(Seq(1, 2, 3, 4)),
+      new ScalaEcho(IndexedSeq(1, 2, 3, 4)),
       new ScalaEcho(Map(1 -> 2, 3 -> 4)),
       new ScalaEcho(ValueHolder("abcde")),
-      new ScalaEcho(ValueHolder(Seq(1, 2, 3, 4))),
+      new ScalaEcho(ValueHolder(IndexedSeq(1, 2, 3, 4))),
       new ScalaEcho(Some("abcde"))
     )
 

http://git-wip-us.apache.org/repos/asf/incubator-livy/blob/3440857a/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 5cde78e..127a3c0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -98,8 +98,8 @@
     <py4j.version>0.9</py4j.version>
     <scala-2.10.version>2.10.4</scala-2.10.version>
     <scala-2.11.version>2.11.8</scala-2.11.version>
-    <scala.binary.version>2.10</scala.binary.version>
-    <scala.version>${scala-2.10.version}</scala.version>
+    <scala.binary.version>2.11</scala.binary.version>
+    <scala.version>${scala-2.11.version}</scala.version>
     <scalatest.version>2.2.4</scalatest.version>
     <scalatra.version>2.3.0</scalatra.version>
     <java.version>1.7</java.version>

http://git-wip-us.apache.org/repos/asf/incubator-livy/blob/3440857a/server/src/main/scala/org/apache/livy/server/JsonServlet.scala
----------------------------------------------------------------------
diff --git a/server/src/main/scala/org/apache/livy/server/JsonServlet.scala b/server/src/main/scala/org/apache/livy/server/JsonServlet.scala
index 666a905..c1db9aa 100644
--- a/server/src/main/scala/org/apache/livy/server/JsonServlet.scala
+++ b/server/src/main/scala/org/apache/livy/server/JsonServlet.scala
@@ -133,7 +133,7 @@ abstract class JsonServlet extends ScalatraServlet with ApiFormats with FutureSu
   }
 
   private def toJson(obj: Any): Any = {
-    if (obj != null && obj != ()) {
+    if (obj != null && obj != (())) {
       mapper.writeValueAsBytes(obj)
     } else {
       null