predictionio-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From don...@apache.org
Subject incubator-predictionio git commit: Code cleanup
Date Mon, 20 Mar 2017 23:29:28 GMT
Repository: incubator-predictionio
Updated Branches:
  refs/heads/develop a4edda1fa -> 68708b476


Code cleanup

* Update Unidoc plugin
* Javadoc errors cleanup
* Code cleanup


Project: http://git-wip-us.apache.org/repos/asf/incubator-predictionio/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-predictionio/commit/68708b47
Tree: http://git-wip-us.apache.org/repos/asf/incubator-predictionio/tree/68708b47
Diff: http://git-wip-us.apache.org/repos/asf/incubator-predictionio/diff/68708b47

Branch: refs/heads/develop
Commit: 68708b4767278dbcdb1935501031fb759a2b5e85
Parents: a4edda1
Author: shimamoto <chibochibo@gmail.com>
Authored: Mon Mar 20 16:27:41 2017 -0700
Committer: Donald Szeto <donald@apache.org>
Committed: Mon Mar 20 16:27:41 2017 -0700

----------------------------------------------------------------------
 build.sbt                                       | 35 +++++++-------
 common/build.sbt                                |  8 ++--
 .../controller/IdentityPreparator.scala         |  6 +--
 data/build.sbt                                  |  4 +-
 .../predictionio/data/storage/Storage.scala     |  5 +-
 .../predictionio/data/view/LBatchView.scala     | 48 ++++++--------------
 e2/build.sbt                                    |  2 +-
 project/unidoc.sbt                              |  2 +-
 storage/elasticsearch/build.sbt                 |  3 +-
 storage/elasticsearch1/build.sbt                |  3 +-
 storage/hbase/build.sbt                         |  3 +-
 storage/hdfs/build.sbt                          |  3 +-
 storage/jdbc/build.sbt                          |  3 +-
 storage/localfs/build.sbt                       |  3 +-
 tools/build.sbt                                 |  8 ++--
 .../org/apache/predictionio/tools/Common.scala  | 11 +----
 .../apache/predictionio/tools/RunServer.scala   |  2 -
 .../apache/predictionio/tools/RunWorkflow.scala |  8 +---
 .../predictionio/tools/commands/AccessKey.scala |  4 --
 .../predictionio/tools/commands/Engine.scala    |  7 ---
 .../predictionio/tools/commands/Template.scala  |  2 -
 .../predictionio/tools/console/Console.scala    | 14 ------
 .../apache/predictionio/tools/console/Pio.scala | 12 +----
 .../tools/dashboard/CorsSupport.scala           |  1 -
 .../tools/dashboard/Dashboard.scala             |  4 +-
 25 files changed, 63 insertions(+), 138 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-predictionio/blob/68708b47/build.sbt
----------------------------------------------------------------------
diff --git a/build.sbt b/build.sbt
index fc47f6a..c0542f7 100644
--- a/build.sbt
+++ b/build.sbt
@@ -16,7 +16,6 @@
  */
 
 import PIOBuild._
-import UnidocKeys._
 
 lazy val scalaSparkDepsVersion = Map(
   "2.10" -> Map(
@@ -56,6 +55,8 @@ scalaVersion in ThisBuild := sys.props.getOrElse("scala.version", "2.10.6")
 
 crossScalaVersions in ThisBuild := Seq("2.10.6", "2.11.8")
 
+crossScalaVersions in ThisBuild := Seq(scalaVersion.value, "2.11.8")
+
 scalacOptions in ThisBuild ++= Seq("-deprecation", "-unchecked", "-feature")
 
 scalacOptions in (ThisBuild, Test) ++= Seq("-Yrangepos")
@@ -89,16 +90,12 @@ val pioBuildInfoSettings = buildInfoSettings ++ Seq(
     name,
     version,
     scalaVersion,
+    scalaBinaryVersion,
     sbtVersion,
     sparkVersion,
     hadoopVersion),
   buildInfoPackage := "org.apache.predictionio.core")
 
-// Used temporarily to modify genjavadoc version to "0.10" until unidoc updates it
-val genjavadocSettings: Seq[sbt.Def.Setting[_]] = Seq(
-  libraryDependencies += compilerPlugin("com.typesafe.genjavadoc" %% "genjavadoc-plugin"
% "0.10" cross CrossVersion.full),
-    scalacOptions <+= target map (t => "-P:genjavadoc:out=" + (t / "java")))
-
 val conf = file("conf")
 
 val commonSettings = Seq(
@@ -113,44 +110,43 @@ val commonTestSettings = Seq(
 
 val dataElasticsearch1 = (project in file("storage/elasticsearch1")).
   settings(commonSettings: _*).
-  settings(genjavadocSettings: _*).
+  enablePlugins(GenJavadocPlugin).
   settings(publishArtifact := false)
 
 val dataElasticsearch = (project in file("storage/elasticsearch")).
   settings(commonSettings: _*).
-  settings(genjavadocSettings: _*).
   settings(publishArtifact := false)
 
 val dataHbase = (project in file("storage/hbase")).
   settings(commonSettings: _*).
-  settings(genjavadocSettings: _*).
+  enablePlugins(GenJavadocPlugin).
   settings(publishArtifact := false)
 
 val dataHdfs = (project in file("storage/hdfs")).
   settings(commonSettings: _*).
-  settings(genjavadocSettings: _*).
+  enablePlugins(GenJavadocPlugin).
   settings(publishArtifact := false)
 
 val dataJdbc = (project in file("storage/jdbc")).
   settings(commonSettings: _*).
-  settings(genjavadocSettings: _*).
+  enablePlugins(GenJavadocPlugin).
   settings(publishArtifact := false)
 
 val dataLocalfs = (project in file("storage/localfs")).
   settings(commonSettings: _*).
-  settings(genjavadocSettings: _*).
+  enablePlugins(GenJavadocPlugin).
   settings(publishArtifact := false)
 
 val common = (project in file("common")).
   settings(commonSettings: _*).
-  settings(genjavadocSettings: _*).
+  enablePlugins(GenJavadocPlugin).
   disablePlugins(sbtassembly.AssemblyPlugin)
 
 val data = (project in file("data")).
   dependsOn(common).
   settings(commonSettings: _*).
   settings(commonTestSettings: _*).
-  settings(genjavadocSettings: _*).
+  enablePlugins(GenJavadocPlugin).
   settings(unmanagedSourceDirectories in Compile +=
     sourceDirectory.value / s"main/spark-${majorVersion(sparkVersion.value)}").
   disablePlugins(sbtassembly.AssemblyPlugin)
@@ -159,7 +155,7 @@ val core = (project in file("core")).
   dependsOn(data).
   settings(commonSettings: _*).
   settings(commonTestSettings: _*).
-  settings(genjavadocSettings: _*).
+  enablePlugins(GenJavadocPlugin).
   settings(pioBuildInfoSettings: _*).
   enablePlugins(SbtTwirl).
   disablePlugins(sbtassembly.AssemblyPlugin)
@@ -169,13 +165,13 @@ val tools = (project in file("tools")).
   dependsOn(data).
   settings(commonSettings: _*).
   settings(commonTestSettings: _*).
-  settings(genjavadocSettings: _*).
+  enablePlugins(GenJavadocPlugin).
   enablePlugins(SbtTwirl).
   settings(publishArtifact := false)
 
 val e2 = (project in file("e2")).
   settings(commonSettings: _*).
-  settings(genjavadocSettings: _*).
+  enablePlugins(GenJavadocPlugin).
   disablePlugins(sbtassembly.AssemblyPlugin)
 
 val dataEs = if (majorVersion(es) == 1) dataElasticsearch1 else dataElasticsearch
@@ -193,9 +189,10 @@ val storage = (project in file("storage"))
 
 val root = (project in file(".")).
   settings(commonSettings: _*).
-  // settings(scalaJavaUnidocSettings: _*).
-  settings(unidocSettings: _*).
+  enablePlugins(ScalaUnidocPlugin).
   settings(
+    unidocProjectFilter in (ScalaUnidoc, unidoc) := inAnyProject -- inProjects(dataElasticsearch),
+    unidocProjectFilter in (JavaUnidoc, unidoc) := inAnyProject -- inProjects(dataElasticsearch),
     scalacOptions in (ScalaUnidoc, unidoc) ++= Seq(
       "-groups",
       "-skip-packages",

http://git-wip-us.apache.org/repos/asf/incubator-predictionio/blob/68708b47/common/build.sbt
----------------------------------------------------------------------
diff --git a/common/build.sbt b/common/build.sbt
index 5a0fba1..32afb97 100644
--- a/common/build.sbt
+++ b/common/build.sbt
@@ -20,10 +20,8 @@ import PIOBuild._
 name := "apache-predictionio-common"
 
 libraryDependencies ++= Seq(
-  "io.spray"               %% "spray-can"      % "1.3.3",
-  "io.spray"               %% "spray-routing"  % "1.3.3",
-  "com.typesafe.akka"      %% "akka-actor"     % akkaVersion.value,
-  "com.typesafe.akka"      %% "akka-slf4j"     % akkaVersion.value
-)
+  "io.spray"          %% "spray-can"     % "1.3.3",
+  "io.spray"          %% "spray-routing" % "1.3.3",
+  "com.typesafe.akka" %% "akka-actor"    % akkaVersion.value)
 
 pomExtra := childrenPomExtra.value

http://git-wip-us.apache.org/repos/asf/incubator-predictionio/blob/68708b47/core/src/main/scala/org/apache/predictionio/controller/IdentityPreparator.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/org/apache/predictionio/controller/IdentityPreparator.scala
b/core/src/main/scala/org/apache/predictionio/controller/IdentityPreparator.scala
index bba1b3e..a82f493 100644
--- a/core/src/main/scala/org/apache/predictionio/controller/IdentityPreparator.scala
+++ b/core/src/main/scala/org/apache/predictionio/controller/IdentityPreparator.scala
@@ -55,19 +55,18 @@ object IdentityPreparator {
   * @tparam TD Training data class.
   * @group Preparator
   */
-@deprecated("Use IdentityPreparator instead.", "0.9.2")
 class PIdentityPreparator[TD] extends IdentityPreparator[TD]
 
 /** DEPRECATED. Use [[IdentityPreparator]] instead.
   *
   * @group Preparator
   */
-@deprecated("Use IdentityPreparator instead.", "0.9.2")
 object PIdentityPreparator {
   /** Produces an instance of the class of [[IdentityPreparator]].
     *
     * @param ds Instance of the class of the data source for this preparator.
     */
+  @deprecated("Use IdentityPreparator instead.", "0.9.2")
   def apply[TD](ds: Class[_ <: BaseDataSource[TD, _, _, _]]): Class[IdentityPreparator[TD]]
=
     classOf[IdentityPreparator[TD]]
 }
@@ -77,19 +76,18 @@ object PIdentityPreparator {
   * @tparam TD Training data class.
   * @group Preparator
   */
-@deprecated("Use IdentityPreparator instead.", "0.9.2")
 class LIdentityPreparator[TD] extends IdentityPreparator[TD]
 
 /** DEPRECATED. Use [[IdentityPreparator]] instead.
   *
   * @group Preparator
   */
-@deprecated("Use IdentityPreparator instead.", "0.9.2")
 object LIdentityPreparator {
   /** Produces an instance of the class of [[IdentityPreparator]].
     *
     * @param ds Instance of the class of the data source for this preparator.
     */
+  @deprecated("Use IdentityPreparator instead.", "0.9.2")
   def apply[TD](ds: Class[_ <: BaseDataSource[TD, _, _, _]]): Class[IdentityPreparator[TD]]
=
     classOf[IdentityPreparator[TD]]
 }

http://git-wip-us.apache.org/repos/asf/incubator-predictionio/blob/68708b47/data/build.sbt
----------------------------------------------------------------------
diff --git a/data/build.sbt b/data/build.sbt
index ddd085d..b6b2410 100644
--- a/data/build.sbt
+++ b/data/build.sbt
@@ -21,14 +21,12 @@ name := "apache-predictionio-data"
 
 libraryDependencies ++= Seq(
   "com.github.nscala-time" %% "nscala-time"    % "2.6.0",
-  "com.google.guava"        % "guava"          % "19.0",
   "io.spray"               %% "spray-can"      % "1.3.3",
   "io.spray"               %% "spray-routing"  % "1.3.3",
+  "io.spray"               %% "spray-testkit"  % "1.3.3" % "test",
   "org.apache.spark"       %% "spark-sql"      % sparkVersion.value % "provided",
   "org.clapper"            %% "grizzled-slf4j" % "1.0.2",
   "org.json4s"             %% "json4s-native"  % json4sVersion.value,
-  "org.scalikejdbc"        %% "scalikejdbc"    % "2.3.2",
-  "io.spray"               %% "spray-testkit"  % "1.3.3" % "test",
   "org.scalatest"          %% "scalatest"      % "2.1.7" % "test",
   "org.specs2"             %% "specs2"         % "2.3.13" % "test")
 

http://git-wip-us.apache.org/repos/asf/incubator-predictionio/blob/68708b47/data/src/main/scala/org/apache/predictionio/data/storage/Storage.scala
----------------------------------------------------------------------
diff --git a/data/src/main/scala/org/apache/predictionio/data/storage/Storage.scala b/data/src/main/scala/org/apache/predictionio/data/storage/Storage.scala
index 3374f5f..6372446 100644
--- a/data/src/main/scala/org/apache/predictionio/data/storage/Storage.scala
+++ b/data/src/main/scala/org/apache/predictionio/data/storage/Storage.scala
@@ -91,7 +91,10 @@ case class StorageClientConfig(
 class StorageClientException(message: String, cause: Throwable)
   extends RuntimeException(message, cause)
 
-@deprecated("Use StorageException", "0.9.2")
+/** DEPRECATED. Use [[StorageException]].
+  *
+  * @deprecated Use [[StorageException]]
+  */
 private[predictionio] case class StorageError(message: String)
 
 /** :: DeveloperApi ::

http://git-wip-us.apache.org/repos/asf/incubator-predictionio/blob/68708b47/data/src/main/scala/org/apache/predictionio/data/view/LBatchView.scala
----------------------------------------------------------------------
diff --git a/data/src/main/scala/org/apache/predictionio/data/view/LBatchView.scala b/data/src/main/scala/org/apache/predictionio/data/view/LBatchView.scala
index 5345eb0..d9c53ef 100644
--- a/data/src/main/scala/org/apache/predictionio/data/view/LBatchView.scala
+++ b/data/src/main/scala/org/apache/predictionio/data/view/LBatchView.scala
@@ -28,47 +28,54 @@ import scala.language.implicitConversions
 
 import scala.concurrent.ExecutionContext.Implicits.global // TODO
 
-@deprecated("Use LEvents or LEventStore instead.", "0.9.2")
 object ViewPredicates {
+  @deprecated("Use LEvents or LEventStore instead.", "0.9.2")
   def getStartTimePredicate(startTimeOpt: Option[DateTime])
   : (Event => Boolean) = {
     startTimeOpt.map(getStartTimePredicate).getOrElse(_ => true)
   }
 
+  @deprecated("Use LEvents or LEventStore instead.", "0.9.2")
   def getStartTimePredicate(startTime: DateTime): (Event => Boolean) = {
     e => (!(e.eventTime.isBefore(startTime) || e.eventTime.isEqual(startTime)))
   }
 
+  @deprecated("Use LEvents or LEventStore instead.", "0.9.2")
   def getUntilTimePredicate(untilTimeOpt: Option[DateTime])
   : (Event => Boolean) = {
     untilTimeOpt.map(getUntilTimePredicate).getOrElse(_ => true)
   }
 
+  @deprecated("Use LEvents or LEventStore instead.", "0.9.2")
   def getUntilTimePredicate(untilTime: DateTime): (Event => Boolean) = {
     _.eventTime.isBefore(untilTime)
   }
 
+  @deprecated("Use LEvents or LEventStore instead.", "0.9.2")
   def getEntityTypePredicate(entityTypeOpt: Option[String]): (Event => Boolean)
   = {
     entityTypeOpt.map(getEntityTypePredicate).getOrElse(_ => true)
   }
 
+  @deprecated("Use LEvents or LEventStore instead.", "0.9.2")
   def getEntityTypePredicate(entityType: String): (Event => Boolean) = {
     (_.entityType == entityType)
   }
 
+  @deprecated("Use LEvents or LEventStore instead.", "0.9.2")
   def getEventPredicate(eventOpt: Option[String]): (Event => Boolean)
   = {
     eventOpt.map(getEventPredicate).getOrElse(_ => true)
   }
 
+  @deprecated("Use LEvents or LEventStore instead.", "0.9.2")
   def getEventPredicate(event: String): (Event => Boolean) = {
     (_.event == event)
   }
 }
 
-@deprecated("Use LEvents instead.", "0.9.2")
 object ViewAggregators {
+  @deprecated("Use LEvents instead.", "0.9.2")
   def getDataMapAggregator(): ((Option[DataMap], Event) => Option[DataMap]) = {
     (p, e) => {
       e.event match {
@@ -93,19 +100,20 @@ object ViewAggregators {
   }
 }
 
-@deprecated("Use LEvents instead.", "0.9.2")
 object EventSeq {
   // Need to
   // >>> import scala.language.implicitConversions
   // to enable implicit conversion. Only import in the code where this is
   // necessary to avoid confusion.
+  @deprecated("Use LEvents instead.", "0.9.2")
   implicit def eventSeqToList(es: EventSeq): List[Event] = es.events
+  @deprecated("Use LEvents instead.", "0.9.2")
   implicit def listToEventSeq(l: List[Event]): EventSeq = new EventSeq(l)
 }
 
 
-@deprecated("Use LEvents instead.", "0.9.2")
 class EventSeq(val events: List[Event]) {
+  @deprecated("Use LEvents instead.", "0.9.2")
   def filter(
     eventOpt: Option[String] = None,
     entityTypeOpt: Option[String] = None,
@@ -119,8 +127,10 @@ class EventSeq(val events: List[Event]) {
     .filter(ViewPredicates.getEntityTypePredicate(entityTypeOpt))
   }
 
+  @deprecated("Use LEvents instead.", "0.9.2")
   def filter(p: (Event => Boolean)): EventSeq = events.filter(p)
 
+  @deprecated("Use LEvents instead.", "0.9.2")
   def aggregateByEntityOrdered[T](init: T, op: (T, Event) => T)
   : Map[String, T] = {
     events
@@ -133,7 +143,6 @@ class EventSeq(val events: List[Event]) {
 }
 
 
-@deprecated("Use LEventStore instead.", "0.9.2")
 class LBatchView(
   val appId: Int,
   val startTime: Option[DateTime],
@@ -156,6 +165,7 @@ class LBatchView(
    * @param untilTimeOpt if specified, only aggregate event until (exclusive)
    * endTimeOpt
    */
+  @deprecated("Use LEventStore instead.", "0.9.2")
   def aggregateProperties(
       entityType: String,
       startTimeOpt: Option[DateTime] = None,
@@ -172,32 +182,4 @@ class LBatchView(
     .mapValues(_.get)
 
   }
-
-  /*
-  def aggregateByEntityOrdered[T](
-    predicate: Event => Boolean,
-    init: T,
-    op: (T, Event) => T): Map[String, T] = {
-
-    _events
-      .filter( predicate(_) )
-      .groupBy( _.entityId )
-      .mapValues( _.sortBy(_.eventTime.getMillis).foldLeft[T](init)(op))
-      .toMap
-
-  }
-  */
-
-  /*
-  def groupByEntityOrdered[T](
-    predicate: Event => Boolean,
-    map: Event => T): Map[String, Seq[T]] = {
-
-    _events
-      .filter( predicate(_) )
-      .groupBy( _.entityId )
-      .mapValues( _.sortBy(_.eventTime.getMillis).map(map(_)) )
-      .toMap
-  }
-  */
 }

http://git-wip-us.apache.org/repos/asf/incubator-predictionio/blob/68708b47/e2/build.sbt
----------------------------------------------------------------------
diff --git a/e2/build.sbt b/e2/build.sbt
index 0774a55..29c1d48 100644
--- a/e2/build.sbt
+++ b/e2/build.sbt
@@ -23,6 +23,6 @@ parallelExecution in Test := false
 
 libraryDependencies ++= Seq(
   "org.apache.spark" %% "spark-mllib" % sparkVersion.value % "provided",
-  "org.scalatest" %% "scalatest" % "2.2.5" % "test")
+  "org.scalatest"    %% "scalatest" % "2.2.5" % "test")
 
 pomExtra := childrenPomExtra.value

http://git-wip-us.apache.org/repos/asf/incubator-predictionio/blob/68708b47/project/unidoc.sbt
----------------------------------------------------------------------
diff --git a/project/unidoc.sbt b/project/unidoc.sbt
index 7700b32..f9c20f8 100644
--- a/project/unidoc.sbt
+++ b/project/unidoc.sbt
@@ -1 +1 @@
-addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.3.3")
+addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.0")

http://git-wip-us.apache.org/repos/asf/incubator-predictionio/blob/68708b47/storage/elasticsearch/build.sbt
----------------------------------------------------------------------
diff --git a/storage/elasticsearch/build.sbt b/storage/elasticsearch/build.sbt
index 52dc965..091b354 100644
--- a/storage/elasticsearch/build.sbt
+++ b/storage/elasticsearch/build.sbt
@@ -43,4 +43,5 @@ assemblyShadeRules in assembly := Seq(
 // skip test in assembly
 test in assembly := {}
 
-assemblyOutputPath in assembly := baseDirectory.value.getAbsoluteFile.getParentFile.getParentFile
/ "assembly" / "spark" / ("pio-data-elasticsearch-assembly-" + version.value + ".jar")
+assemblyOutputPath in assembly := baseDirectory.value.getAbsoluteFile.getParentFile.getParentFile
/
+  "assembly" / "spark" / s"pio-data-elasticsearch-assembly-${version.value}.jar"

http://git-wip-us.apache.org/repos/asf/incubator-predictionio/blob/68708b47/storage/elasticsearch1/build.sbt
----------------------------------------------------------------------
diff --git a/storage/elasticsearch1/build.sbt b/storage/elasticsearch1/build.sbt
index bb68b11..6ed4df0 100644
--- a/storage/elasticsearch1/build.sbt
+++ b/storage/elasticsearch1/build.sbt
@@ -33,4 +33,5 @@ assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeSca
 // skip test in assembly
 test in assembly := {}
 
-assemblyOutputPath in assembly := baseDirectory.value.getAbsoluteFile.getParentFile.getParentFile
/ "assembly" / "spark" / ("pio-data-elasticsearch1-assembly-" + version.value + ".jar")
+assemblyOutputPath in assembly := baseDirectory.value.getAbsoluteFile.getParentFile.getParentFile
/
+  "assembly" / "spark" / s"pio-data-elasticsearch1-assembly-${version.value}.jar"

http://git-wip-us.apache.org/repos/asf/incubator-predictionio/blob/68708b47/storage/hbase/build.sbt
----------------------------------------------------------------------
diff --git a/storage/hbase/build.sbt b/storage/hbase/build.sbt
index 19aa126..c33db2d 100644
--- a/storage/hbase/build.sbt
+++ b/storage/hbase/build.sbt
@@ -44,4 +44,5 @@ assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeSca
 // skip test in assembly
 test in assembly := {}
 
-assemblyOutputPath in assembly := baseDirectory.value.getAbsoluteFile.getParentFile.getParentFile
/ "assembly" / "spark" / ("pio-data-hbase-assembly-" + version.value + ".jar")
+assemblyOutputPath in assembly := baseDirectory.value.getAbsoluteFile.getParentFile.getParentFile
/
+  "assembly" / "spark" / s"pio-data-hbase-assembly-${version.value}.jar"

http://git-wip-us.apache.org/repos/asf/incubator-predictionio/blob/68708b47/storage/hdfs/build.sbt
----------------------------------------------------------------------
diff --git a/storage/hdfs/build.sbt b/storage/hdfs/build.sbt
index 8bae2a8..3fd8d22 100644
--- a/storage/hdfs/build.sbt
+++ b/storage/hdfs/build.sbt
@@ -38,4 +38,5 @@ assemblyOption in assembly := (assemblyOption in assembly).value.copy(
 // skip test in assembly
 test in assembly := {}
 
-assemblyOutputPath in assembly := baseDirectory.value.getAbsoluteFile.getParentFile.getParentFile
/ "assembly" / "spark" / ("pio-data-hdfs-assembly-" + version.value + ".jar")
+assemblyOutputPath in assembly := baseDirectory.value.getAbsoluteFile.getParentFile.getParentFile
/
+  "assembly" / "spark" / ("pio-data-hdfs-assembly-" + version.value + ".jar")

http://git-wip-us.apache.org/repos/asf/incubator-predictionio/blob/68708b47/storage/jdbc/build.sbt
----------------------------------------------------------------------
diff --git a/storage/jdbc/build.sbt b/storage/jdbc/build.sbt
index dc98e21..3c5026a 100644
--- a/storage/jdbc/build.sbt
+++ b/storage/jdbc/build.sbt
@@ -35,4 +35,5 @@ assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeSca
 // skip test in assembly
 test in assembly := {}
 
-assemblyOutputPath in assembly := baseDirectory.value.getAbsoluteFile.getParentFile.getParentFile
/ "assembly" / "spark" / ("pio-data-jdbc-assembly-" + version.value + ".jar")
+assemblyOutputPath in assembly := baseDirectory.value.getAbsoluteFile.getParentFile.getParentFile
/
+  "assembly" / "spark" / s"pio-data-jdbc-assembly-${version.value}.jar"

http://git-wip-us.apache.org/repos/asf/incubator-predictionio/blob/68708b47/storage/localfs/build.sbt
----------------------------------------------------------------------
diff --git a/storage/localfs/build.sbt b/storage/localfs/build.sbt
index f8c6b8e..3413e97 100644
--- a/storage/localfs/build.sbt
+++ b/storage/localfs/build.sbt
@@ -32,4 +32,5 @@ assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeSca
 // skip test in assembly
 test in assembly := {}
 
-assemblyOutputPath in assembly := baseDirectory.value.getAbsoluteFile.getParentFile.getParentFile
/ "assembly" / "spark" / ("pio-data-localfs-assembly-" + version.value + ".jar")
+assemblyOutputPath in assembly := baseDirectory.value.getAbsoluteFile.getParentFile.getParentFile
/
+  "assembly" / "spark" / s"pio-data-localfs-assembly-${version.value}.jar"

http://git-wip-us.apache.org/repos/asf/incubator-predictionio/blob/68708b47/tools/build.sbt
----------------------------------------------------------------------
diff --git a/tools/build.sbt b/tools/build.sbt
index 483a591..a39c6b0 100644
--- a/tools/build.sbt
+++ b/tools/build.sbt
@@ -27,7 +27,7 @@ libraryDependencies ++= Seq(
   "io.spray"               %% "spray-testkit"  % "1.3.3" % "test",
   "org.specs2"             %% "specs2"         % "2.3.13" % "test")
 
-dependencyOverrides +=   "org.slf4j" % "slf4j-log4j12" % "1.7.18"
+dependencyOverrides += "org.slf4j" % "slf4j-log4j12" % "1.7.18"
 
 assemblyMergeStrategy in assembly := {
   case PathList("META-INF", "LICENSE.txt") => MergeStrategy.concat
@@ -37,7 +37,7 @@ assemblyMergeStrategy in assembly := {
     oldStrategy(x)
 }
 
-excludedJars in assembly <<= (fullClasspath in assembly) map { cp =>
+assemblyExcludedJars in assembly <<= (fullClasspath in assembly) map { cp =>
   cp filter { _.data.getName match {
     case "reflectasm-1.10.1.jar" => true
     case "kryo-3.0.3.jar" => true
@@ -54,8 +54,8 @@ assemblyShadeRules in assembly := Seq(
 // skip test in assembly
 test in assembly := {}
 
-outputPath in assembly := baseDirectory.value.getAbsoluteFile.getParentFile /
-  "assembly" / ("pio-assembly-" + version.value + ".jar")
+assemblyOutputPath in assembly := baseDirectory.value.getAbsoluteFile.getParentFile /
+  "assembly" / s"pio-assembly-${version.value}.jar"
 
 cleanFiles <+= baseDirectory { base => base.getParentFile / "assembly" }
 

http://git-wip-us.apache.org/repos/asf/incubator-predictionio/blob/68708b47/tools/src/main/scala/org/apache/predictionio/tools/Common.scala
----------------------------------------------------------------------
diff --git a/tools/src/main/scala/org/apache/predictionio/tools/Common.scala b/tools/src/main/scala/org/apache/predictionio/tools/Common.scala
index 7d04c07..0ddd644 100644
--- a/tools/src/main/scala/org/apache/predictionio/tools/Common.scala
+++ b/tools/src/main/scala/org/apache/predictionio/tools/Common.scala
@@ -65,14 +65,6 @@ object Common extends EitherLogging {
     }
   }
 
-  def versionNoPatch(fullVersion: String): String = {
-    val v = """^(\d+\.\d+)""".r
-    val versionNoPatch = for {
-      v(np) <- v findFirstIn fullVersion
-    } yield np
-    versionNoPatch.getOrElse(fullVersion)
-  }
-
   def getEngineDirPath(directory: Option[String]): String = {
     new File(directory.getOrElse(".")).getCanonicalPath
   }
@@ -95,9 +87,8 @@ object Common extends EitherLogging {
     val engineDir = getEngineDirPath(Some(directory))
     val libFiles = jarFilesForScalaFilter(
       jarFilesAt(new File(engineDir, "lib")))
-    val scalaVersionNoPatch = Common.versionNoPatch(BuildInfo.scalaVersion)
     val targetFiles = jarFilesForScalaFilter(jarFilesAt(new File(engineDir,
-      "target" + File.separator + s"scala-${scalaVersionNoPatch}")))
+      "target" + File.separator + s"scala-${BuildInfo.scalaBinaryVersion}")))
     // Use libFiles is target is empty.
     if (targetFiles.size > 0) targetFiles else libFiles
   }

http://git-wip-us.apache.org/repos/asf/incubator-predictionio/blob/68708b47/tools/src/main/scala/org/apache/predictionio/tools/RunServer.scala
----------------------------------------------------------------------
diff --git a/tools/src/main/scala/org/apache/predictionio/tools/RunServer.scala b/tools/src/main/scala/org/apache/predictionio/tools/RunServer.scala
index db055b5..0c5b635 100644
--- a/tools/src/main/scala/org/apache/predictionio/tools/RunServer.scala
+++ b/tools/src/main/scala/org/apache/predictionio/tools/RunServer.scala
@@ -20,12 +20,10 @@ package org.apache.predictionio.tools
 
 import org.apache.predictionio.tools.Common._
 import org.apache.predictionio.tools.ReturnTypes._
-import org.apache.predictionio.workflow.WorkflowUtils
 import org.apache.predictionio.workflow.JsonExtractorOption
 import org.apache.predictionio.workflow.JsonExtractorOption.JsonExtractorOption
 
 import java.io.File
-import java.net.URI
 import grizzled.slf4j.Logging
 
 import scala.sys.process._

http://git-wip-us.apache.org/repos/asf/incubator-predictionio/blob/68708b47/tools/src/main/scala/org/apache/predictionio/tools/RunWorkflow.scala
----------------------------------------------------------------------
diff --git a/tools/src/main/scala/org/apache/predictionio/tools/RunWorkflow.scala b/tools/src/main/scala/org/apache/predictionio/tools/RunWorkflow.scala
index 462770e..6df0750 100644
--- a/tools/src/main/scala/org/apache/predictionio/tools/RunWorkflow.scala
+++ b/tools/src/main/scala/org/apache/predictionio/tools/RunWorkflow.scala
@@ -18,20 +18,14 @@
 package org.apache.predictionio.tools
 
 import org.apache.predictionio.tools.console.Console
-import org.apache.predictionio.tools.Runner
 import org.apache.predictionio.tools.Common._
 import org.apache.predictionio.tools.ReturnTypes._
-import org.apache.predictionio.workflow.{WorkflowUtils, JsonExtractorOption}
+import org.apache.predictionio.workflow.JsonExtractorOption
 import org.apache.predictionio.workflow.JsonExtractorOption.JsonExtractorOption
 
 import java.io.File
-import java.net.URI
 import grizzled.slf4j.Logging
 
-import org.apache.hadoop.conf.Configuration
-import org.apache.hadoop.fs.FileSystem
-import org.apache.hadoop.fs.Path
-
 import scala.sys.process._
 
 case class WorkflowArgs(

http://git-wip-us.apache.org/repos/asf/incubator-predictionio/blob/68708b47/tools/src/main/scala/org/apache/predictionio/tools/commands/AccessKey.scala
----------------------------------------------------------------------
diff --git a/tools/src/main/scala/org/apache/predictionio/tools/commands/AccessKey.scala b/tools/src/main/scala/org/apache/predictionio/tools/commands/AccessKey.scala
index 715cf8f..95acc92 100644
--- a/tools/src/main/scala/org/apache/predictionio/tools/commands/AccessKey.scala
+++ b/tools/src/main/scala/org/apache/predictionio/tools/commands/AccessKey.scala
@@ -18,13 +18,9 @@
 package org.apache.predictionio.tools.commands
 
 import org.apache.predictionio.data.storage
-import org.apache.predictionio.tools
 import org.apache.predictionio.tools.EitherLogging
 import org.apache.predictionio.tools.ReturnTypes._
 
-import grizzled.slf4j.Logging
-import scala.util.Either
-
 object AccessKey extends EitherLogging {
 
   def create(

http://git-wip-us.apache.org/repos/asf/incubator-predictionio/blob/68708b47/tools/src/main/scala/org/apache/predictionio/tools/commands/Engine.scala
----------------------------------------------------------------------
diff --git a/tools/src/main/scala/org/apache/predictionio/tools/commands/Engine.scala b/tools/src/main/scala/org/apache/predictionio/tools/commands/Engine.scala
index c4dc8d4..3924117 100644
--- a/tools/src/main/scala/org/apache/predictionio/tools/commands/Engine.scala
+++ b/tools/src/main/scala/org/apache/predictionio/tools/commands/Engine.scala
@@ -29,13 +29,6 @@ import org.apache.predictionio.tools.ReturnTypes._
 import org.apache.predictionio.workflow.WorkflowUtils
 
 import org.apache.commons.io.FileUtils
-import org.json4s.native.Serialization.read
-import org.json4s._
-import org.json4s.native.JsonMethods._
-import org.json4s.native.Serialization.read
-import org.json4s.native.Serialization.write
-import scala.io.Source
-import scala.util.Random
 import scala.collection.JavaConversions._
 import scala.sys.process._
 import scalaj.http.Http

http://git-wip-us.apache.org/repos/asf/incubator-predictionio/blob/68708b47/tools/src/main/scala/org/apache/predictionio/tools/commands/Template.scala
----------------------------------------------------------------------
diff --git a/tools/src/main/scala/org/apache/predictionio/tools/commands/Template.scala b/tools/src/main/scala/org/apache/predictionio/tools/commands/Template.scala
index 1476598..8c6b288 100644
--- a/tools/src/main/scala/org/apache/predictionio/tools/commands/Template.scala
+++ b/tools/src/main/scala/org/apache/predictionio/tools/commands/Template.scala
@@ -21,13 +21,11 @@ import java.io.File
 
 import scala.io.Source
 
-import grizzled.slf4j.Logging
 import org.apache.predictionio.core.BuildInfo
 import org.apache.predictionio.tools.EitherLogging
 import org.apache.predictionio.tools.ReturnTypes._
 import org.json4s._
 import org.json4s.native.JsonMethods._
-import org.json4s.native.Serialization.{write, read}
 import semverfi._
 
 case class TemplateMetaData(

http://git-wip-us.apache.org/repos/asf/incubator-predictionio/blob/68708b47/tools/src/main/scala/org/apache/predictionio/tools/console/Console.scala
----------------------------------------------------------------------
diff --git a/tools/src/main/scala/org/apache/predictionio/tools/console/Console.scala b/tools/src/main/scala/org/apache/predictionio/tools/console/Console.scala
index 810fee0..535905a 100644
--- a/tools/src/main/scala/org/apache/predictionio/tools/console/Console.scala
+++ b/tools/src/main/scala/org/apache/predictionio/tools/console/Console.scala
@@ -22,31 +22,17 @@ import java.io.File
 import java.net.URI
 
 import grizzled.slf4j.Logging
-import org.apache.commons.io.FileUtils
-import org.apache.predictionio.controller.Utils
 import org.apache.predictionio.core.BuildInfo
-import org.apache.predictionio.data.api.{EventServer, EventServerConfig}
-import org.apache.predictionio.data.storage
-import org.apache.predictionio.tools.{RunServer, RunWorkflow, Common}
 import org.apache.predictionio.tools.commands.{
   DashboardArgs, AdminServerArgs, ImportArgs, ExportArgs,
   BuildArgs, EngineArgs}
 import org.apache.predictionio.tools.{
   EventServerArgs, SparkArgs, WorkflowArgs, ServerArgs, DeployArgs}
-import org.apache.predictionio.tools.EventServerArgs
-import org.apache.predictionio.tools.admin.{AdminServer, AdminServerConfig}
-import org.apache.predictionio.tools.dashboard.{Dashboard, DashboardConfig}
-import org.apache.predictionio.tools.commands
 import org.apache.predictionio.workflow.{JsonExtractorOption, WorkflowUtils}
-import org.apache.predictionio.workflow.JsonExtractorOption.JsonExtractorOption
 import org.json4s._
 import org.json4s.native.JsonMethods._
-import semverfi._
 
-import scala.collection.JavaConversions._
 import scala.io.Source
-import scala.sys.process._
-import scalaj.http.Http
 
 case class ConsoleArgs(
   build: BuildArgs = BuildArgs(),

http://git-wip-us.apache.org/repos/asf/incubator-predictionio/blob/68708b47/tools/src/main/scala/org/apache/predictionio/tools/console/Pio.scala
----------------------------------------------------------------------
diff --git a/tools/src/main/scala/org/apache/predictionio/tools/console/Pio.scala b/tools/src/main/scala/org/apache/predictionio/tools/console/Pio.scala
index 19d7590..dd78717 100644
--- a/tools/src/main/scala/org/apache/predictionio/tools/console/Pio.scala
+++ b/tools/src/main/scala/org/apache/predictionio/tools/console/Pio.scala
@@ -19,25 +19,15 @@ package org.apache.predictionio.tools.console
 
 import org.apache.predictionio.tools.{
   EventServerArgs, SparkArgs, WorkflowArgs, ServerArgs, DeployArgs}
-import org.apache.predictionio.tools.commands.Management
 import org.apache.predictionio.tools.commands.{
   DashboardArgs, AdminServerArgs, ImportArgs, ExportArgs,
-  BuildArgs, EngineArgs, AppDescription}
-import org.apache.predictionio.tools.commands.Engine
-import org.apache.predictionio.tools.commands.{
+  BuildArgs, EngineArgs, Management, Engine, Import, Export,
   App => AppCmd, AccessKey => AccessKeysCmd}
 import org.apache.predictionio.tools.ReturnTypes._
-import org.apache.predictionio.tools.commands.Import
-import org.apache.predictionio.tools.commands.Export
 
 import grizzled.slf4j.Logging
-import scala.concurrent.{Future, ExecutionContext, Await}
-import scala.concurrent.duration._
 import scala.language.implicitConversions
 import scala.sys.process._
-import java.io.File
-
-import akka.actor.ActorSystem
 
 object Pio extends Logging {
 

http://git-wip-us.apache.org/repos/asf/incubator-predictionio/blob/68708b47/tools/src/main/scala/org/apache/predictionio/tools/dashboard/CorsSupport.scala
----------------------------------------------------------------------
diff --git a/tools/src/main/scala/org/apache/predictionio/tools/dashboard/CorsSupport.scala
b/tools/src/main/scala/org/apache/predictionio/tools/dashboard/CorsSupport.scala
index 9f7678f..1026996 100644
--- a/tools/src/main/scala/org/apache/predictionio/tools/dashboard/CorsSupport.scala
+++ b/tools/src/main/scala/org/apache/predictionio/tools/dashboard/CorsSupport.scala
@@ -22,7 +22,6 @@ package org.apache.predictionio.tools.dashboard
 
 import spray.http.{HttpMethods, HttpMethod, HttpResponse, AllOrigins}
 import spray.http.HttpHeaders._
-import spray.http.HttpMethods._
 import spray.http.HttpEntity
 import spray.routing._
 import spray.http.StatusCodes

http://git-wip-us.apache.org/repos/asf/incubator-predictionio/blob/68708b47/tools/src/main/scala/org/apache/predictionio/tools/dashboard/Dashboard.scala
----------------------------------------------------------------------
diff --git a/tools/src/main/scala/org/apache/predictionio/tools/dashboard/Dashboard.scala
b/tools/src/main/scala/org/apache/predictionio/tools/dashboard/Dashboard.scala
index 2e9fb26..7d651b1 100644
--- a/tools/src/main/scala/org/apache/predictionio/tools/dashboard/Dashboard.scala
+++ b/tools/src/main/scala/org/apache/predictionio/tools/dashboard/Dashboard.scala
@@ -23,8 +23,7 @@ import org.apache.predictionio.authentication.KeyAuthentication
 import org.apache.predictionio.configuration.SSLConfiguration
 import org.apache.predictionio.data.storage.Storage
 import spray.can.server.ServerSettings
-import spray.routing.directives.AuthMagnet
-import scala.concurrent.{Future, ExecutionContext}
+import scala.concurrent.ExecutionContext
 import akka.actor.{ActorContext, Actor, ActorSystem, Props}
 import akka.io.IO
 import akka.pattern.ask
@@ -35,7 +34,6 @@ import spray.can.Http
 import spray.http._
 import spray.http.MediaTypes._
 import spray.routing._
-import spray.routing.authentication.{Authentication, UserPass, BasicAuth}
 
 import scala.concurrent.duration._
 


Mime
View raw message