From 67448240623ba5f4a26624ceaee746d0a89df3e9 Mon Sep 17 00:00:00 2001 From: "przemyslaw.piotrowski" Date: Mon, 30 Sep 2019 15:13:06 +0200 Subject: [PATCH 1/7] Update dependencies --- .travis.yml | 8 +++++--- build.sbt | 6 +++--- project/build.properties | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 790059e..d7ee885 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: scala scala: - - 2.11.8 - - 2.12.1 + - 2.11.12 + - 2.12.10 sudo: false @@ -20,7 +20,9 @@ before_cache: - find $HOME/.sbt -name "*.lock" -delete jdk: - - oraclejdk8 + - openjdk8 + - openjdk11 + - openjdk12 addons: apt: diff --git a/build.sbt b/build.sbt index 1e8ba7a..e590f6d 100644 --- a/build.sbt +++ b/build.sbt @@ -2,8 +2,8 @@ sonatypeProfileName := "org.xerial" import ReleaseTransformations._ -val SCALA_VERSION = "2.12.4" -val CROSS_SCALA_VERSIONS = Seq(SCALA_VERSION, "2.11.11") +val SCALA_VERSION = "2.12.10" +val CROSS_SCALA_VERSIONS = Seq(SCALA_VERSION, "2.11.12") scalaVersion in ThisBuild := SCALA_VERSION val buildSettings = Defaults.coreDefaultSettings ++ Seq( @@ -137,7 +137,7 @@ lazy val larrayBuffer = Project( crossPaths := false, autoScalaLibrary := false, libraryDependencies ++= Seq( - "org.scalatest" %% "scalatest" % "3.0.1" % "test", + "org.scalatest" %% "scalatest" % "3.0.8" % "test", "org.wvlet" %% "wvlet-log" % "1.1" % "test" ) ) diff --git a/project/build.properties b/project/build.properties index 27e88aa..8e682c5 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=0.13.13 +sbt.version=0.13.18 From 9479eecaddf43a52a9e77f6b168d9253fc1a5148 Mon Sep 17 00:00:00 2001 From: "przemyslaw.piotrowski" Date: Mon, 30 Sep 2019 15:18:46 +0200 Subject: [PATCH 2/7] Remove oracle-8 references --- .travis.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index d7ee885..ceb4045 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,8 +23,3 @@ jdk: - openjdk8 - openjdk11 - openjdk12 - -addons: - apt: - packages: - - oracle-java8-installer From 8e3c0865500f2732c97d5c4703bb406a4e43a0e8 Mon Sep 17 00:00:00 2001 From: "przemyslaw.piotrowski" Date: Mon, 30 Sep 2019 15:24:47 +0200 Subject: [PATCH 3/7] Only jvm8 by now --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ceb4045..077aa19 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,5 +21,4 @@ before_cache: jdk: - openjdk8 - - openjdk11 - - openjdk12 + From 7bc34ff83d45ea8f84ebc9e1a935d75f0be723fb Mon Sep 17 00:00:00 2001 From: "przemyslaw.piotrowski" Date: Mon, 30 Sep 2019 16:26:36 +0200 Subject: [PATCH 4/7] Initial migration to scala 2.13 Bump vwlet logger (it has some flaws in tests logs) Parallel tests no longer parallel Get rid of akka dependencies --- build.sbt | 14 ++++++-------- .../scala/xerial/larray/buffer/LBufferTest.scala | 5 +++-- .../xerial/larray/buffer/MemoryAllocatorTest.scala | 8 +++++--- .../main/scala/xerial/larray/LArrayBuilder.scala | 4 ++-- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/build.sbt b/build.sbt index e590f6d..ad45286 100644 --- a/build.sbt +++ b/build.sbt @@ -2,8 +2,8 @@ sonatypeProfileName := "org.xerial" import ReleaseTransformations._ -val SCALA_VERSION = "2.12.10" -val CROSS_SCALA_VERSIONS = Seq(SCALA_VERSION, "2.11.12") +val SCALA_VERSION = "2.13.1" +val CROSS_SCALA_VERSIONS = Seq(SCALA_VERSION, "2.11.12", "2.12.10") scalaVersion in ThisBuild := SCALA_VERSION val buildSettings = Defaults.coreDefaultSettings ++ Seq( @@ -116,15 +116,13 @@ lazy val larrayScala = Project( }, libraryDependencies ++= Seq( // Add dependent jars here - "org.wvlet" %% "wvlet-log" % "1.1", + "org.wvlet.airframe" %% "airframe-log" % "19.9.8", snappy % "test", junit, "org.iq80.snappy" % "snappy" % "0.3" % "test", "com.novocode" % "junit-interface" % "0.11" % "test", - "org.scalatest" %% "scalatest" % "3.0.1" % "test", - "org.scalacheck" %% "scalacheck" % "1.13.4" % "test", - "com.typesafe.akka" %% "akka-testkit" % "[2.3.14, 2.5)" % "test", - "com.typesafe.akka" %% "akka-multi-node-testkit" % "[2.3.14, 2.5)" % "test" + "org.scalatest" %% "scalatest" % "3.0.8" % "test", + "org.scalacheck" %% "scalacheck" % "1.14.0" % "test" ) ) ) dependsOn(larrayBuffer % scope, larrayMMap) configs (MultiJvm) @@ -138,7 +136,7 @@ lazy val larrayBuffer = Project( autoScalaLibrary := false, libraryDependencies ++= Seq( "org.scalatest" %% "scalatest" % "3.0.8" % "test", - "org.wvlet" %% "wvlet-log" % "1.1" % "test" + "org.wvlet.airframe" %% "airframe-log" % "19.9.8" ) ) ) diff --git a/larray-buffer/src/test/scala/xerial/larray/buffer/LBufferTest.scala b/larray-buffer/src/test/scala/xerial/larray/buffer/LBufferTest.scala index 8209a53..0d50bbb 100644 --- a/larray-buffer/src/test/scala/xerial/larray/buffer/LBufferTest.scala +++ b/larray-buffer/src/test/scala/xerial/larray/buffer/LBufferTest.scala @@ -106,7 +106,8 @@ class LBufferTest extends LArraySpec { "allocate concurrently" taggedAs("bench") in { val N = 100 - def range = (0 until N).par + // todo parallel not easily supported in 2.13 + def range = (0 until N) val R = 2 val S = 1024 * 1024 @@ -206,4 +207,4 @@ class LBufferTest extends LArraySpec { } } -} \ No newline at end of file +} diff --git a/larray-buffer/src/test/scala/xerial/larray/buffer/MemoryAllocatorTest.scala b/larray-buffer/src/test/scala/xerial/larray/buffer/MemoryAllocatorTest.scala index a743258..c7220a8 100644 --- a/larray-buffer/src/test/scala/xerial/larray/buffer/MemoryAllocatorTest.scala +++ b/larray-buffer/src/test/scala/xerial/larray/buffer/MemoryAllocatorTest.scala @@ -37,7 +37,8 @@ class MemoryAllocatorTest extends LArraySpec { val t = time("alloc", repeat = 5) { block("concurrent") { - val l = for (i <- (0 until N).par) yield { + // todo parallel not easily supported in 2.13 + val l = for (i <- (0 until N)) yield { val a = new LBuffer(B) a(B-1) = 1.toByte a @@ -46,7 +47,8 @@ class MemoryAllocatorTest extends LArraySpec { } block("Array") { - val l = for (i <- (0 until N).par) yield { + // todo parallel not easily supported in 2.13 + val l = for (i <- (0 until N)) yield { val a = new Array[Int](B) a(B-1) = 1 a @@ -56,4 +58,4 @@ class MemoryAllocatorTest extends LArraySpec { t("concurrent") should be <= (t("Array")) } } -} \ No newline at end of file +} diff --git a/larray/src/main/scala/xerial/larray/LArrayBuilder.scala b/larray/src/main/scala/xerial/larray/LArrayBuilder.scala index 86403ab..dae5bb7 100644 --- a/larray/src/main/scala/xerial/larray/LArrayBuilder.scala +++ b/larray/src/main/scala/xerial/larray/LArrayBuilder.scala @@ -57,7 +57,7 @@ trait LBuilder[Elem, +To] extends WritableByteChannel { * @param xs the TraversableOnce producing the elements to add. * @return the coll itself. */ - def ++=(xs: TraversableOnce[Elem]): this.type = {xs.seq foreach +=; this} + def ++=(xs: TraversableOnce[Elem]): this.type = {xs.iterator.foreach( += ); this} def ++=(xs: LIterator[Elem]): this.type = {xs foreach +=; this} @@ -426,4 +426,4 @@ object LArrayBuilder { } } -} \ No newline at end of file +} From 5e17756f4c3a2588ce91ef889b49a40040a77948 Mon Sep 17 00:00:00 2001 From: "przemyslaw.piotrowski" Date: Mon, 30 Sep 2019 16:30:04 +0200 Subject: [PATCH 5/7] Test migration to 2.13 in travis --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 077aa19..c45f53f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ language: scala scala: - 2.11.12 - 2.12.10 + - 2.13.1 sudo: false From 0a05755065ca592e57d4f230d3fc429fac8013fc Mon Sep 17 00:00:00 2001 From: "przemyslaw.piotrowski" Date: Mon, 30 Sep 2019 16:41:35 +0200 Subject: [PATCH 6/7] use binary compatible method --- larray/src/main/scala/xerial/larray/LArrayBuilder.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/larray/src/main/scala/xerial/larray/LArrayBuilder.scala b/larray/src/main/scala/xerial/larray/LArrayBuilder.scala index dae5bb7..8f38de5 100644 --- a/larray/src/main/scala/xerial/larray/LArrayBuilder.scala +++ b/larray/src/main/scala/xerial/larray/LArrayBuilder.scala @@ -57,7 +57,7 @@ trait LBuilder[Elem, +To] extends WritableByteChannel { * @param xs the TraversableOnce producing the elements to add. * @return the coll itself. */ - def ++=(xs: TraversableOnce[Elem]): this.type = {xs.iterator.foreach( += ); this} + def ++=(xs: TraversableOnce[Elem]): this.type = {xs.toSeq.foreach( += ); this} def ++=(xs: LIterator[Elem]): this.type = {xs foreach +=; this} From db3f71f990b91c5ab7de06a1aedab00bb8422da1 Mon Sep 17 00:00:00 2001 From: "przemyslaw.piotrowski" Date: Fri, 18 Oct 2019 17:43:24 +0200 Subject: [PATCH 7/7] Give back parallel ranges to test purposes --- build.sbt | 16 ++++++++++++---- .../scala/xerial/larray/buffer/LBufferTest.scala | 4 ++-- .../larray/buffer/MemoryAllocatorTest.scala | 8 ++++---- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/build.sbt b/build.sbt index ad45286..a4c6cde 100644 --- a/build.sbt +++ b/build.sbt @@ -134,10 +134,18 @@ lazy val larrayBuffer = Project( description := "LArray off-heap buffer library", crossPaths := false, autoScalaLibrary := false, - libraryDependencies ++= Seq( - "org.scalatest" %% "scalatest" % "3.0.8" % "test", - "org.wvlet.airframe" %% "airframe-log" % "19.9.8" - ) + libraryDependencies ++= { + val parallelCollections = CrossVersion.partialVersion(scalaVersion.value) match { + case Some((2, major)) if major >= 13 => + Seq("org.scala-lang.modules" %% "scala-parallel-collections" % "0.2.0" % "test") + case _ => + Seq() + } + Seq( + "org.scalatest" %% "scalatest" % "3.0.8" % "test", + "org.wvlet.airframe" %% "airframe-log" % "19.9.8" + ) ++ parallelCollections + } ) ) diff --git a/larray-buffer/src/test/scala/xerial/larray/buffer/LBufferTest.scala b/larray-buffer/src/test/scala/xerial/larray/buffer/LBufferTest.scala index 0d50bbb..7e25144 100644 --- a/larray-buffer/src/test/scala/xerial/larray/buffer/LBufferTest.scala +++ b/larray-buffer/src/test/scala/xerial/larray/buffer/LBufferTest.scala @@ -106,8 +106,8 @@ class LBufferTest extends LArraySpec { "allocate concurrently" taggedAs("bench") in { val N = 100 - // todo parallel not easily supported in 2.13 - def range = (0 until N) + + def range = collection.parallel.immutable.ParRange(0, N, 1, inclusive = false) val R = 2 val S = 1024 * 1024 diff --git a/larray-buffer/src/test/scala/xerial/larray/buffer/MemoryAllocatorTest.scala b/larray-buffer/src/test/scala/xerial/larray/buffer/MemoryAllocatorTest.scala index c7220a8..02fb267 100644 --- a/larray-buffer/src/test/scala/xerial/larray/buffer/MemoryAllocatorTest.scala +++ b/larray-buffer/src/test/scala/xerial/larray/buffer/MemoryAllocatorTest.scala @@ -37,8 +37,8 @@ class MemoryAllocatorTest extends LArraySpec { val t = time("alloc", repeat = 5) { block("concurrent") { - // todo parallel not easily supported in 2.13 - val l = for (i <- (0 until N)) yield { + val range = collection.parallel.immutable.ParRange(0, N, 1, inclusive = false) + val l = for (i <- range) yield { val a = new LBuffer(B) a(B-1) = 1.toByte a @@ -47,8 +47,8 @@ class MemoryAllocatorTest extends LArraySpec { } block("Array") { - // todo parallel not easily supported in 2.13 - val l = for (i <- (0 until N)) yield { + val range = collection.parallel.immutable.ParRange(0, N, 1, inclusive = false) + val l = for (i <- range) yield { val a = new Array[Int](B) a(B-1) = 1 a