Class CompressionConfig

java.lang.Object
com.couchbase.client.core.env.CompressionConfig

public class CompressionConfig extends Object
Allows configuring and customizing the compression configuration.
Since:
2.0.0
  • Field Details

  • Method Details

    • create

      @Deprecated public static CompressionConfig create()
      Deprecated.
      Instead, please use CoreEnvironment.Builder.compressionConfig(Consumer) and configure the builder passed to the consumer. Note: CoreEnvironment is a base class; you'll probably call that method via a subclass named ClusterEnvironment.
      Creates a CompressionConfig with default arguments.
      Returns:
      a new CompressionConfig.
    • builder

      @Deprecated public static CompressionConfig.Builder builder()
      Deprecated.
      Instead of creating a new builder, please use CoreEnvironment.Builder.compressionConfig(Consumer) and configure the builder passed to the consumer. Note: CoreEnvironment is a base class; you'll probably call that method via a subclass named ClusterEnvironment.
      This builder allows to customize a CompressionConfig.
      Returns:
      a builder to configure CompressionConfig.
    • enable

      @Deprecated public static CompressionConfig.Builder enable(boolean enabled)
      Deprecated.
      This method creates a new builder. Please see the deprecation notice on builder().
      If set to false, disabled compression.
      Parameters:
      enabled - true to enable, false otherwise.
      Returns:
      this CompressionConfig.Builder for chaining purposes.
    • minSize

      @Deprecated public static CompressionConfig.Builder minSize(int minSize)
      Deprecated.
      This method creates a new builder. Please see the deprecation notice on builder().
      The minimum size after which compression is performed.

      The default is 32 bytes.

      Parameters:
      minSize - minimum size in bytes.
      Returns:
      this CompressionConfig.Builder for chaining purposes.
    • minRatio

      @Deprecated public static CompressionConfig.Builder minRatio(double minRatio)
      Deprecated.
      This method creates a new builder. Please see the deprecation notice on builder().
      The minimum ratio after which a compressed doc is sent compressed versus the uncompressed version is sent for efficiency.

      The default is 0.83.

      Parameters:
      minRatio - the minimum ratio.
      Returns:
      this CompressionConfig.Builder for chaining purposes.
    • minSize

      public int minSize()
      Returns the minimum configured compression size.
      Returns:
      the minimum compression size.
    • minRatio

      public double minRatio()
      Returns the minimum effective ratio to send when compressed.
      Returns:
      the minimum effective ratio.
    • enabled

      public boolean enabled()
      True if compression should be enabled, false otherwise.
      Returns:
      true if enabled, false otherwise.