Class ReactiveBucketManager
All mutating operations on this manager are eventually consistent, which means that as soon as the call returns the operation is accepted by the server, but it does not mean that the operation has been applied to all nodes in the cluster yet. In the future, APIs will be provided which allow to assert the propagation state.
- 
Constructor SummaryConstructorsConstructorDescriptionReactiveBucketManager(ReactorOps reactor, AsyncBucketManager async) Creates a newReactiveBucketManager.
- 
Method SummaryModifier and TypeMethodDescriptionasync()Provides access to theAsyncBucketManagerfor convenience.reactor.core.publisher.Mono<Void> createBucket(BucketSettings settings) Creates a new bucket on the server.reactor.core.publisher.Mono<Void> createBucket(BucketSettings settings, CreateBucketOptions options) Creates a new bucket on the server with custom options.reactor.core.publisher.Mono<Void> dropBucket(String bucketName) Drops ("deletes") a bucket from the cluster.reactor.core.publisher.Mono<Void> dropBucket(String bucketName, DropBucketOptions options) Drops ("deletes") a bucket from the cluster with custom options.reactor.core.publisher.Mono<Void> flushBucket(String bucketName) Deletes all documents from ("flushes") a bucket.reactor.core.publisher.Mono<Void> flushBucket(String bucketName, FlushBucketOptions options) Deletes all documents from ("flushes") a bucket with custom options.reactor.core.publisher.Mono<Map<String, BucketSettings>> Loads the properties of all buckets the current user has access to from the cluster.reactor.core.publisher.Mono<Map<String, BucketSettings>> getAllBuckets(GetAllBucketOptions options) Loads the properties of all buckets the current user has access to from the cluster.reactor.core.publisher.Mono<BucketSettings> Loads the properties of a bucket from the cluster.reactor.core.publisher.Mono<BucketSettings> getBucket(String bucketName, GetBucketOptions options) Loads the properties of a bucket from the cluster with custom options.reactor.core.publisher.Mono<Void> updateBucket(BucketSettings settings) Updates the settings of a bucket which already exists.reactor.core.publisher.Mono<Void> updateBucket(BucketSettings settings, UpdateBucketOptions options) Updates the settings of a bucket which already exists with custom options.
- 
Constructor Details- 
ReactiveBucketManagerCreates a newReactiveBucketManager.This API is not intended to be called by the user directly, use ReactiveCluster.buckets()instead.- Parameters:
- async- the underlying async manager that performs the ops.
 
 
- 
- 
Method Details- 
asyncProvides access to theAsyncBucketManagerfor convenience.
- 
createBucketCreates a new bucket on the server.The SDK will not perform any logical validation on correct combination of the settings - the server will return an error on invalid combinations. As an example, a magma bucket needs at least 1024 MiB of bucket quota - otherwise the server will reject it. - Parameters:
- settings- the- BucketSettingsdescribing the properties of the bucket.
- Returns:
- a Monocompleting when the operation is applied or has failed with an error.
- Throws:
- BucketExistsException- (async) if the bucket already exists.
- CouchbaseException- (async) if any other generic unhandled/unexpected errors.
 
- 
createBucketpublic reactor.core.publisher.Mono<Void> createBucket(BucketSettings settings, CreateBucketOptions options) Creates a new bucket on the server with custom options.The SDK will not perform any logical validation on correct combination of the settings - the server will return an error on invalid combinations. As an example, a magma bucket needs at least 1024 MiB of bucket quota - otherwise the server will reject it. - Parameters:
- settings- the- BucketSettingsdescribing the properties of the bucket.
- options- the custom options to apply.
- Returns:
- a Monocompleting when the operation is applied or has failed with an error.
- Throws:
- BucketExistsException- (async) if the bucket already exists.
- CouchbaseException- (async) if any other generic unhandled/unexpected errors.
 
- 
updateBucketUpdates the settings of a bucket which already exists.Not all properties of a bucket can be changed on an update. Notably, the following properties are ignored by the SDK on update and so will not produce an error but also not change anything on the server side: - BucketSettings.name()
- BucketSettings.bucketType(BucketType)
- BucketSettings.conflictResolutionType(ConflictResolutionType)
- BucketSettings.replicaIndexes(boolean)
- BucketSettings.storageBackend(StorageBackend)
 The SDK will not perform any logical validation on correct combination of the settings - the server will return an error on invalid combinations. As an example, a magma bucket needs at least 1024 MiB of bucket quota - otherwise the server will reject it. - Parameters:
- settings- the- BucketSettingsdescribing the properties of the bucket.
- Returns:
- a Monocompleting when the operation is applied or has failed with an error.
- Throws:
- BucketNotFoundException- (async) if the specified bucket does not exist.
- CouchbaseException- (async) if any other generic unhandled/unexpected errors.
 
- 
updateBucketpublic reactor.core.publisher.Mono<Void> updateBucket(BucketSettings settings, UpdateBucketOptions options) Updates the settings of a bucket which already exists with custom options.Not all properties of a bucket can be changed on an update. Notably, the following properties are ignored by the SDK on update and so will not produce an error but also not change anything on the server side: - BucketSettings.name()
- BucketSettings.bucketType(BucketType)
- BucketSettings.conflictResolutionType(ConflictResolutionType)
- BucketSettings.replicaIndexes(boolean)
- BucketSettings.storageBackend(StorageBackend)
 The SDK will not perform any logical validation on correct combination of the settings - the server will return an error on invalid combinations. As an example, a magma bucket needs at least 1024 MiB of bucket quota - otherwise the server will reject it. - Parameters:
- settings- the- BucketSettingsdescribing the properties of the bucket.
- options- the custom options to apply.
- Returns:
- a Monocompleting when the operation is applied or has failed with an error.
- Throws:
- BucketNotFoundException- (async) if the specified bucket does not exist.
- CouchbaseException- (async) if any other generic unhandled/unexpected errors.
 
- 
dropBucketDrops ("deletes") a bucket from the cluster.- Parameters:
- bucketName- the name of the bucket to drop.
- Returns:
- a Monocompleting when the operation is applied or has failed with an error.
- Throws:
- BucketNotFoundException- (async) if the specified bucket does not exist.
- CouchbaseException- (async) if any other generic unhandled/unexpected errors.
 
- 
dropBucketDrops ("deletes") a bucket from the cluster with custom options.- Parameters:
- bucketName- the name of the bucket to drop.
- options- the custom options to apply.
- Returns:
- a Monocompleting when the operation is applied or has failed with an error.
- Throws:
- BucketNotFoundException- (async) if the specified bucket does not exist.
- CouchbaseException- (async) if any other generic unhandled/unexpected errors.
 
- 
getBucketLoads the properties of a bucket from the cluster.- Parameters:
- bucketName- the name of the bucket for which the settings should be loaded.
- Returns:
- a Monocompleting with the bucket settings or if the operation has failed.
- Throws:
- BucketNotFoundException- (async) if the specified bucket does not exist.
- CouchbaseException- (async) if any other generic unhandled/unexpected errors.
 
- 
getBucketpublic reactor.core.publisher.Mono<BucketSettings> getBucket(String bucketName, GetBucketOptions options) Loads the properties of a bucket from the cluster with custom options.- Parameters:
- bucketName- the name of the bucket for which the settings should be loaded.
- options- the custom options to apply.
- Returns:
- a Monocompleting with the bucket settings or if the operation has failed.
- Throws:
- BucketNotFoundException- (async) if the specified bucket does not exist.
- CouchbaseException- (async) if any other generic unhandled/unexpected errors.
 
- 
getAllBucketsLoads the properties of all buckets the current user has access to from the cluster.- Returns:
- a Monocompleting with all bucket settings or if the operation has failed.
- Throws:
- CouchbaseException- (async) if any other generic unhandled/unexpected errors.
 
- 
getAllBucketspublic reactor.core.publisher.Mono<Map<String,BucketSettings>> getAllBuckets(GetAllBucketOptions options) Loads the properties of all buckets the current user has access to from the cluster.- Parameters:
- options- the custom options to apply.
- Returns:
- a Monocompleting with all bucket settings or if the operation has failed.
- Throws:
- CouchbaseException- (async) if any other generic unhandled/unexpected errors.
 
- 
flushBucketDeletes all documents from ("flushes") a bucket.Flush needs to be enabled on the bucket in order to perform the operation. Enabling flush is not recommended in a production cluster and can lead to data loss! Keep in mind that flush is not an atomic operation, the server will need some time to clean the partitions out completely. If isolation is preferred in an integration-test scenario, creating individual buckets might provide a better user experience. - Parameters:
- bucketName- the name of the bucket to flush.
- Returns:
- a Monocompleting when the operation is applied or has failed with an error.
- Throws:
- BucketNotFoundException- (async) if the specified bucket does not exist.
- BucketNotFlushableException- (async) if flush is not enabled on the bucket.
- CouchbaseException- (async) if any other generic unhandled/unexpected errors.
 
- 
flushBucketDeletes all documents from ("flushes") a bucket with custom options.Flush needs to be enabled on the bucket in order to perform the operation. Enabling flush is not recommended in a production cluster and can lead to data loss! Keep in mind that flush is not an atomic operation, the server will need some time to clean the partitions out completely. If isolation is preferred in an integration-test scenario, creating individual buckets might provide a better user experience. - Parameters:
- bucketName- the name of the bucket to flush.
- options- the custom options to apply.
- Returns:
- a Monocompleting when the operation is applied or has failed with an error.
- Throws:
- BucketNotFoundException- (async) if the specified bucket does not exist.
- BucketNotFlushableException- (async) if flush is not enabled on the bucket.
- CouchbaseException- (async) if any other generic unhandled/unexpected errors.
 
 
-