Provides access to Couchbase bucket.
More...
#include <couchbase/bucket.hxx>
Provides access to Couchbase bucket.
- Since
- 1.0.0
- Committed
- Generally available API and should be preferred in production
◆ collections()
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()
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]
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
-
| options | custom options to change the default behavior. |
| handler | the 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]
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
-
| options | custom 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_name | the 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]
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.
Over couchbase2, the wait ends once the gRPC channel to the gateway is connected. Neither the bucket nor the credentials are checked, the requested services are not considered, and cluster_state::online and cluster_state::degraded are the same state.
Closing the cluster ends a wait in flight with cluster_closed, and a wait started after the cluster is closed fails the same way.
- Parameters
-
| timeout | the maximum time to wait for readiness. |
| options | custom options to change the default behavior. |
| handler | the 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]
The documentation for this class was generated from the following file: