Package com.couchbase.client.core.env
Class CompressionConfig
java.lang.Object
com.couchbase.client.core.env.CompressionConfig
Allows configuring and customizing the compression configuration.
- Since:
- 2.0.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
This builder allows to customize theCompressionConfig
. -
Field Summary
Modifier and TypeFieldDescriptionstatic final boolean
static final double
static final int
-
Method Summary
Modifier and TypeMethodDescriptionstatic CompressionConfig.Builder
builder()
Deprecated.static CompressionConfig
create()
Deprecated.Instead, please useCoreEnvironment.Builder.compressionConfig(Consumer)
and configure the builder passed to the consumer.static CompressionConfig.Builder
enable
(boolean enabled) Deprecated.This method creates a new builder.boolean
enabled()
True if compression should be enabled, false otherwise.double
minRatio()
Returns the minimum effective ratio to send when compressed.static CompressionConfig.Builder
minRatio
(double minRatio) Deprecated.This method creates a new builder.int
minSize()
Returns the minimum configured compression size.static CompressionConfig.Builder
minSize
(int minSize) Deprecated.This method creates a new builder.
-
Field Details
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLED- See Also:
-
DEFAULT_MIN_SIZE
public static final int DEFAULT_MIN_SIZE- See Also:
-
DEFAULT_MIN_RATIO
public static final double DEFAULT_MIN_RATIO- See Also:
-
-
Method Details
-
create
Deprecated.Instead, please useCoreEnvironment.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 namedClusterEnvironment
.Creates aCompressionConfig
with default arguments.- Returns:
- a new
CompressionConfig
.
-
builder
Deprecated.Instead of creating a new builder, please useCoreEnvironment.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 namedClusterEnvironment
.This builder allows to customize aCompressionConfig
.- Returns:
- a builder to configure
CompressionConfig
.
-
enable
Deprecated.This method creates a new builder. Please see the deprecation notice onbuilder()
.If set to false, disabled compression.- Parameters:
enabled
- true to enable, false otherwise.- Returns:
- this
CompressionConfig.Builder
for chaining purposes.
-
minSize
Deprecated.This method creates a new builder. Please see the deprecation notice onbuilder()
.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.This method creates a new builder. Please see the deprecation notice onbuilder()
.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.
-
CoreEnvironment.Builder.compressionConfig(Consumer)
and configure the builder passed to the consumer.