Class ParallelZipCopyAction
- All Implemented Interfaces:
org.gradle.api.internal.file.copy.CopyAction
ParallelZipWriter. Gradle resolves the whole
CopySpec (all from/into/include/exclude/
rename/filter, plus duplicate handling and reproducible ordering via its
decorators) and streams the final files here; we hand each off to the parallel writer, so
the archive is built across all cores.
An entry with no content filter/transform configured is handed off as a reference to its
real source file, read lazily on a worker thread at compress time -- same as the streamed/
spilled path already does. This is safe because Gradle's own FileCopyDetails only
exposes the real file when no filter is present: getFile() and open() share
the identical guard, so whenever getFile() doesn't throw, it returns exactly the
bytes open() would have. A filtered entry's content is a transformed stream, not a
real file, so it's still consumed on this (single-threaded) stream iteration -- Gradle's
filter chain has to run through its own API. Small entries are buffered in memory; entries
over the spill threshold are copied to a temp file. Backpressure from the
ParallelZipWriter.Sink bounds how many entries are materialized/queued at once.
-
Constructor Summary
ConstructorsConstructorDescriptionParallelZipCopyAction(Path archive, boolean store, boolean skipAlreadyCompressed, int level, int threads, boolean preserveTimestamps, long spillThreshold) -
Method Summary
Modifier and TypeMethodDescriptionorg.gradle.api.tasks.WorkResultexecute(org.gradle.api.internal.file.copy.CopyActionProcessingStream stream)
-
Constructor Details
-
ParallelZipCopyAction
public ParallelZipCopyAction(Path archive, boolean store, boolean skipAlreadyCompressed, int level, int threads, boolean preserveTimestamps, long spillThreshold)
-
-
Method Details
-
execute
public org.gradle.api.tasks.WorkResult execute(org.gradle.api.internal.file.copy.CopyActionProcessingStream stream) - Specified by:
executein interfaceorg.gradle.api.internal.file.copy.CopyAction
-