Github user vanzin commented on a diff in the pull request: https://github.com/apache/spark/pull/8880#discussion_r41586770 --- Diff: core/src/main/scala/org/apache/spark/storage/DiskBlockObjectWriter.scala --- @@ -80,12 +83,28 @@ private[spark] class DiskBlockObjectWriter( */ private var numRecordsWritten = 0 + private var sparkConf: SparkConf = null + def open(): DiskBlockObjectWriter = { if (hasBeenClosed) { throw new IllegalStateException("Writer already closed. Cannot be reopened.") } fos = new FileOutputStream(file, true) - ts = new TimeTrackingOutputStream(writeMetrics, fos) + if (CryptoConf.isShuffleEncryted(sparkConf)) { + val cryptoCodec: CryptoCodec = CryptoCodec.getInstance(sparkConf) --- End diff -- It feels like this code (and the respective code in that creates the input stream) should be in a helper method somewhere. That should make it easier to test `CryptoInputStream` and `CryptoOutputStream` in isolation.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org