CompressionParams (apache-cassandra API)
Date: 2018-02-14

org.apache.cassandra.schema

## Class CompressionParams

- java.lang.Object
- - org.apache.cassandra.schema.CompressionParams

-     public final class CompressionParams
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `CHUNK_LENGTH_IN_KB`
    `static java.lang.String` | `CHUNK_LENGTH_KB` Deprecated.
    `static java.lang.String` | `CLASS`
    `static java.lang.String` | `CRC_CHECK_CHANCE` Deprecated.
    `static CompressionParams` | `DEFAULT`
    `static int` | `DEFAULT_CHUNK_LENGTH`
    `static java.lang.String` | `ENABLED`
    `static IVersionedSerializer<CompressionParams>` | `serializer`
    `static java.lang.String` | `SSTABLE_COMPRESSION` Deprecated.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CompressionParams(java.lang.String sstableCompressorClass, java.lang.Integer chunkLength, java.util.Map<java.lang.String,java.lang.String> otherOptions)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.Map<java.lang.String,java.lang.String>` | `asMap()`
    `int` | `chunkLength()`
    `java.lang.String` | `chunkLengthInKB()`
    `static boolean` | `containsSstableCompressionClass(java.util.Map<java.lang.String,java.lang.String> options)` Returns `true` if the specified options contains the name of the compression class to be used, `false` otherwise.
    `CompressionParams` | `copy()`
    `static ICompressor` | `createCompressor(ParameterizedClass compression)`
    `static CompressionParams` | `deflate()`
    `static CompressionParams` | `deflate(java.lang.Integer chunkLength)`
    `boolean` | `equals(java.lang.Object obj)`
    `static CompressionParams` | `fromMap(java.util.Map<java.lang.String,java.lang.String> opts)`
    `double` | `getCrcCheckChance()`
    `com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String>` | `getOtherOptions()`
    `ICompressor` | `getSstableCompressor()` Returns the SSTable compressor.
    `int` | `hashCode()`
    `boolean` | `isEnabled()` Checks if compression is enabled.
    `static boolean` | `isEnabled(java.util.Map<java.lang.String,java.lang.String> options)` Returns `true` if the options contains the `enabled` option and that its value is `true`, otherwise returns `false`.
    `java.lang.Class<? extends ICompressor>` | `klass()`
    `static CompressionParams` | `lz4()`
    `static CompressionParams` | `lz4(java.lang.Integer chunkLength)`
    `static CompressionParams` | `noCompression()`
    `void` | `setCrcCheckChance(double crcCheckChance)`
    `static CompressionParams` | `snappy()`
    `static CompressionParams` | `snappy(java.lang.Integer chunkLength)`
    `void` | `validate()`

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

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_CHUNK_LENGTH

          public static final int DEFAULT_CHUNK_LENGTH

      See Also:
        Constant Field Values

    - #### serializer

          public static final IVersionedSerializer<CompressionParams> serializer

    - #### CLASS

          public static final java.lang.String CLASS

      See Also:
        Constant Field Values

    - #### CHUNK_LENGTH_IN_KB

          public static final java.lang.String CHUNK_LENGTH_IN_KB

      See Also:
        Constant Field Values

    - #### ENABLED

          public static final java.lang.String ENABLED

      See Also:
        Constant Field Values

    - #### DEFAULT

          public static final CompressionParams DEFAULT

    - #### SSTABLE_COMPRESSION

          @Deprecated
          public static final java.lang.String SSTABLE_COMPRESSION

      Deprecated.
      See Also:
        Constant Field Values

    - #### CHUNK_LENGTH_KB

          @Deprecated
          public static final java.lang.String CHUNK_LENGTH_KB

      Deprecated.
      See Also:
        Constant Field Values

    - #### CRC_CHECK_CHANCE

          @Deprecated
          public static final java.lang.String CRC_CHECK_CHANCE

      Deprecated.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### CompressionParams

          public CompressionParams(java.lang.String sstableCompressorClass,
                                   java.lang.Integer chunkLength,
                                   java.util.Map<java.lang.String,java.lang.String> otherOptions)
                            throws ConfigurationException

      Throws:
        `ConfigurationException`

  - ### Method Detail

    - #### fromMap

          public static CompressionParams fromMap(java.util.Map<java.lang.String,java.lang.String> opts)

    - #### klass

          public java.lang.Class<? extends ICompressor> klass()

    - #### noCompression

          public static CompressionParams noCompression()

    - #### snappy

          public static CompressionParams snappy()

    - #### snappy

          public static CompressionParams snappy(java.lang.Integer chunkLength)

    - #### deflate

          public static CompressionParams deflate()

    - #### deflate

          public static CompressionParams deflate(java.lang.Integer chunkLength)

    - #### lz4

          public static CompressionParams lz4()

    - #### lz4

          public static CompressionParams lz4(java.lang.Integer chunkLength)

    - #### copy

          public CompressionParams copy()

    - #### isEnabled

          public boolean isEnabled()

      Checks if compression is enabled.
      Returns:
        `true` if compression is enabled, `false` otherwise.

    - #### getSstableCompressor

          public ICompressor getSstableCompressor()

      Returns the SSTable compressor.
      Returns:
        the SSTable compressor or `null` if compression is disabled.

    - #### getOtherOptions

          public com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> getOtherOptions()

    - #### chunkLength

          public int chunkLength()

    - #### createCompressor

          public static ICompressor createCompressor(ParameterizedClass compression)
                                              throws ConfigurationException

      Throws:
        `ConfigurationException`

    - #### containsSstableCompressionClass

          public static boolean containsSstableCompressionClass(java.util.Map<java.lang.String,java.lang.String> options)

      Returns `true` if the specified options contains the name of the compression class to be used, `false` otherwise.
      Parameters:
        `options` - the options
      Returns:
        `true` if the specified options contains the name of the compression class to be used, `false` otherwise.

    - #### isEnabled

          public static boolean isEnabled(java.util.Map<java.lang.String,java.lang.String> options)

      Returns `true` if the options contains the `enabled` option and that its value is `true`, otherwise returns `false`.
      Parameters:
        `options` - the options
      Returns:
        `true` if the options contains the `enabled` option and that its value is `true`, otherwise returns `false`.

    - #### validate

          public void validate()
                        throws ConfigurationException

      Throws:
        `ConfigurationException`

    - #### asMap

          public java.util.Map<java.lang.String,java.lang.String> asMap()

    - #### chunkLengthInKB

          public java.lang.String chunkLengthInKB()

    - #### setCrcCheckChance

          public void setCrcCheckChance(double crcCheckChance)

    - #### getCrcCheckChance

          public double getCrcCheckChance()

    - #### equals

          public boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

Copyright © 2018 The Apache Software Foundation