public class BucketDefinition
extends java.lang.Object
| Constructor and Description |
|---|
BucketDefinition(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getName() |
int |
getNumReplicas() |
int |
getQuota() |
boolean |
hasFlushEnabled() |
boolean |
hasPrimaryIndex() |
BucketDefinition |
withFlushEnabled(boolean flushEnabled)
Enables flush for this bucket (disabled by default).
|
BucketDefinition |
withPrimaryIndex(boolean create)
Allows to disable creating a primary index for this bucket (enabled by default).
|
BucketDefinition |
withQuota(int quota)
Sets a custom bucket quota (100MiB by default).
|
BucketDefinition |
withReplicas(int numReplicas)
Allows to configure the number of replicas on a bucket (defaults to 0).
|
public BucketDefinition withReplicas(int numReplicas)
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.
numReplicas - the number of replicas to configure.BucketDefinition for chaining purposes.public BucketDefinition withFlushEnabled(boolean flushEnabled)
flushEnabled - if true, the bucket can be flushed.BucketDefinition for chaining purposes.public BucketDefinition withQuota(int quota)
quota - the quota to set for the bucket in mebibytes.BucketDefinition for chaining purposes.public BucketDefinition withPrimaryIndex(boolean create)
create - if false, a primary index will not be created.BucketDefinition for chaining purposes.public java.lang.String getName()
public boolean hasFlushEnabled()
public boolean hasPrimaryIndex()
public int getQuota()
public int getNumReplicas()