org.apache.sysds.runtime.compress

## Class CompressionSettingsBuilder

- java.lang.Object
- - org.apache.sysds.runtime.compress.CompressionSettingsBuilder

-     public class CompressionSettingsBuilder
      extends Object

  Builder pattern for Compression Settings. See CompressionSettings for details on values.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CompressionSettingsBuilder()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `CompressionSettingsBuilder` | `addValidCompression(ColGroup.CompressionType cp)` Add a single valid compression type to the EnumSet of valid compressions.
    `CompressionSettingsBuilder` | `clearValidCompression()` Clear all the compression types allowed in the compression.
    `CompressionSettingsBuilder` | `copySettings(CompressionSettings that)` Copy the settings from another CompressionSettings Builder, modifies this, not that.
    `CompressionSettings` | `create()` Create the CompressionSettings object to use in the compression.
    `CompressionSettingsBuilder` | `setAllowSharedDictionary(boolean allowSharedDictionary)` Allow the Dictionaries to be shared between different column groups.
    `CompressionSettingsBuilder` | `setColumnPartitioner(PlanningCoCoder.PartitionerType columnPartitioner)` Set the type of CoCoding Partitioner type to use for combining columns together.
    `CompressionSettingsBuilder` | `setInvestigateEstimate(boolean investigateEstimate)` Set if the compression should be investigated while compressing.
    `CompressionSettingsBuilder` | `setLossy(boolean lossy)` Set the Compression to use Lossy compression.
    `CompressionSettingsBuilder` | `setmaxStaticColGroupCoCode(int maxStaticColGroupCoCode)` Set the maximum number of columns to CoCode together in the static CoCoding strategy.
    `CompressionSettingsBuilder` | `setSamplingRatio(double samplingRatio)` Set the sampling ratio in percent to sample the input matrix.
    `CompressionSettingsBuilder` | `setSeed(int seed)` Set the seed for the compression operation.
    `CompressionSettingsBuilder` | `setSkipList(boolean skipList)` Specify if the Offset list encoding should utilize skip lists.
    `CompressionSettingsBuilder` | `setSortValuesByLength(boolean sortValuesByLength)` Set the sortValuesByLength flag.
    `CompressionSettingsBuilder` | `setTransposeInput(boolean transposeInput)` Specify if the input matrix should be transposed before compression.
    `CompressionSettingsBuilder` | `setValidCompressions(EnumSet<ColGroup.CompressionType> validCompressions)` Set the valid compression strategies used for the compression.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CompressionSettingsBuilder

          public CompressionSettingsBuilder()

  - ### Method Detail

    - #### copySettings

          public CompressionSettingsBuilder copySettings(CompressionSettings that)

      Copy the settings from another CompressionSettings Builder, modifies this, not that.
      Parameters:
        `that` - The other CompressionSettingsBuilder to copy settings from.
      Returns:
        The modified CompressionSettings in the same object.

    - #### setLossy

          public CompressionSettingsBuilder setLossy(boolean lossy)

      Set the Compression to use Lossy compression.
      Parameters:
        `lossy` - A boolean specifying if the compression should be lossy
      Returns:
        The CompressionSettingsBuilder

    - #### setSamplingRatio

          public CompressionSettingsBuilder setSamplingRatio(double samplingRatio)

      Set the sampling ratio in percent to sample the input matrix. Input value should be in range 0.0 - 1.0
      Parameters:
        `samplingRatio` - The ratio to sample from the input
      Returns:
        The CompressionSettingsBuilder

    - #### setSortValuesByLength

          public CompressionSettingsBuilder setSortValuesByLength(boolean sortValuesByLength)

      Set the sortValuesByLength flag. This sorts the dictionaries containing the data based on their occurences in the ColGroup. Improving cache efficiency especially for diverse column groups.
      Parameters:
        `sortValuesByLength` - A boolean specifying if the values should be sorted
      Returns:
        The CompressionSettingsBuilder

    - #### setAllowSharedDictionary

          public CompressionSettingsBuilder setAllowSharedDictionary(boolean allowSharedDictionary)

      Allow the Dictionaries to be shared between different column groups.
      Parameters:
        `allowSharedDictionary` - A boolean specifying if the dictionary can be shared between column groups.
      Returns:
        The CompressionSettingsBuilder

    - #### setTransposeInput

          public CompressionSettingsBuilder setTransposeInput(boolean transposeInput)

      Specify if the input matrix should be transposed before compression. This improves cache efficiency while compression the input matrix
      Parameters:
        `transposeInput` - boolean specifying if the input should be transposed before compression
      Returns:
        The CompressionSettingsBuilder

    - #### setSkipList

          public CompressionSettingsBuilder setSkipList(boolean skipList)

      Specify if the Offset list encoding should utilize skip lists. This increase size of compression but improves performance in Offset encodings. OLE and RLE.
      Parameters:
        `skipList` - a boolean specifying if the skiplist function is enabled
      Returns:
        The CompressionSettingsBuilder

    - #### setSeed

          public CompressionSettingsBuilder setSeed(int seed)

      Set the seed for the compression operation.
      Parameters:
        `seed` - The seed used in sampling the matrix and general operations in the compression.
      Returns:
        The CompressionSettingsBuilder

    - #### setInvestigateEstimate

          public CompressionSettingsBuilder setInvestigateEstimate(boolean investigateEstimate)

      Set if the compression should be investigated while compressing.
      Parameters:
        `investigateEstimate` - A boolean specifying it the input should be estimated.
      Returns:
        The CompressionSettingsBuilder

    - #### setValidCompressions

          public CompressionSettingsBuilder setValidCompressions(EnumSet<ColGroup.CompressionType> validCompressions)

      Set the valid compression strategies used for the compression.
      Parameters:
        `validCompressions` - An EnumSet of CompressionTypes to use in the compression
      Returns:
        The CompressionSettingsBuilder

    - #### addValidCompression

          public CompressionSettingsBuilder addValidCompression(ColGroup.CompressionType cp)

      Add a single valid compression type to the EnumSet of valid compressions.
      Parameters:
        `cp` - The compression type to add to the valid ones.
      Returns:
        The CompressionSettingsBuilder

    - #### clearValidCompression

          public CompressionSettingsBuilder clearValidCompression()

      Clear all the compression types allowed in the compression. This will only allow the Uncompressed ColGroup type. Since this is required for operation of the compression
      Returns:
        The CompressionSettingsBuilder

    - #### setColumnPartitioner

          public CompressionSettingsBuilder setColumnPartitioner(PlanningCoCoder.PartitionerType columnPartitioner)

      Set the type of CoCoding Partitioner type to use for combining columns together.
      Parameters:
        `columnPartitioner` - The Strategy to select from PartitionerType
      Returns:
        The CompressionSettingsBuilder

    - #### setmaxStaticColGroupCoCode

          public CompressionSettingsBuilder setmaxStaticColGroupCoCode(int maxStaticColGroupCoCode)

      Set the maximum number of columns to CoCode together in the static CoCoding strategy. Compression time increase with higher numbers.
      Parameters:
        `maxStaticColGroupCoCode` - The max selected.
      Returns:
        The CompressionSettingsBuilder

    - #### create

          public CompressionSettings create()

      Create the CompressionSettings object to use in the compression.
      Returns:
        The CompressionSettings

Copyright © 2020 The Apache Software Foundation. All rights reserved.