Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/8880#discussion_r46486019
  
    --- Diff: 
core/src/main/scala/org/apache/spark/shuffle/BlockStoreShuffleReader.scala ---
    @@ -48,14 +50,25 @@ private[spark] class BlockStoreShuffleReader[K, C](
           // Note: we use getSizeAsMb when no suffix is provided for backwards 
compatibility
           SparkEnv.get.conf.getSizeAsMb("spark.reducer.maxSizeInFlight", 
"48m") * 1024 * 1024)
     
    -    // Wrap the streams for compression based on configuration
    -    val wrappedStreams = blockFetcherItr.map { case (blockId, inputStream) 
=>
    -      blockManager.wrapForCompression(blockId, inputStream)
    -    }
    -
         val ser = Serializer.getSerializer(dep.serializer)
         val serializerInstance = ser.newInstance()
     
    +    // Wrap the streams for compression and encryption based on 
configuration
    +    val wrappedStreams = blockFetcherItr.map { case (blockId, inputStream) 
=>
    +      val sparkConf = blockManager.conf
    +      if (CryptoConf.isShuffleEncrypted(sparkConf)) {
    +        if (SparkHadoopUtil.get.isYarnMode()) {
    +          val cis = CryptoStreamUtils.createCryptoInputStream(inputStream, 
sparkConf)
    +          blockManager.wrapForCompression(blockId, cis)
    --- End diff --
    
    Wouldn't it be more effective if you encrypted the compressed stream, 
instead of the other way around?


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to