public class AsyncQueryIndexManager extends Object
| Constructor and Description |
|---|
AsyncQueryIndexManager(com.couchbase.client.core.api.query.CoreQueryOps queryOps,
com.couchbase.client.core.cnc.RequestTracer requestTracer,
AsyncCluster cluster)
Creates a new
AsyncQueryIndexManager. |
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Void> |
buildDeferredIndexes(String bucketName)
Builds all currently deferred indexes in the bucket's default collection.
|
CompletableFuture<Void> |
buildDeferredIndexes(String bucketName,
BuildQueryIndexOptions options)
Builds all currently deferred indexes in a collection.
|
CompletableFuture<Void> |
createIndex(String bucketName,
String indexName,
Collection<String> fields)
Creates a named query index.
|
CompletableFuture<Void> |
createIndex(String bucketName,
String indexName,
Collection<String> fields,
CreateQueryIndexOptions options)
Creates a named query index with custom options.
|
CompletableFuture<Void> |
createPrimaryIndex(String bucketName)
Creates a primary query index.
|
CompletableFuture<Void> |
createPrimaryIndex(String bucketName,
CreatePrimaryQueryIndexOptions options)
Creates a primary query index with custom options.
|
CompletableFuture<Void> |
dropIndex(String bucketName,
String indexName)
Drops a query index from a bucket.
|
CompletableFuture<Void> |
dropIndex(String bucketName,
String indexName,
DropQueryIndexOptions options)
Drops a query index from a bucket with custom options.
|
CompletableFuture<Void> |
dropPrimaryIndex(String bucketName)
Drops the primary index from a bucket.
|
CompletableFuture<Void> |
dropPrimaryIndex(String bucketName,
DropPrimaryQueryIndexOptions options)
Drops the primary index from a bucket with custom options.
|
CompletableFuture<List<QueryIndex>> |
getAllIndexes(String bucketName)
Fetches all indexes from the bucket.
|
CompletableFuture<List<QueryIndex>> |
getAllIndexes(String bucketName,
GetAllQueryIndexesOptions options)
Fetches all indexes from the bucket with custom options.
|
CompletableFuture<Void> |
watchIndexes(String bucketName,
Collection<String> indexNames,
Duration timeout)
Watches/Polls indexes until they are online.
|
CompletableFuture<Void> |
watchIndexes(String bucketName,
Collection<String> indexNames,
Duration timeout,
WatchQueryIndexesOptions options)
Watches/Polls indexes until they are online with custom options.
|
@Stability.Internal
public AsyncQueryIndexManager(com.couchbase.client.core.api.query.CoreQueryOps queryOps,
com.couchbase.client.core.cnc.RequestTracer requestTracer,
AsyncCluster cluster)
AsyncQueryIndexManager.
This API is not intended to be called by the user directly, use AsyncCluster.queryIndexes()
instead.
public CompletableFuture<Void> createIndex(String bucketName, String indexName, Collection<String> fields)
By default, this method will create an index on the bucket. If an index needs to be created on a collection,
both CreateQueryIndexOptions.scopeName(String) and CreateQueryIndexOptions.collectionName(String)
must be set.
bucketName - the name of the bucket to create the index on.indexName - the name of the query index.fields - the collection of fields that are part of the index.CompletableFuture completing when the operation is applied or failed with an error.com.couchbase.client.core.error.IndexFailureException - (async) if creating the index failed (see reason for details).com.couchbase.client.core.error.IndexExistsException - (async) if an index already exists with the given name on the keyspace.com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.public CompletableFuture<Void> createIndex(String bucketName, String indexName, Collection<String> fields, CreateQueryIndexOptions options)
By default, this method will create an index on the bucket. If an index needs to be created on a collection,
both CreateQueryIndexOptions.scopeName(String) and CreateQueryIndexOptions.collectionName(String)
must be set.
bucketName - the name of the bucket to create the index on.indexName - the name of the query index.fields - the collection of fields that are part of the index.options - the custom options to apply.CompletableFuture completing when the operation is applied or failed with an error.com.couchbase.client.core.error.IndexFailureException - (async) if creating the index failed (see reason for details).com.couchbase.client.core.error.IndexExistsException - (async) if an index already exists with the given name on the keyspace.com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.public CompletableFuture<Void> createPrimaryIndex(String bucketName)
By default, this method will create an index on the bucket. If an index needs to be created on a collection,
both CreatePrimaryQueryIndexOptions.scopeName(String) and
CreatePrimaryQueryIndexOptions.collectionName(String) must be set.
bucketName - the name of the bucket to create the index on.CompletableFuture completing when the operation is applied or failed with an error.com.couchbase.client.core.error.IndexFailureException - (async) if creating the index failed (see reason for details).com.couchbase.client.core.error.IndexExistsException - (async) if an index already exists with the given name on the keyspace.com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.public CompletableFuture<Void> createPrimaryIndex(String bucketName, CreatePrimaryQueryIndexOptions options)
By default, this method will create an index on the bucket. If an index needs to be created on a collection,
both CreatePrimaryQueryIndexOptions.scopeName(String) and
CreatePrimaryQueryIndexOptions.collectionName(String) must be set.
bucketName - the name of the bucket to create the index on.options - the custom options to apply.CompletableFuture completing when the operation is applied or failed with an error.com.couchbase.client.core.error.IndexFailureException - (async) if creating the index failed (see reason for details).com.couchbase.client.core.error.IndexExistsException - (async) if an index already exists with the given name on the keyspace.com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.public CompletableFuture<List<QueryIndex>> getAllIndexes(String bucketName)
By default, this method will fetch all index on the bucket. If the indexes should be loaded for a collection,
both GetAllQueryIndexesOptions.scopeName(String) and
GetAllQueryIndexesOptions.collectionName(String) must be set. If all indexes for a scope should be loaded,
only the GetAllQueryIndexesOptions.scopeName(String) can be set.
bucketName - the name of the bucket to load the indexes from.CompletableFuture completing with a list of (potentially empty) indexes or failed with an error.com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.public CompletableFuture<List<QueryIndex>> getAllIndexes(String bucketName, GetAllQueryIndexesOptions options)
By default, this method will fetch all index on the bucket. If the indexes should be loaded for a collection,
both GetAllQueryIndexesOptions.scopeName(String) and
GetAllQueryIndexesOptions.collectionName(String) must be set. If all indexes for a scope should be loaded,
only the GetAllQueryIndexesOptions.scopeName(String) can be set.
bucketName - the name of the bucket to load the indexes from.options - the custom options to apply.CompletableFuture completing with a list of (potentially empty) indexes or failed with an error.com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.public CompletableFuture<Void> dropPrimaryIndex(String bucketName)
By default, this method will drop the primary index on the bucket. If the index should be dropped on a collection,
both DropPrimaryQueryIndexOptions.scopeName(String) and
DropPrimaryQueryIndexOptions.collectionName(String) must be set.
bucketName - the name of the bucket to drop the indexes from.CompletableFuture completing when the operation is applied or failed with an error.com.couchbase.client.core.error.IndexNotFoundException - (async) if the index does not exist.com.couchbase.client.core.error.IndexFailureException - (async) if dropping the index failed (see reason for details).com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.public CompletableFuture<Void> dropPrimaryIndex(String bucketName, DropPrimaryQueryIndexOptions options)
By default, this method will drop the primary index on the bucket. If the index should be dropped on a collection,
both DropPrimaryQueryIndexOptions.scopeName(String) and
DropPrimaryQueryIndexOptions.collectionName(String) must be set.
bucketName - the name of the bucket to drop the indexes from.options - the custom options to apply.CompletableFuture completing when the operation is applied or failed with an error.com.couchbase.client.core.error.IndexNotFoundException - (async) if the index does not exist.com.couchbase.client.core.error.IndexFailureException - (async) if dropping the index failed (see reason for details).com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.public CompletableFuture<Void> dropIndex(String bucketName, String indexName)
By default, this method will drop the index on the bucket. If the index should be dropped on a collection,
both DropQueryIndexOptions.scopeName(String) and
DropQueryIndexOptions.collectionName(String) must be set.
bucketName - the name of the bucket to drop the indexes from.indexName - the name of the index top drop.CompletableFuture completing when the operation is applied or failed with an error.com.couchbase.client.core.error.IndexNotFoundException - (async) if the index does not exist.com.couchbase.client.core.error.IndexFailureException - (async) if dropping the index failed (see reason for details).com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.public CompletableFuture<Void> dropIndex(String bucketName, String indexName, DropQueryIndexOptions options)
By default, this method will drop the index on the bucket. If the index should be dropped on a collection,
both DropQueryIndexOptions.scopeName(String) and
DropQueryIndexOptions.collectionName(String) must be set.
bucketName - the name of the bucket to drop the indexes from.indexName - the name of the index top drop.options - the custom options to apply.CompletableFuture completing when the operation is applied or failed with an error.com.couchbase.client.core.error.IndexNotFoundException - (async) if the index does not exist.com.couchbase.client.core.error.IndexFailureException - (async) if dropping the index failed (see reason for details).com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.public CompletableFuture<Void> buildDeferredIndexes(String bucketName)
To target a different collection, see buildDeferredIndexes(String, BuildQueryIndexOptions).
bucketName - the name of the bucket to build deferred indexes for.CompletableFuture completing when the operation is applied or failed with an error.com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.public CompletableFuture<Void> buildDeferredIndexes(String bucketName, BuildQueryIndexOptions options)
By default, this method targets the bucket's default collection.
To target a different collection, specify both
BuildQueryIndexOptions.scopeName(String) and
BuildQueryIndexOptions.collectionName(String).
bucketName - the name of the bucket to build deferred indexes for.options - the custom options to apply.CompletableFuture completing when the operation is applied or failed with an error.com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.public CompletableFuture<Void> watchIndexes(String bucketName, Collection<String> indexNames, Duration timeout)
By default, this method will watch the indexes on the bucket. If the indexes should be watched on a collection,
both WatchQueryIndexesOptions.scopeName(String) and
WatchQueryIndexesOptions.collectionName(String) must be set.
bucketName - the name of the bucket where the indexes should be watched.indexNames - the names of the indexes to watch.timeout - the maximum amount of time the indexes should be watched.CompletableFuture completing when the operation is applied or failed with an error.com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.public CompletableFuture<Void> watchIndexes(String bucketName, Collection<String> indexNames, Duration timeout, WatchQueryIndexesOptions options)
By default, this method will watch the indexes on the bucket. If the indexes should be watched on a collection,
both WatchQueryIndexesOptions.scopeName(String) and
WatchQueryIndexesOptions.collectionName(String) must be set.
bucketName - the name of the bucket where the indexes should be watched.indexNames - the names of the indexes to watch.timeout - the maximum amount of time the indexes should be watched.options - the custom options to apply.CompletableFuture completing when the operation is applied or failed with an error.com.couchbase.client.core.error.CouchbaseException - (async) if any other generic unhandled/unexpected errors.Copyright © 2024 Couchbase, Inc.. All rights reserved.