Package org.testcontainers.couchbase
Class BucketDefinition
java.lang.Object
org.testcontainers.couchbase.BucketDefinition
Allows to configure the properties of a bucket that should be created.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()intintgetQuota()booleanbooleanwithFlushEnabled(boolean flushEnabled) Enables flush for this bucket (disabled by default).withPrimaryIndex(boolean create) Allows to disable creating a primary index for this bucket (enabled by default).withQuota(int quota) Sets a custom bucket quota (100MiB by default).withReplicas(int numReplicas) Allows to configure the number of replicas on a bucket (defaults to 0).
-
Constructor Details
-
BucketDefinition
-
-
Method Details
-
withReplicas
Allows to configure the number of replicas on a bucket (defaults to 0).By default the bucket is initialized with 0 replicas since only a single container is launched. Modifying this value can still be useful in some test scenarios (i.e. to test failures with the wrong number of replicas and durability requirements on operations).
Couchbase buckets can have a maximum of three replicas configured.
- Parameters:
numReplicas- the number of replicas to configure.- Returns:
- this
BucketDefinitionfor chaining purposes.
-
withFlushEnabled
Enables flush for this bucket (disabled by default).- Parameters:
flushEnabled- if true, the bucket can be flushed.- Returns:
- this
BucketDefinitionfor chaining purposes.
-
withQuota
Sets a custom bucket quota (100MiB by default).- Parameters:
quota- the quota to set for the bucket in mebibytes.- Returns:
- this
BucketDefinitionfor chaining purposes.
-
withPrimaryIndex
Allows to disable creating a primary index for this bucket (enabled by default).- Parameters:
create- if false, a primary index will not be created.- Returns:
- this
BucketDefinitionfor chaining purposes.
-
getName
-
hasFlushEnabled
public boolean hasFlushEnabled() -
hasPrimaryIndex
public boolean hasPrimaryIndex() -
getQuota
public int getQuota() -
getNumReplicas
public int getNumReplicas()
-