Class ParallelOptions
- java.lang.Object
-
- com.aspose.zip.ParallelOptions
-
public class ParallelOptions extends Object
Options for parallel compression.
try (Archive archive = new Archive()) { archive.createEntries("DirToCompress"); ParallelOptions parallelOptions = new ParallelOptions(); parallelOptions.setParallelCompressInMemory(mode); parallelOptions.setAvailableMemorySize(4000); ArchiveSaveOptions archiveSaveOptions = new ArchiveSaveOptions(); archiveSaveOptions.setParallelOptions(parallelOptions); archive.save("archive.zip", archiveSaveOptions); }These options manage simultaneous compression by several CPU cores.
-
-
Constructor Summary
Constructors Constructor Description ParallelOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetAvailableMemorySize()Gets memory estimate in megabytes available to accomodate compressed entries without a swap to disk.ParallelCompressionModegetParallelCompressInMemory()Gets value indicating how parallel approach to be used.voidsetAvailableMemorySize(int value)Sets memory estimate in megabytes available to accomodate compressed entries without a swap to disk.voidsetParallelCompressInMemory(ParallelCompressionMode value)Sets value indicating how parallel approach to be used.
-
-
-
Method Detail
-
getParallelCompressInMemory
public final ParallelCompressionMode getParallelCompressInMemory()
Gets value indicating how parallel approach to be used.
- Returns:
- value indicating how parallel approach to be used.
-
setParallelCompressInMemory
public final void setParallelCompressInMemory(ParallelCompressionMode value)
Sets value indicating how parallel approach to be used.
- Parameters:
value- value indicating how parallel approach to be used.
-
getAvailableMemorySize
public final int getAvailableMemorySize()
Gets memory estimate in megabytes available to accomodate compressed entries without a swap to disk. This value only makes sense if
getParallelCompressInMemory()setting is inParallelCompressionMode.Automode.This value is used to calculate the biggest size of entry that can be compressed in parallel with others. All entries above the calculated threshold will be compressed sequentially. It is safe to have
getAvailableMemorySize()property as big as free RAM and even bigger. By default it is assumed you have at least 200MB per CPU core.- Returns:
- memory estimate in megabytes available to accomodate compressed entries without a swap to disk.
-
setAvailableMemorySize
public final void setAvailableMemorySize(int value)
Sets memory estimate in megabytes available to accomodate compressed entries without a swap to disk. This value only makes sense if
getParallelCompressInMemory()setting is inParallelCompressionMode.Automode.This value is used to calculate the biggest size of entry that can be compressed in parallel with others. All entries above the calculated threshold will be compressed sequentially. It is safe to have
getAvailableMemorySize()property as big as free RAM and even bigger. By default it is assumed you have at least 200MB per CPU core.- Parameters:
value- memory estimate in megabytes available to accomodate compressed entries without a swap to disk.
-
-