Github user ConeyLiu commented on a diff in the pull request: https://github.com/apache/spark/pull/20026#discussion_r157938250 --- Diff: core/src/main/scala/org/apache/spark/storage/DiskStore.scala --- @@ -208,7 +209,7 @@ private class EncryptedBlockData( conf: SparkConf, key: Array[Byte]) extends BlockData { - override def toInputStream(): InputStream = Channels.newInputStream(open()) + override def toInputStream(): InputStream = new NioBufferedFileInputStream(file) --- End diff -- You meaning the memory buffer? The `NioBufferedFileInputStream` has `close` method, you can see follow: org.apache.spark.io.NioBufferedFileInputStream.java ```java @Override public synchronized void close() throws IOException { fileChannel.close(); StorageUtils.dispose(byteBuffer); } @Override protected void finalize() throws IOException { close(); } ```
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org