Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package org.apache.spark.serializer

import java.io.{ByteArrayInputStream, ByteArrayOutputStream, FileInputStream, FileOutputStream}
import java.io.{ByteArrayInputStream, ByteArrayOutputStream}
import java.nio.ByteBuffer

import scala.collection.JavaConverters._
Expand All @@ -32,7 +32,6 @@ import org.apache.spark.{SharedSparkContext, SparkConf, SparkFunSuite}
import org.apache.spark.scheduler.HighlyCompressedMapStatus
import org.apache.spark.serializer.KryoTest._
import org.apache.spark.storage.BlockManagerId
import org.apache.spark.util.Utils

class KryoSerializerSuite extends SparkFunSuite with SharedSparkContext {
conf.set("spark.serializer", "org.apache.spark.serializer.KryoSerializer")
Expand Down Expand Up @@ -365,30 +364,6 @@ class KryoSerializerSuite extends SparkFunSuite with SharedSparkContext {
assert(thrown.getCause.isInstanceOf[KryoException])
}

test("SPARK-12222: deserialize RoaringBitmap throw Buffer underflow exception") {
val dir = Utils.createTempDir()
val tmpfile = dir.toString + "/RoaringBitmap"
val outStream = new FileOutputStream(tmpfile)
val output = new KryoOutput(outStream)
val bitmap = new RoaringBitmap
bitmap.add(1)
bitmap.add(3)
bitmap.add(5)
// Ignore Kryo because it doesn't use writeObject
bitmap.serialize(new KryoOutputObjectOutputBridge(null, output))
output.flush()
output.close()

val inStream = new FileInputStream(tmpfile)
val input = new KryoInput(inStream)
val ret = new RoaringBitmap
// Ignore Kryo because it doesn't use readObject
ret.deserialize(new KryoInputObjectInputBridge(null, input))
input.close()
assert(ret == bitmap)
Utils.deleteRecursively(dir)
}

test("KryoOutputObjectOutputBridge.writeObject and KryoInputObjectInputBridge.readObject") {
val kryo = new KryoSerializer(conf).newKryo()

Expand Down Expand Up @@ -462,6 +437,14 @@ class KryoSerializerSuite extends SparkFunSuite with SharedSparkContext {
testSerializerInstanceReuse(autoReset = autoReset, referenceTracking = referenceTracking)
}
}

test("SPARK-27216: test RoaringBitmap ser/dser with Kryo") {
val expected = new RoaringBitmap()
expected.add(1787)
val ser = new KryoSerializer(conf).newInstance()
val actual: RoaringBitmap = ser.deserialize(ser.serialize(expected))
assert(actual === expected)
}
}

class KryoSerializerAutoResetDisabledSuite extends SparkFunSuite with SharedSparkContext {
Expand Down
3 changes: 2 additions & 1 deletion dev/deps/spark-deps-hadoop-2.6
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
JavaEWAH-0.3.2.jar
RoaringBitmap-0.5.11.jar
RoaringBitmap-0.7.45.jar
ST4-4.0.4.jar
activation-1.1.1.jar
aircompressor-0.10.jar
Expand Down Expand Up @@ -176,6 +176,7 @@ scala-parser-combinators_2.11-1.1.0.jar
scala-reflect-2.11.12.jar
scala-xml_2.11-1.0.5.jar
shapeless_2.11-2.3.2.jar
shims-0.7.45.jar
slf4j-api-1.7.16.jar
slf4j-log4j12-1.7.16.jar
snakeyaml-1.15.jar
Expand Down
3 changes: 2 additions & 1 deletion dev/deps/spark-deps-hadoop-2.7
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
JavaEWAH-0.3.2.jar
RoaringBitmap-0.5.11.jar
RoaringBitmap-0.7.45.jar
ST4-4.0.4.jar
activation-1.1.1.jar
aircompressor-0.10.jar
Expand Down Expand Up @@ -177,6 +177,7 @@ scala-parser-combinators_2.11-1.1.0.jar
scala-reflect-2.11.12.jar
scala-xml_2.11-1.0.5.jar
shapeless_2.11-2.3.2.jar
shims-0.7.45.jar
slf4j-api-1.7.16.jar
slf4j-log4j12-1.7.16.jar
snakeyaml-1.15.jar
Expand Down
3 changes: 2 additions & 1 deletion dev/deps/spark-deps-hadoop-3.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
HikariCP-java7-2.4.12.jar
JavaEWAH-0.3.2.jar
RoaringBitmap-0.5.11.jar
RoaringBitmap-0.7.45.jar
ST4-4.0.4.jar
accessors-smart-1.2.jar
activation-1.1.1.jar
Expand Down Expand Up @@ -196,6 +196,7 @@ scala-parser-combinators_2.11-1.1.0.jar
scala-reflect-2.11.12.jar
scala-xml_2.11-1.0.5.jar
shapeless_2.11-2.3.2.jar
shims-0.7.45.jar
slf4j-api-1.7.16.jar
slf4j-log4j12-1.7.16.jar
snakeyaml-1.15.jar
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@
<dependency>
<groupId>org.roaringbitmap</groupId>
<artifactId>RoaringBitmap</artifactId>
<version>0.5.11</version>
<version>0.7.45</version>
</dependency>
<dependency>
<groupId>commons-net</groupId>
Expand Down