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

    https://github.com/apache/spark/pull/5792#discussion_r31554863
  
    --- Diff: 
core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala ---
    @@ -219,6 +221,67 @@ private[history] class FsHistoryProvider(conf: 
SparkConf, clock: Clock)
         }
       }
     
    +  override def writeEventLogs(
    +      appId: String,
    +      attemptId: Option[String],
    +      zipStream: ZipOutputStream): Unit = {
    +
    +    /**
    +     * 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.
    +     */
    +    def zipFileToStream(file: Path, entryName: String, outputStream: 
ZipOutputStream): Unit = {
    +      val fs = FileSystem.get(hadoopConf)
    +      val buffer = new Array[Byte](64 * 1024)
    +      val inputStream = fs.open(file, 1 * 1024 * 1024) // 1MB Buffer
    +      try {
    +        outputStream.putNextEntry(new ZipEntry(entryName))
    +        var dataRemaining = true
    +        while (dataRemaining) {
    --- End diff --
    
    I think I mentioned this earlier, but any reason not to use guava's 
`ByteStreams.copy()`?


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