Couchbase C++ SDK 1.4.0 (rev. 59aa900)
Loading...
Searching...
No Matches
bucket Class Reference

Provides access to Couchbase bucket. More...

#include <couchbase/bucket.hxx>

Public Member Functions

auto default_scope () const -> scope
 Opens default scope.
auto default_collection () const -> collection
 Opens the default collection for this bucket using the default scope.
auto scope (std::string_view scope_name) const -> scope
 Opens the scope with the given name.
void ping (const ping_options &options, ping_handler &&handler) const
 Performs application-level ping requests against services in the Couchbase cluster.
auto ping (const ping_options &options={}) const -> std::future< std::pair< error, ping_result > >
 Performs application-level ping requests against services in the Couchbase cluster.
void wait_until_ready (std::chrono::milliseconds timeout, const wait_until_ready_options &options, wait_until_ready_handler &&handler) const
 Waits until the desired state of the bucket is reached, actively pinging its services until they respond or the timeout elapses.
auto wait_until_ready (std::chrono::milliseconds timeout, const wait_until_ready_options &options={}) const -> std::future< error >
 Waits until the desired state of the bucket is reached.
auto collections () const -> collection_manager
 Provides access to the collection management services.

Detailed Description

Provides access to Couchbase bucket.

Since
1.0.0
Committed
Generally available API and should be preferred in production

Member Function Documentation

◆ collections()

auto collections ( ) const -> collection_manager
nodiscard

Provides access to the collection management services.

Returns
a manager instance
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ default_collection()

auto default_collection ( ) const -> collection
nodiscard

Opens the default collection for this bucket using the default scope.

Returns
the opened default collection.
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ default_scope()

auto default_scope ( ) const -> scope
nodiscard

Opens default scope.

Returns
the scope once opened.
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ ping() [1/2]

void ping ( const ping_options & options,
ping_handler && handler ) const

Performs application-level ping requests against services in the Couchbase cluster.

Note
This operation performs active I/O against services and endpoints to assess their health. If you do not wish to performs I/O, consider using diagnostics() instead.
Parameters
optionscustom options to change the default behavior.
handlerthe handler that implements ping_handler.
Note
Not served over the couchbase2 transport, which opens no per-bucket sessions to probe and reports feature_not_available instead.
Since
1.0.0
Committed
Generally available API and should be preferred in production
Since
1.4.0 – Cloud Native Gateway (CNG, couchbase2://) support
Uncommitted
Cloud Native Gateway (CNG, couchbase2://) support is uncommitted and may change in a future release, independently of the stability of the API it applies to

◆ ping() [2/2]

auto ping ( const ping_options & options = {}) const -> std::future< std::pair< error, ping_result > >
nodiscard

Performs application-level ping requests against services in the Couchbase cluster.

Note
This operation performs active I/O against services and endpoints to assess their health. If you do not wish to performs I/O, consider using diagnostics() instead.
Parameters
optionscustom options to change the default behavior.
Returns
future object that carries result of the operation.
Note
Not served over the couchbase2 transport, which opens no per-bucket sessions to probe and reports feature_not_available instead.
Since
1.0.0
Committed
Generally available API and should be preferred in production
Since
1.4.0 – Cloud Native Gateway (CNG, couchbase2://) support
Uncommitted
Cloud Native Gateway (CNG, couchbase2://) support is uncommitted and may change in a future release, independently of the stability of the API it applies to

◆ scope()

auto scope ( std::string_view scope_name) const -> scope
nodiscard

Opens the scope with the given name.

Parameters
scope_namethe name of the scope.
Returns
the scope once opened.
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ wait_until_ready() [1/2]

void wait_until_ready ( std::chrono::milliseconds timeout,
const wait_until_ready_options & options,
wait_until_ready_handler && handler ) const

Waits until the desired state of the bucket is reached, actively pinging its services until they respond or the timeout elapses.

When the desired state is cluster_state::online, this additionally waits until the bucket's vbucket map is fully placed – every vbucket has its active and all replica copies assigned to a node. That is the readiness durable writes require and that a freshly created bucket does not satisfy immediately. The cluster_state::degraded target is ping-only, since it deliberately tolerates partial availability.

Parameters
timeoutthe maximum time to wait for readiness.
optionscustom options to change the default behavior.
handlerthe handler that implements wait_until_ready_handler.
Since
1.4.0
Committed
Generally available API and should be preferred in production

◆ wait_until_ready() [2/2]

auto wait_until_ready ( std::chrono::milliseconds timeout,
const wait_until_ready_options & options = {} ) const -> std::future< error >
nodiscard

Waits until the desired state of the bucket is reached.

See also
wait_until_ready(std::chrono::milliseconds, const wait_until_ready_options&, wait_until_ready_handler&&) const
Parameters
timeoutthe maximum time to wait for readiness.
optionscustom options to change the default behavior.
Returns
future object that carries result of the operation.
Since
1.4.0
Committed
Generally available API and should be preferred in production

The documentation for this class was generated from the following file: