Class ParallelScatterZipCreator


  • public class ParallelScatterZipCreator
    extends Object
    Creates a zip in parallel by using multiple threadlocal ScatterZipOutputStream instances.

    Note that until 1.18, this class generally made no guarantees about the order of things written to the output file. Things that needed to come in a specific order (manifests, directories) had to be handled by the client of this class, usually by writing these things to the ZipArchiveOutputStream before calling writeTo on this class.

    The client can supply an ExecutorService, but for reasons of memory model consistency, this will be shut down by this class prior to completion.

    Since:
    1.10
    • Constructor Detail

      • ParallelScatterZipCreator

        public ParallelScatterZipCreator()
        Create a ParallelScatterZipCreator with default threads, which is set to the number of available processors, as defined by Runtime.availableProcessors()
      • ParallelScatterZipCreator

        public ParallelScatterZipCreator​(ExecutorService executorService)
        Create a ParallelScatterZipCreator
        Parameters:
        executorService - The executorService to use for parallel scheduling. For technical reasons, this will be shut down by this class.
      • ParallelScatterZipCreator

        public ParallelScatterZipCreator​(ExecutorService executorService,
                                         ScatterGatherBackingStoreSupplier backingStoreSupplier)
        Create a ParallelScatterZipCreator
        Parameters:
        executorService - The executorService to use. For technical reasons, this will be shut down by this class.
        backingStoreSupplier - The supplier of backing store which shall be used
      • ParallelScatterZipCreator

        public ParallelScatterZipCreator​(ExecutorService executorService,
                                         ScatterGatherBackingStoreSupplier backingStoreSupplier,
                                         int compressionLevel)
                                  throws IllegalArgumentException
        Create a ParallelScatterZipCreator
        Parameters:
        executorService - The executorService to use. For technical reasons, this will be shut down by this class.
        backingStoreSupplier - The supplier of backing store which shall be used
        compressionLevel - The compression level used in compression, this value should be -1(default level) or between 0~9.
        Throws:
        IllegalArgumentException - if the compression level is illegal
        Since:
        1.21