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
Nested ClassesModifier and TypeClassDescriptionstatic classThis builder allows to customize theCompressionConfig. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanstatic final doublestatic final int -
Method Summary
Modifier and TypeMethodDescriptionstatic CompressionConfig.Builderbuilder()Deprecated.static CompressionConfigcreate()Deprecated.Instead, please useCoreEnvironment.Builder.compressionConfig(Consumer)and configure the builder passed to the consumer.static CompressionConfig.Builderenable(boolean enabled) Deprecated.This method creates a new builder.booleanenabled()True if compression should be enabled, false otherwise.doubleminRatio()Returns the minimum effective ratio to send when compressed.static CompressionConfig.BuilderminRatio(double minRatio) Deprecated.This method creates a new builder.intminSize()Returns the minimum configured compression size.static CompressionConfig.BuilderminSize(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 aCompressionConfigwith 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.Builderfor 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.Builderfor 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.Builderfor 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.