Enum CompressionMode

java.lang.Object
java.lang.Enum<CompressionMode>
com.couchbase.client.dcp.config.CompressionMode
All Implemented Interfaces:
Serializable, Comparable<CompressionMode>

public enum CompressionMode extends Enum<CompressionMode>
  • Enum Constant Details

    • DISABLED

      public static final CompressionMode DISABLED
      Couchbase Server will never send compressed values.
    • FORCED

      public static final CompressionMode FORCED
      Couchbase Server will always send compressed values, regardless of how the values are stored on the server, unless the compressed form is larger than the uncompressed form.

      When connecting to a server older than version 5.5, this mode will be downgraded to DISABLED.

      Since:
      Couchbase Server 5.5 (Vulcan)
    • ENABLED

      public static final CompressionMode ENABLED
      Default mode.

      Couchbase Server may send compressed values at its discretion. Values stored in compressed form will be sent compressed. Values stored in uncompressed form will be sent uncompressed.

      When connecting to a server older than version 5.5, this mode will be downgraded to DISABLED.

      Since:
      Couchbase Server 5.5 (Vulcan)
  • Method Details

    • values

      public static CompressionMode[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static CompressionMode valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • effectiveMode

      public abstract CompressionMode effectiveMode(Version serverVersion)
      Returns:
      the mode specified by this enum value, or the fallback mode as required by the actual server version.
    • getDcpControls

      public abstract Map<String,String> getDcpControls(Version serverVersion)
      Returns:
      the controls required to activate this compression mode.
    • getHelloFeatures

      public Set<HelloFeature> getHelloFeatures(Version serverVersion)
      Returns:
      the HELLO features required to activate this compression mode.