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

    https://github.com/apache/spark/pull/5792#discussion_r31363747
  
    --- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
    @@ -777,6 +778,42 @@ private[spark] object Utils extends Logging {
       }
     
       /**
    +   * This method compresses the files passed in, and writes the compressed 
data out into the
    +   * [[OutputStream]] passed in. Each file is written as a new 
[[ZipEntry]] with its name being
    +   * the name of the file being compressed.
    +   */
    +  private[spark] def zipFilesToStream(
    +      files: Seq[Path],
    +      hadoopConf: Configuration,
    +      outputStream: OutputStream): Unit = {
    +    val fs = FileSystem.get(hadoopConf)
    +    val buffer = new Array[Byte](64 * 1024)
    +    val zipStream = Some(new ZipOutputStream(outputStream))
    +    try {
    +      files.foreach { remotePath =>
    +        val inputStream = Some(fs.open(remotePath, 1 * 1024 * 1024)) // 
1MB Buffer
    --- End diff --
    
    I don't think you gain anything by wrapping the zipStream & inputStream in 
a `Some`


---
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

Reply via email to