Skip to content

Commit 75ba026

Browse files
author
Sergei Lebedev
committed
[SPARK-20284][CORE] Make {Des,S}erializationStream extend Closeable
This change allows to use these streams in try-with-resources.
1 parent a26e3ed commit 75ba026

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/main/scala/org/apache/spark/serializer/Serializer.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ abstract class SerializerInstance {
125125
* A stream for writing serialized objects.
126126
*/
127127
@DeveloperApi
128-
abstract class SerializationStream {
128+
abstract class SerializationStream extends Closeable {
129129
/** The most general-purpose method to write an object. */
130130
def writeObject[T: ClassTag](t: T): SerializationStream
131131
/** Writes the object representing the key of a key-value pair. */
@@ -149,7 +149,7 @@ abstract class SerializationStream {
149149
* A stream for reading serialized objects.
150150
*/
151151
@DeveloperApi
152-
abstract class DeserializationStream {
152+
abstract class DeserializationStream extends Closeable {
153153
/** The most general-purpose method to read an object. */
154154
def readObject[T: ClassTag](): T
155155
/** Reads the object representing the key of a key-value pair. */

0 commit comments

Comments
 (0)