class Cluster extends AnyRef
Represents a connection to a Couchbase cluster.
These can be created through the functions in the companion object.
- Since
1.0.0
- Alphabetic
- By Inheritance
- Cluster
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- lazy val analyticsIndexes: AnalyticsIndexManager
- def analyticsQuery(statement: String, parameters: AnalyticsParameters = AnalyticsParameters.None, timeout: Duration = _env.timeoutConfig.queryTimeout()): Try[AnalyticsResult]
Performs an Analytics query against the cluster.
Performs an Analytics query against the cluster.
This is blocking. See Cluster.reactive for a reactive streaming version of this API, and Cluster.async for an asynchronous version.
This overload provides only the most commonly used options. If you need to configure something more esoteric, use the overload that takes a com.couchbase.client.scala.analytics.AnalyticsOptions instead, which supports all available options.
- statement
the Analytics query to execute
- parameters
provides named or positional parameters for queries parameterised that way.
- timeout
sets a maximum timeout for processing.
- returns
a
Future
containing aSuccess(AnalyticsResult)
(which includes any returned rows) if successful, else aFailure
- def analyticsQuery(statement: String, options: AnalyticsOptions): Try[AnalyticsResult]
Performs an Analytics query against the cluster.
Performs an Analytics query against the cluster.
This is blocking. See Cluster.reactive for a reactive streaming version of this API, and Cluster.async for an asynchronous version.
- statement
the Analytics query to execute
- options
any query options - see com.couchbase.client.scala.analytics.AnalyticsOptions for documentation
- returns
a
Try
containing aSuccess(AnalyticsResult)
(which includes any returned rows) if successful, else aFailure
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val async: AsyncCluster
Access an asynchronous version of this API.
- def bucket(bucketName: String): Bucket
Opens and returns a Couchbase bucket resource that exists on this cluster.
Opens and returns a Couchbase bucket resource that exists on this cluster.
- bucketName
the name of the bucket to open
- lazy val buckets: BucketManager
The BucketManager provides access to creating and getting buckets.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- def diagnostics(options: DiagnosticsOptions): Try[DiagnosticsResult]
Returns a
DiagnosticsResult
, reflecting the SDK's current view of all its existing connections to the cluster.Returns a
DiagnosticsResult
, reflecting the SDK's current view of all its existing connections to the cluster.- options
options to customize the report generation
- returns
a
DiagnosticsResult
- def diagnostics(reportId: String = UUID.randomUUID.toString): Try[DiagnosticsResult]
Returns a
DiagnosticsResult
, reflecting the SDK's current view of all its existing connections to the cluster.Returns a
DiagnosticsResult
, reflecting the SDK's current view of all its existing connections to the cluster.- reportId
this will be returned in the
DiagnosticsResult
. If not specified it defaults to a UUID.- returns
a
DiagnosticsResult
- def disconnect(timeout: Duration = _env.timeoutConfig.disconnectTimeout()): Unit
Shutdown all cluster resources.
Shutdown all cluster resources.
This should be called before application exit.
- timeout
how long the disconnect is allowed to take; defaults to
disconnectTimeout
on the environment
- def env: ClusterEnvironment
The environment used to create this cluster
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- lazy val eventingFunctions: EventingFunctionManager
Allows managing eventing functions at the admin scope ("*.*") level.
Allows managing eventing functions at the admin scope ("*.*") level.
For managing eventing functions on a specific scope, see ScopedEventingFunctionManager, accessed from Scope.eventingFunctions.
- Annotations
- @Uncommitted()
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- def ping(options: PingOptions): Try[PingResult]
Performs application-level ping requests with custom options against services in the Couchbase cluster.
Performs application-level ping requests with custom options against services in the Couchbase cluster.
Note that this operation performs active I/O against services and endpoints to assess their health. If you do not wish to perform I/O, consider using
.diagnostics()
instead.- options
options to customize the ping
- returns
the
PingResult
once complete.
- def ping(timeout: Option[Duration] = None): Try[PingResult]
Performs application-level ping requests with custom options against services in the Couchbase cluster.
Performs application-level ping requests with custom options against services in the Couchbase cluster.
Note that this operation performs active I/O against services and endpoints to assess their health. If you do not wish to perform I/O, consider using
.diagnostics()
instead.This overload provides only the most commonly used options. If you need to configure something more esoteric, use the overload that takes a com.couchbase.client.scala.diagnostics.PingOptions instead, which supports all available options.
- timeout
the timeout to use for the operation
- returns
the
PingResult
once complete.
- def query(statement: String, parameters: QueryParameters = QueryParameters.None, timeout: Duration = _env.timeoutConfig.queryTimeout(), adhoc: Boolean = true): Try[QueryResult]
Performs a N1QL query against the cluster.
Performs a N1QL query against the cluster.
This is blocking. See Cluster.reactive for a reactive streaming version of this API, and Cluster.async for an asynchronous version.
This overload provides only the most commonly used options. If you need to configure something more esoteric, use the overload that takes a com.couchbase.client.scala.query.QueryOptions instead, which supports all available options.
- statement
the N1QL statement to execute
- parameters
provides named or positional parameters for queries parameterised that way.
- timeout
sets a maximum timeout for processing.
- adhoc
if true (the default), adhoc mode is enabled: queries are just run. If false, adhoc mode is disabled and transparent prepared statement mode is enabled: queries are first prepared so they can be executed more efficiently in the future.
- returns
a
Try
containing aSuccess(QueryResult)
(which includes any returned rows) if successful, else aFailure
- def query(statement: String, options: QueryOptions): Try[QueryResult]
Performs a N1QL query against the cluster.
Performs a N1QL query against the cluster.
This is blocking. See Cluster.reactive for a reactive streaming version of this API, and Cluster.async for an asynchronous version.
- statement
the N1QL statement to execute
- options
any query options - see com.couchbase.client.scala.query.QueryOptions for documentation
- returns
a
Try
containing aSuccess(QueryResult)
(which includes any returned rows) if successful, else aFailure
- lazy val queryIndexes: QueryIndexManager
- lazy val reactive: ReactiveCluster
Access a reactive version of this API.
- def search(indexName: String, request: SearchRequest, options: SearchOptions): Try[SearchResult]
Performs a Full Text Search (FTS) query.
Performs a Full Text Search (FTS) query.
This can be used to perform a traditional FTS query, and/or a vector search.
Use this to access global FTS indexes, and Scope.search for scoped indexes.
This is blocking. See Cluster.reactive for a reactive streaming version of this API, and Cluster.async for an asynchronous version.
- indexName
the name of the search index to use
- request
the request to send to the FTS service.
- options
- returns
a
Try
containing aSuccess(SearchResult)
(which includes any returned rows) if successful, else aFailure
- def search(indexName: String, request: SearchRequest): Try[SearchResult]
Performs a Full Text Search (FTS) query, using default options.
Performs a Full Text Search (FTS) query, using default options.
This can be used to perform a traditional FTS query, and/or a vector search.
Use this to access global FTS indexes, and Scope.search for scoped indexes.
This is blocking. See Cluster.reactive for a reactive streaming version of this API, and Cluster.async for an asynchronous version.
- indexName
the name of the search index to use
- request
the request to send to the FTS service.
- returns
a
Try
containing aSuccess(SearchResult)
(which includes any returned rows) if successful, else aFailure
- lazy val searchIndexes: SearchIndexManager
- def searchQuery(indexName: String, query: SearchQuery, timeout: Duration = async.env.timeoutConfig.searchTimeout()): Try[SearchResult]
Performs a Full Text Search (FTS) query against the cluster.
Performs a Full Text Search (FTS) query against the cluster.
This is blocking. See Cluster.reactive for a reactive streaming version of this API, and Cluster.async for an asynchronous version.
This overload provides only the most commonly used options. If you need to configure something more esoteric, use the overload that takes a com.couchbase.client.scala.search.SearchOptions instead, which supports all available options.
New users should consider the newer
search(String, SearchRequest)
interface instead, which can do both the traditional FTSSearchQuery
that this method performs, and/or can also be used to perform a com.couchbase.client.scala.search.vector.VectorSearch.- indexName
the name of the search index to use
- query
the FTS query to execute. See com.couchbase.client.scala.search.queries.SearchQuery for more
- timeout
how long the operation is allowed to take
- returns
a
Try
containing aSuccess(SearchResult)
(which includes any returned rows) if successful, else aFailure
- def searchQuery(indexName: String, query: SearchQuery, options: SearchOptions): Try[SearchResult]
Performs a Full Text Search (FTS) query against the cluster.
Performs a Full Text Search (FTS) query against the cluster.
This is blocking. See Cluster.reactive for a reactive streaming version of this API, and Cluster.async for an asynchronous version.
New users should consider the newer
search(String, SearchRequest)
interface instead, which can do both the traditional FTSSearchQuery
that this method performs, and/or can also be used to perform a com.couchbase.client.scala.search.vector.VectorSearch.- indexName
the name of the search index to use
- query
the FTS query to execute. See com.couchbase.client.scala.search.queries.SearchQuery for more
- options
the FTS query to execute. See com.couchbase.client.scala.search.SearchOptions for how to construct
- returns
a
Try
containing aSuccess(SearchResult)
(which includes any returned rows) if successful, else aFailure
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- lazy val transactions: Transactions
- lazy val users: UserManager
The UserManager provides programmatic access to and creation of users and groups.
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def waitUntilReady(timeout: Duration, options: WaitUntilReadyOptions): Try[Unit]
Waits until the desired
ClusterState
is reached.Waits until the desired
ClusterState
is reached.This method will wait until either the cluster state is "online", or the timeout is reached. Since the SDK is bootstrapping lazily, this method allows to eagerly check during bootstrap if all of the services are online and usable before moving on.
- timeout
the maximum time to wait until readiness.
- options
options to customize the wait
- def waitUntilReady(timeout: Duration): Try[Unit]
Waits until the desired
ClusterState
is reached.Waits until the desired
ClusterState
is reached.This method will wait until either the cluster state is "online", or the timeout is reached. Since the SDK is bootstrapping lazily, this method allows to eagerly check during bootstrap if all of the services are online and usable before moving on.
This overload provides only the most commonly used options. If you need to configure something more esoteric, use the overload that takes a com.couchbase.client.scala.diagnostics.WaitUntilReadyOptions instead, which supports all available options.
- timeout
the maximum time to wait until readiness.
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)