浏览代码

[livy] Move spark classes out of livy-server into livy-spark

Erick Tryzelaar 10 年之前
父节点
当前提交
65b3acb
共有 21 个文件被更改,包括 206 次插入45 次删除
  1. 6 0
      apps/spark/java/livy-server/pom.xml
  2. 4 2
      apps/spark/java/livy-server/src/main/scala/com/cloudera/hue/livy/server/Main.scala
  3. 1 0
      apps/spark/java/livy-server/src/test/scala/com/cloudera/hue/livy/server/batch/BatchServletSpec.scala
  4. 4 3
      apps/spark/java/livy-server/src/test/scala/com/cloudera/hue/livy/server/interactive/InteractiveSessionServletSpec.scala
  5. 145 0
      apps/spark/java/livy-spark/pom.xml
  6. 1 1
      apps/spark/java/livy-spark/src/main/scala/com/cloudera/hue/livy/spark/batch/BatchSessionFactory.scala
  7. 6 5
      apps/spark/java/livy-spark/src/main/scala/com/cloudera/hue/livy/spark/batch/BatchSessionProcess.scala
  8. 1 3
      apps/spark/java/livy-spark/src/main/scala/com/cloudera/hue/livy/spark/batch/BatchSessionProcessFactory.scala
  9. 5 5
      apps/spark/java/livy-spark/src/main/scala/com/cloudera/hue/livy/spark/batch/BatchSessionYarn.scala
  10. 1 1
      apps/spark/java/livy-spark/src/main/scala/com/cloudera/hue/livy/spark/batch/BatchSessionYarnFactory.scala
  11. 1 1
      apps/spark/java/livy-spark/src/main/scala/com/cloudera/hue/livy/spark/batch/CreateBatchRequest.scala
  12. 1 1
      apps/spark/java/livy-spark/src/main/scala/com/cloudera/hue/livy/spark/interactive/CreateInteractiveRequest.scala
  13. 2 4
      apps/spark/java/livy-spark/src/main/scala/com/cloudera/hue/livy/spark/interactive/InteractiveSessionFactory.scala
  14. 5 3
      apps/spark/java/livy-spark/src/main/scala/com/cloudera/hue/livy/spark/interactive/InteractiveSessionProcess.scala
  15. 4 3
      apps/spark/java/livy-spark/src/main/scala/com/cloudera/hue/livy/spark/interactive/InteractiveSessionProcessFactory.scala
  16. 1 2
      apps/spark/java/livy-spark/src/main/scala/com/cloudera/hue/livy/spark/interactive/InteractiveSessionYarn.scala
  17. 2 2
      apps/spark/java/livy-spark/src/main/scala/com/cloudera/hue/livy/spark/interactive/InteractiveSessionYarnFactory.scala
  18. 5 4
      apps/spark/java/livy-spark/src/main/scala/com/cloudera/hue/livy/spark/interactive/InteractiveWebSession.scala
  19. 2 1
      apps/spark/java/livy-spark/src/test/scala/com/cloudera/hue/livy/spark/batch/BatchProcessSpec.scala
  20. 6 2
      apps/spark/java/livy-spark/src/test/scala/com/cloudera/hue/livy/spark/interactive/InteractiveSessionProcessSpec.scala
  21. 3 2
      apps/spark/java/pom.xml

+ 6 - 0
apps/spark/java/livy-server/pom.xml

@@ -47,6 +47,12 @@
             <scope>test</scope>
         </dependency>
 
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>livy-spark_${scala.binary.version}</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
         <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>livy-yarn_${scala.binary.version}</artifactId>

+ 4 - 2
apps/spark/java/livy-server/src/main/scala/com/cloudera/hue/livy/server/Main.scala

@@ -22,10 +22,12 @@ import java.io.{File, IOException}
 import javax.servlet.ServletContext
 
 import com.cloudera.hue.livy._
-import com.cloudera.hue.livy.server.batch._
-import com.cloudera.hue.livy.server.interactive._
+import com.cloudera.hue.livy.server.batch.BatchSessionServlet
+import com.cloudera.hue.livy.server.interactive.InteractiveSessionServlet
 import com.cloudera.hue.livy.sessions.batch.BatchSession
 import com.cloudera.hue.livy.sessions.interactive.InteractiveSession
+import com.cloudera.hue.livy.spark.batch.{BatchSessionProcessFactory, BatchSessionYarnFactory}
+import com.cloudera.hue.livy.spark.interactive.{InteractiveSessionYarnFactory, InteractiveSessionProcessFactory}
 import org.scalatra._
 import org.scalatra.metrics.MetricsBootstrap
 import org.scalatra.metrics.MetricsSupportExtensions._

+ 1 - 0
apps/spark/java/livy-server/src/test/scala/com/cloudera/hue/livy/server/batch/BatchServletSpec.scala

@@ -24,6 +24,7 @@ import java.util.concurrent.TimeUnit
 
 import com.cloudera.hue.livy.server.SessionManager
 import com.cloudera.hue.livy.sessions.SessionState
+import com.cloudera.hue.livy.spark.batch.{BatchSessionProcessFactory, CreateBatchRequest}
 import com.cloudera.hue.livy.{LivyConf, Utils}
 import org.json4s.JsonAST.{JArray, JInt, JObject, JString}
 import org.json4s.jackson.JsonMethods._

+ 4 - 3
apps/spark/java/livy-server/src/test/scala/com/cloudera/hue/livy/server/interactive/InteractiveSessionServletSpec.scala

@@ -25,11 +25,12 @@ import com.cloudera.hue.livy.LivyConf
 import com.cloudera.hue.livy.msgs.ExecuteRequest
 import com.cloudera.hue.livy.server.SessionManager
 import com.cloudera.hue.livy.sessions._
-import com.cloudera.hue.livy.sessions.interactive.{Statement, InteractiveSession}
-import org.json4s.{DefaultFormats, Formats}
-import org.json4s.JsonAST.{JInt, JArray, JObject, JString}
+import com.cloudera.hue.livy.sessions.interactive.{InteractiveSession, Statement}
+import com.cloudera.hue.livy.spark.interactive.{CreateInteractiveRequest, InteractiveSessionFactory}
+import org.json4s.JsonAST.{JArray, JInt, JObject, JString}
 import org.json4s.jackson.JsonMethods._
 import org.json4s.jackson.Serialization.write
+import org.json4s.{DefaultFormats, Formats}
 import org.scalatest.FunSpecLike
 import org.scalatra.test.scalatest.ScalatraSuite
 

+ 145 - 0
apps/spark/java/livy-spark/pom.xml

@@ -0,0 +1,145 @@
+<?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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.cloudera.hue.livy</groupId>
+        <artifactId>livy-main</artifactId>
+        <relativePath>../pom.xml</relativePath>
+        <version>0.2.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>livy-spark_2.10</artifactId>
+    <version>0.2.0-SNAPSHOT</version>
+    <packaging>jar</packaging>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>com.cloudera.hue.livy</groupId>
+            <artifactId>livy-core_${scala.binary.version}</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.cloudera.hue.livy</groupId>
+            <artifactId>livy-core_${scala.binary.version}</artifactId>
+            <version>${project.version}</version>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>com.cloudera.hue.livy</groupId>
+            <artifactId>livy-repl_${scala.binary.version}</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>com.cloudera.hue.livy</groupId>
+            <artifactId>livy-yarn_${scala.binary.version}</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.hadoop</groupId>
+            <artifactId>hadoop-client</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.hadoop</groupId>
+            <artifactId>hadoop-yarn-client</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.json4s</groupId>
+            <artifactId>json4s-ast_${scala.binary.version}</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.json4s</groupId>
+            <artifactId>json4s-core_${scala.binary.version}</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.json4s</groupId>
+            <artifactId>json4s-jackson_${scala.binary.version}</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.scala-lang</groupId>
+            <artifactId>scala-library</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.scalatest</groupId>
+            <artifactId>scalatest_${scala.binary.version}</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>net.databinder.dispatch</groupId>
+            <artifactId>dispatch-core_${scala.binary.version}</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>net.databinder.dispatch</groupId>
+            <artifactId>dispatch-json4s-jackson_${scala.binary.version}</artifactId>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <plugins>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+            </plugin>
+
+            <plugin>
+                <groupId>org.scalatest</groupId>
+                <artifactId>scalatest-maven-plugin</artifactId>
+                <version>1.0</version>
+                <configuration>
+                    <systemProperties>
+                        <spark.master>local</spark.master>
+                        <spark.driver.allowMultipleContexts>true</spark.driver.allowMultipleContexts>
+                        <spark.ui.enabled>false</spark.ui.enabled>
+                        <settings.usejavacp.value>true</settings.usejavacp.value>
+                        <livy.repl.jar>../livy-repl/target/livy-repl_${scala.binary.version}-${project.version}.jar</livy.repl.jar>
+                    </systemProperties>
+                </configuration>
+            </plugin>
+
+        </plugins>
+    </build>
+
+</project>
+

+ 1 - 1
apps/spark/java/livy-server/src/main/scala/com/cloudera/hue/livy/server/batch/BatchSessionFactory.scala → apps/spark/java/livy-spark/src/main/scala/com/cloudera/hue/livy/spark/batch/BatchSessionFactory.scala

@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-package com.cloudera.hue.livy.server.batch
+package com.cloudera.hue.livy.spark.batch
 
 import com.cloudera.hue.livy.sessions.SessionFactory
 import com.cloudera.hue.livy.sessions.batch.BatchSession

+ 6 - 5
apps/spark/java/livy-server/src/main/scala/com/cloudera/hue/livy/server/batch/BatchSessionProcess.scala → apps/spark/java/livy-spark/src/main/scala/com/cloudera/hue/livy/spark/batch/BatchSessionProcess.scala

@@ -16,16 +16,17 @@
  * limitations under the License.
  */
 
-package com.cloudera.hue.livy.server.batch
+package com.cloudera.hue.livy.spark.batch
 
 import java.lang.ProcessBuilder.Redirect
-import com.cloudera.hue.livy.sessions._
+
+import com.cloudera.hue.livy.sessions.SessionState
 import com.cloudera.hue.livy.sessions.batch.BatchSession
-import com.cloudera.hue.livy.spark.SparkSubmitProcessBuilder.RelativePath
-import com.cloudera.hue.livy.{Utils, LivyConf, LineBufferedProcess}
 import com.cloudera.hue.livy.spark.SparkSubmitProcessBuilder
+import com.cloudera.hue.livy.spark.SparkSubmitProcessBuilder.RelativePath
+import com.cloudera.hue.livy.{LineBufferedProcess, LivyConf}
 
-import scala.concurrent.{Future, ExecutionContext, ExecutionContextExecutor}
+import scala.concurrent.{ExecutionContext, ExecutionContextExecutor, Future}
 
 object BatchSessionProcess {
   def apply(livyConf: LivyConf, id: Int, createBatchRequest: CreateBatchRequest): BatchSession = {

+ 1 - 3
apps/spark/java/livy-server/src/main/scala/com/cloudera/hue/livy/server/batch/BatchSessionProcessFactory.scala → apps/spark/java/livy-spark/src/main/scala/com/cloudera/hue/livy/spark/batch/BatchSessionProcessFactory.scala

@@ -16,13 +16,11 @@
  * limitations under the License.
  */
 
-package com.cloudera.hue.livy.server.batch
+package com.cloudera.hue.livy.spark.batch
 
 import com.cloudera.hue.livy.LivyConf
 import com.cloudera.hue.livy.sessions.batch.BatchSession
 
-import scala.concurrent.Future
-
 class BatchSessionProcessFactory(livyConf: LivyConf)
   extends BatchSessionFactory
 {

+ 5 - 5
apps/spark/java/livy-server/src/main/scala/com/cloudera/hue/livy/server/batch/BatchSessionYarn.scala → apps/spark/java/livy-spark/src/main/scala/com/cloudera/hue/livy/spark/batch/BatchSessionYarn.scala

@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-package com.cloudera.hue.livy.server.batch
+package com.cloudera.hue.livy.spark.batch
 
 import java.lang.ProcessBuilder.Redirect
 
@@ -80,7 +80,7 @@ private class BatchSessionYarn(val id: Int, process: LineBufferedProcess, jobFut
 
   jobFuture.onComplete {
     case util.Failure(_) =>
-      _state = SessionState.Error(System.currentTimeMillis())
+      _state = SessionState.Error()
 
     case util.Success(job) =>
       _state = SessionState.Running()
@@ -93,9 +93,9 @@ private class BatchSessionYarn(val id: Int, process: LineBufferedProcess, jobFut
               Thread.sleep(5000)
               job.getStatus match {
                 case ApplicationState.SuccessfulFinish() =>
-                  _state = SessionState.Success(System.currentTimeMillis())
+                  _state = SessionState.Success()
                 case ApplicationState.UnsuccessfulFinish() =>
-                  _state = SessionState.Error(System.currentTimeMillis())
+                  _state = SessionState.Error()
                 case _ => aux()
               }
             }
@@ -113,7 +113,7 @@ private class BatchSessionYarn(val id: Int, process: LineBufferedProcess, jobFut
   override def stop(): Future[Unit] = {
     jobFuture.map { job =>
       job.stop()
-      _state = SessionState.Success(System.currentTimeMillis())
+      _state = SessionState.Success()
       ()
     }
   }

+ 1 - 1
apps/spark/java/livy-server/src/main/scala/com/cloudera/hue/livy/server/batch/BatchSessionYarnFactory.scala → apps/spark/java/livy-spark/src/main/scala/com/cloudera/hue/livy/spark/batch/BatchSessionYarnFactory.scala

@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-package com.cloudera.hue.livy.server.batch
+package com.cloudera.hue.livy.spark.batch
 
 import com.cloudera.hue.livy.LivyConf
 import com.cloudera.hue.livy.sessions.batch.BatchSession

+ 1 - 1
apps/spark/java/livy-server/src/main/scala/com/cloudera/hue/livy/server/batch/CreateBatchRequest.scala → apps/spark/java/livy-spark/src/main/scala/com/cloudera/hue/livy/spark/batch/CreateBatchRequest.scala

@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-package com.cloudera.hue.livy.server.batch
+package com.cloudera.hue.livy.spark.batch
 
 case class CreateBatchRequest(
     file: String,

+ 1 - 1
apps/spark/java/livy-server/src/main/scala/com/cloudera/hue/livy/server/interactive/CreateInteractiveRequest.scala → apps/spark/java/livy-spark/src/main/scala/com/cloudera/hue/livy/spark/interactive/CreateInteractiveRequest.scala

@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-package com.cloudera.hue.livy.server.interactive
+package com.cloudera.hue.livy.spark.interactive
 
 import com.cloudera.hue.livy.sessions.Kind
 

+ 2 - 4
apps/spark/java/livy-server/src/main/scala/com/cloudera/hue/livy/server/interactive/InteractiveSessionFactory.scala → apps/spark/java/livy-spark/src/main/scala/com/cloudera/hue/livy/spark/interactive/InteractiveSessionFactory.scala

@@ -16,14 +16,12 @@
  * limitations under the License.
  */
 
-package com.cloudera.hue.livy.server.interactive
+package com.cloudera.hue.livy.spark.interactive
 
-import com.cloudera.hue.livy.sessions.{SessionFactory, SessionKindSerializer}
 import com.cloudera.hue.livy.sessions.interactive.InteractiveSession
+import com.cloudera.hue.livy.sessions.{SessionFactory, SessionKindSerializer}
 import org.json4s.{DefaultFormats, Formats, JValue}
 
-import scala.concurrent.Future
-
 trait InteractiveSessionFactory extends SessionFactory[InteractiveSession] {
 
   override protected implicit def jsonFormats: Formats = DefaultFormats ++ List(SessionKindSerializer)

+ 5 - 3
apps/spark/java/livy-server/src/main/scala/com/cloudera/hue/livy/server/interactive/InteractiveSessionProcess.scala → apps/spark/java/livy-spark/src/main/scala/com/cloudera/hue/livy/spark/interactive/InteractiveSessionProcess.scala

@@ -16,12 +16,12 @@
  * limitations under the License.
  */
 
-package com.cloudera.hue.livy.server.interactive
+package com.cloudera.hue.livy.spark.interactive
 
 import java.lang.ProcessBuilder.Redirect
 import java.net.URL
 
-import com.cloudera.hue.livy.sessions.SessionState
+import com.cloudera.hue.livy.sessions._
 import com.cloudera.hue.livy.sessions.interactive.InteractiveSession
 import com.cloudera.hue.livy.spark.SparkSubmitProcessBuilder.{AbsolutePath, RelativePath}
 import com.cloudera.hue.livy.spark.{SparkProcess, SparkSubmitProcessBuilder}
@@ -36,7 +36,9 @@ object InteractiveSessionProcess extends Logging {
   val CONF_LIVY_REPL_CALLBACK_URL = "livy.repl.callback-url"
   val CONF_LIVY_REPL_DRIVER_CLASS_PATH = "livy.repl.driverClassPath"
 
-  def create(livyConf: LivyConf, id: Int, createInteractiveRequest: CreateInteractiveRequest): InteractiveSession = {
+  def create(livyConf: LivyConf,
+             id: Int,
+             createInteractiveRequest: CreateInteractiveRequest): InteractiveSession = {
     val process = startProcess(livyConf, id, createInteractiveRequest)
     new InteractiveSessionProcess(id, createInteractiveRequest, process)
   }

+ 4 - 3
apps/spark/java/livy-server/src/main/scala/com/cloudera/hue/livy/server/interactive/InteractiveSessionProcessFactory.scala → apps/spark/java/livy-spark/src/main/scala/com/cloudera/hue/livy/spark/interactive/InteractiveSessionProcessFactory.scala

@@ -16,18 +16,19 @@
  * limitations under the License.
  */
 
-package com.cloudera.hue.livy.server.interactive
+package com.cloudera.hue.livy.spark.interactive
 
 import com.cloudera.hue.livy.LivyConf
 import com.cloudera.hue.livy.sessions.interactive.InteractiveSession
 
-import scala.concurrent.{ExecutionContext, Future}
+import scala.concurrent.ExecutionContext
 
 class InteractiveSessionProcessFactory(livyConf: LivyConf) extends InteractiveSessionFactory {
 
    implicit def executor: ExecutionContext = ExecutionContext.global
 
-   override def create(id: Int, createInteractiveRequest: CreateInteractiveRequest): InteractiveSession = {
+   override def create(id: Int,
+                       createInteractiveRequest: CreateInteractiveRequest): InteractiveSession = {
      InteractiveSessionProcess.create(livyConf, id, createInteractiveRequest)
    }
  }

+ 1 - 2
apps/spark/java/livy-server/src/main/scala/com/cloudera/hue/livy/server/interactive/InteractiveSessionYarn.scala → apps/spark/java/livy-spark/src/main/scala/com/cloudera/hue/livy/spark/interactive/InteractiveSessionYarn.scala

@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-package com.cloudera.hue.livy.server.interactive
+package com.cloudera.hue.livy.spark.interactive
 
 import java.lang.ProcessBuilder.Redirect
 import java.util.concurrent.TimeUnit
@@ -35,7 +35,6 @@ object InteractiveSessionYarn {
   protected implicit def executor: ExecutionContextExecutor = ExecutionContext.global
 
   private val CONF_LIVY_JAR = "livy.yarn.jar"
-  private lazy val regex = """Application report for (\w+)""".r.unanchored
 
   def create(livyConf: LivyConf,
              client: Client,

+ 2 - 2
apps/spark/java/livy-server/src/main/scala/com/cloudera/hue/livy/server/interactive/InteractiveSessionYarnFactory.scala → apps/spark/java/livy-spark/src/main/scala/com/cloudera/hue/livy/spark/interactive/InteractiveSessionYarnFactory.scala

@@ -16,13 +16,13 @@
  * limitations under the License.
  */
 
-package com.cloudera.hue.livy.server.interactive
+package com.cloudera.hue.livy.spark.interactive
 
 import com.cloudera.hue.livy.LivyConf
 import com.cloudera.hue.livy.sessions.interactive.InteractiveSession
 import com.cloudera.hue.livy.yarn.Client
 
-import scala.concurrent.{ExecutionContext, Future}
+import scala.concurrent.ExecutionContext
 
 class InteractiveSessionYarnFactory(livyConf: LivyConf) extends InteractiveSessionFactory {
 

+ 5 - 4
apps/spark/java/livy-server/src/main/scala/com/cloudera/hue/livy/server/interactive/InteractiveWebSession.scala → apps/spark/java/livy-spark/src/main/scala/com/cloudera/hue/livy/spark/interactive/InteractiveWebSession.scala

@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-package com.cloudera.hue.livy.server.interactive
+package com.cloudera.hue.livy.spark.interactive
 
 import java.net.{ConnectException, URL}
 import java.util.concurrent.TimeUnit
@@ -26,16 +26,17 @@ import com.cloudera.hue.livy.msgs.ExecuteRequest
 import com.cloudera.hue.livy.sessions._
 import com.cloudera.hue.livy.sessions.interactive.{Statement, InteractiveSession}
 import dispatch._
-import org.json4s.JsonAST.{JString, JNull}
+import org.json4s.JsonAST.{JNull, JString}
 import org.json4s.jackson.Serialization.write
 import org.json4s.{DefaultFormats, Formats, JValue}
 
 import scala.annotation.tailrec
 import scala.concurrent.duration.Duration
 import scala.concurrent.{Future, _}
-import scala.util
 
-abstract class InteractiveWebSession(val id: Int, createInteractiveRequest: CreateInteractiveRequest) extends InteractiveSession with Logging {
+abstract class InteractiveWebSession(val id: Int,
+                                     createInteractiveRequest: CreateInteractiveRequest)
+  extends InteractiveSession with Logging {
 
   protected implicit def executor: ExecutionContextExecutor = ExecutionContext.global
   protected implicit def jsonFormats: Formats = DefaultFormats

+ 2 - 1
apps/spark/java/livy-server/src/test/scala/com/cloudera/hue/livy/server/batch/BatchProcessSpec.scala → apps/spark/java/livy-spark/src/test/scala/com/cloudera/hue/livy/spark/batch/BatchProcessSpec.scala

@@ -16,11 +16,12 @@
  * limitations under the License.
  */
 
-package com.cloudera.hue.livy.server.batch
+package com.cloudera.hue.livy.spark.batch
 
 import java.io.FileWriter
 import java.nio.file.{Files, Path}
 import java.util.concurrent.TimeUnit
+
 import com.cloudera.hue.livy.sessions.SessionState
 import com.cloudera.hue.livy.{LivyConf, Utils}
 import org.scalatest.{BeforeAndAfterAll, FunSpec, ShouldMatchers}

+ 6 - 2
apps/spark/java/livy-server/src/test/scala/com/cloudera/hue/livy/server/interactive/InteractiveSessionProcessSpec.scala → apps/spark/java/livy-spark/src/test/scala/com/cloudera/hue/livy/spark/interactive/InteractiveSessionProcessSpec.scala

@@ -16,13 +16,17 @@
  * limitations under the License.
  */
 
-package com.cloudera.hue.livy.server.interactive
+package com.cloudera.hue.livy.spark.interactive
 
 import com.cloudera.hue.livy.LivyConf
 import com.cloudera.hue.livy.sessions.{BaseInteractiveSessionSpec, PySpark}
 import org.scalatest.{BeforeAndAfter, FunSpecLike, Matchers}
 
-class InteractiveSessionProcessSpec extends BaseInteractiveSessionSpec with FunSpecLike with Matchers with BeforeAndAfter {
+class InteractiveSessionProcessSpec
+  extends BaseInteractiveSessionSpec
+  with FunSpecLike
+  with Matchers
+  with BeforeAndAfter {
 
   val livyConf = new LivyConf()
   livyConf.set("livy.repl.driverClassPath", sys.props("java.class.path"))

+ 3 - 2
apps/spark/java/pom.xml

@@ -70,11 +70,12 @@
     </properties>
 
     <modules>
+        <module>livy-assembly</module>
         <module>livy-core</module>
         <module>livy-repl</module>
-        <module>livy-yarn</module>
         <module>livy-server</module>
-        <module>livy-assembly</module>
+        <module>livy-spark</module>
+        <module>livy-yarn</module>
     </modules>
 
     <dependencyManagement>