Skip to content

Commit

Permalink
Write header before starting scribe
Browse files Browse the repository at this point in the history
  • Loading branch information
Friendseeker committed Oct 15, 2024
1 parent f043798 commit 9c7766a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ object ParallelGzipOutputStream {
}

override def run(): Unit = {
out.write(header)
loop()
}
}
Expand Down Expand Up @@ -128,6 +127,8 @@ final class ParallelGzipOutputStream(out: OutputStream, parallelism: Int)
private val workerCount = math.max(1, parallelism - 1)
private val workers = new ArrayBlockingQueue[Worker](workerCount)
private val buffers = new LinkedTransferQueue[Block]()

out.write(header)
private val scribe = new Scribe(out, buffers)
scribe.start()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class ParallelGzipOutputStreamSpecification extends AnyFlatSpec with Matchers {
def sanitizedFilename(fileName: String): String = {
fileName.replaceAll("[^a-zA-Z0-9-_.]", "_")
}

def handleFailure(
compressed: Array[Byte],
data: Array[Byte],
Expand Down

0 comments on commit 9c7766a

Please sign in to comment.