Package com.couchbase.client.java
Interface Bucket
-
- All Known Implementing Classes:
CouchbaseBucket
@Committed @Public public interface Bucket
Defines operations that can be executed synchronously against a Couchbase Server bucket. Note that only a subset of the provided operations are available for "memcached" type buckets. Also, some other operations are only available against specific versions of Couchbase Server. Default timeouts are always applied and can be configured through theCouchbaseEnvironment
. Overloads are also available to change them on a per-call basis.- Since:
- 2.0
- Author:
- Michael Nitschinger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <D extends Document<?>>
Dappend(D document)
Append aDocument
s content to an existing one with the default key/value timeout.<D extends Document<?>>
Dappend(D document, long timeout, TimeUnit timeUnit)
Append aDocument
s content to an existing one with a custom timeout.<D extends Document<?>>
Dappend(D document, PersistTo persistTo)
Append aDocument
s content to an existing one with the default key/value timeout.<D extends Document<?>>
Dappend(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Append aDocument
s content to an existing one with a custom timeout.<D extends Document<?>>
Dappend(D document, PersistTo persistTo, ReplicateTo replicateTo)
Append aDocument
s content to an existing one with the default key/value timeout.<D extends Document<?>>
Dappend(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Append aDocument
s content to an existing one with a custom timeout.<D extends Document<?>>
Dappend(D document, ReplicateTo replicateTo)
Append aDocument
s content to an existing one with the default key/value timeout.<D extends Document<?>>
Dappend(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Append aDocument
s content to an existing one with a custom timeout.AsyncBucket
async()
Provides access to the underlying asynchronous bucket interface.BucketManager
bucketManager()
Provides access to theBucketManager
for administrative access.Boolean
close()
Closes this bucket with the default disconnect timeout.Boolean
close(long timeout, TimeUnit timeUnit)
Closes this bucket with a custom timeout.ClusterFacade
core()
Returns the underlying "core-io" library through itsClusterFacade
.JsonLongDocument
counter(String id, long delta)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet with the default kvTimeout.JsonLongDocument
counter(String id, long delta, long initial)
Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout.JsonLongDocument
counter(String id, long delta, long initial, int expiry)
Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout.JsonLongDocument
counter(String id, long delta, long initial, int expiry, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist with a custom timeout.JsonLongDocument
counter(String id, long delta, long initial, int expiry, PersistTo persistTo)
Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout.JsonLongDocument
counter(String id, long delta, long initial, int expiry, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist with a custom timeout.JsonLongDocument
counter(String id, long delta, long initial, int expiry, PersistTo persistTo, ReplicateTo replicateTo)
Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout.JsonLongDocument
counter(String id, long delta, long initial, int expiry, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist with a custom timeout.JsonLongDocument
counter(String id, long delta, long initial, int expiry, ReplicateTo replicateTo)
Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout.JsonLongDocument
counter(String id, long delta, long initial, int expiry, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist with a custom timeout.JsonLongDocument
counter(String id, long delta, long initial, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist with a custom timeout.JsonLongDocument
counter(String id, long delta, long initial, PersistTo persistTo)
Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout.JsonLongDocument
counter(String id, long delta, long initial, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist with a custom timeout.JsonLongDocument
counter(String id, long delta, long initial, PersistTo persistTo, ReplicateTo replicateTo)
Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout.JsonLongDocument
counter(String id, long delta, long initial, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist with a custom timeout.JsonLongDocument
counter(String id, long delta, long initial, ReplicateTo replicateTo)
Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout.JsonLongDocument
counter(String id, long delta, long initial, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist with a custom timeout.JsonLongDocument
counter(String id, long delta, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet with a custom timeout.JsonLongDocument
counter(String id, long delta, PersistTo persistTo)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet with the default kvTimeout.JsonLongDocument
counter(String id, long delta, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet with a custom timeout.JsonLongDocument
counter(String id, long delta, PersistTo persistTo, ReplicateTo replicateTo)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet with the default kvTimeout.JsonLongDocument
counter(String id, long delta, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet with a custom timeout.JsonLongDocument
counter(String id, long delta, ReplicateTo replicateTo)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet with the default kvTimeout.JsonLongDocument
counter(String id, long delta, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet with a custom timeout.CouchbaseEnvironment
environment()
TheCouchbaseEnvironment
used.<D extends Document<?>>
booleanexists(D document)
Check whether a document with the given ID does exist in the bucket.<D extends Document<?>>
booleanexists(D document, long timeout, TimeUnit timeUnit)
Check whether a document with the given ID does exist in the bucket.boolean
exists(String id)
Check whether a document with the given ID does exist in the bucket.boolean
exists(String id, long timeout, TimeUnit timeUnit)
Check whether a document with the given ID does exist in the bucket.byte[]
exportAnalyticsDeferredResultHandle(AnalyticsDeferredResultHandle handle)
Exports the deferred result handle to a serialized form which can be used across SDKs<D extends Document<?>>
Dget(D document)
Retrieves any type ofDocument
with the default key/value timeout.<D extends Document<?>>
Dget(D document, long timeout, TimeUnit timeUnit)
Retrieves any type ofDocument
with a custom timeout.JsonDocument
get(String id)
Retrieves aJsonDocument
by its unique ID with the default key/value timeout.JsonDocument
get(String id, long timeout, TimeUnit timeUnit)
Retrieves aJsonDocument
by its unique ID with a custom timeout.<D extends Document<?>>
Dget(String id, Class<D> target)
Retrieves any type ofDocument
by its ID with the default key/value timeout.<D extends Document<?>>
Dget(String id, Class<D> target, long timeout, TimeUnit timeUnit)
Retrieves any type ofDocument
by its ID with a custom timeout.<D extends Document<?>>
DgetAndLock(D document, int lockTime)
Retrieve and lock aDocument
by its unique ID with the default key/value timeout.<D extends Document<?>>
DgetAndLock(D document, int lockTime, long timeout, TimeUnit timeUnit)
Retrieve and lock aDocument
by its unique ID with a custom timeout.JsonDocument
getAndLock(String id, int lockTime)
Retrieve and lock aJsonDocument
by its unique ID with the default key/value timeout.JsonDocument
getAndLock(String id, int lockTime, long timeout, TimeUnit timeUnit)
Retrieve and lock aJsonDocument
by its unique ID with a custom timeout.<D extends Document<?>>
DgetAndLock(String id, int lockTime, Class<D> target)
Retrieve and lock aDocument
by its unique ID with the default key/value timeout.<D extends Document<?>>
DgetAndLock(String id, int lockTime, Class<D> target, long timeout, TimeUnit timeUnit)
Retrieve and lock aDocument
by its unique ID with the a custom timeout.<D extends Document<?>>
DgetAndTouch(D document)
Retrieve and touch aDocument
by its unique ID with the default key/value timeout.<D extends Document<?>>
DgetAndTouch(D document, long timeout, TimeUnit timeUnit)
Retrieve and touch aDocument
by its unique ID with a custom timeout.JsonDocument
getAndTouch(String id, int expiry)
Retrieve and touch aJsonDocument
by its unique ID with the default key/value timeout.JsonDocument
getAndTouch(String id, int expiry, long timeout, TimeUnit timeUnit)
Retrieve and touch aJsonDocument
by its unique ID with the a custom timeout.<D extends Document<?>>
DgetAndTouch(String id, int expiry, Class<D> target)
Retrieve and touch aDocument
by its unique ID with the default key/value timeout.<D extends Document<?>>
DgetAndTouch(String id, int expiry, Class<D> target, long timeout, TimeUnit timeUnit)
Retrieve and touch aDocument
by its unique ID with a custom timeout.<D extends Document<?>>
Iterator<D>getFromReplica(D document)
Retrieves one or more, possibly stale, representations of aJsonDocument
by its unique ID with the default timeout.<D extends Document<?>>
Iterator<D>getFromReplica(D document, long timeout, TimeUnit timeUnit)
Retrieves one or more, possibly stale, representations of aJsonDocument
by its unique ID with a custom timeout.<D extends Document<?>>
List<D>getFromReplica(D document, ReplicaMode type)
Retrieves one or more, possibly stale, representations of aJsonDocument
by its unique ID with the default timeout.<D extends Document<?>>
List<D>getFromReplica(D document, ReplicaMode type, long timeout, TimeUnit timeUnit)
Retrieves one or more, possibly stale, representations of aJsonDocument
by its unique ID with a custom timeout.Iterator<JsonDocument>
getFromReplica(String id)
Retrieves one or more, possibly stale, representations of aJsonDocument
by its unique ID with the default timeout.Iterator<JsonDocument>
getFromReplica(String id, long timeout, TimeUnit timeUnit)
Retrieves one or more, possibly stale, representations of aJsonDocument
by its unique ID with a custom timeout.List<JsonDocument>
getFromReplica(String id, ReplicaMode type)
Retrieves one or more, possibly stale, representations of aJsonDocument
by its unique ID with the default timeout.List<JsonDocument>
getFromReplica(String id, ReplicaMode type, long timeout, TimeUnit timeUnit)
Retrieves one or more, possibly stale, representations of aJsonDocument
by its unique ID with a custom timeout.<D extends Document<?>>
List<D>getFromReplica(String id, ReplicaMode type, Class<D> target)
Retrieves one or more, possibly stale, representations of aJsonDocument
by its unique ID with the default timeout.<D extends Document<?>>
List<D>getFromReplica(String id, ReplicaMode type, Class<D> target, long timeout, TimeUnit timeUnit)
Retrieves one or more, possibly stale, representations of aJsonDocument
by its unique ID with a custom timeout.<D extends Document<?>>
Iterator<D>getFromReplica(String id, Class<D> target)
Retrieves one or more, possibly stale, representations of aJsonDocument
by its unique ID with the default timeout.<D extends Document<?>>
Iterator<D>getFromReplica(String id, Class<D> target, long timeout, TimeUnit timeUnit)
Retrieves one or more, possibly stale, representations of aJsonDocument
by its unique ID with a custom timeout.AnalyticsDeferredResultHandle
importAnalyticsDeferredResultHandle(byte[] b)
Imports from json to create aAnalyticsDeferredResultHandle
.<D extends Document<?>>
Dinsert(D document)
Insert aDocument
if it does not exist already with the default key/value timeout.<D extends Document<?>>
Dinsert(D document, long timeout, TimeUnit timeUnit)
Insert aDocument
if it does not exist already with a custom timeout.<D extends Document<?>>
Dinsert(D document, PersistTo persistTo)
Insert aDocument
if it does not exist already and watch for durability constraints with the default key/value timeout.<D extends Document<?>>
Dinsert(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Insert aDocument
if it does not exist already and watch for durability constraints with a custom timeout.<D extends Document<?>>
Dinsert(D document, PersistTo persistTo, ReplicateTo replicateTo)
Insert aDocument
if it does not exist already and watch for durability constraints with the default key/value timeout.<D extends Document<?>>
Dinsert(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Insert aDocument
if it does not exist already and watch for durability constraints with a custom timeout.<D extends Document<?>>
Dinsert(D document, ReplicateTo replicateTo)
Insert aDocument
if it does not exist already and watch for durability constraints with the default key/value timeout.<D extends Document<?>>
Dinsert(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Insert aDocument
if it does not exist already and watch for durability constraints with a custom timeout.int
invalidateQueryCache()
Invalidates and clears the internal query cache.boolean
isClosed()
Returns true if this bucket is already closed, false if it is still open.<E> boolean
listAppend(String docId, E element)
Push an element to tail of CouchbaseList This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.<E> boolean
listAppend(String docId, E element, long timeout, TimeUnit timeUnit)
Push an element to tail of CouchbaseList This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.<E> boolean
listAppend(String docId, E element, MutationOptionBuilder mutationOptionBuilder)
Push an element to tail of CouchbaseList with additional mutation options provided byMutationOptionBuilder
.<E> boolean
listAppend(String docId, E element, MutationOptionBuilder mutationOptionBuilder, long timeout, TimeUnit timeUnit)
Push an element to tail of CouchbaseList with additional mutation options provided byMutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
.<E> E
listGet(String docId, int index, Class<E> elementType)
Get element at an index in the CouchbaseList This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the index is not found in the listPathNotFoundException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.<E> E
listGet(String docId, int index, Class<E> elementType, long timeout, TimeUnit timeUnit)
Get element at an index in the CouchbaseList This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.<E> boolean
listPrepend(String docId, E element)
Shift list head to element in CouchbaseList This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
.<E> boolean
listPrepend(String docId, E element, long timeout, TimeUnit timeUnit)
Shift list head to element in CouchbaseList This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
.<E> boolean
listPrepend(String docId, E element, MutationOptionBuilder mutationOptionBuilder)
Shift list head to element in CouchbaseList with additional mutation options provided byMutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
.<E> boolean
listPrepend(String docId, E element, MutationOptionBuilder mutationOptionBuilder, long timeout, TimeUnit timeUnit)
Shift list head to element in CouchbaseList with additional mutation options provided byMutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
.boolean
listRemove(String docId, int index)
Remove an element from an index in CouchbaseList This method throws under the following conditions: -IndexOutOfBoundsException
if index is not found - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.boolean
listRemove(String docId, int index, long timeout, TimeUnit timeUnit)
Remove an element from an index in CouchbaseList This method throws under the following conditions: -IndexOutOfBoundsException
if index is not found - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.boolean
listRemove(String docId, int index, MutationOptionBuilder mutationOptionBuilder)
Remove an element from an index in CouchbaseList with additional mutation options provided byMutationOptionBuilder
This method throws under the following conditions: -IndexOutOfBoundsException
if index is not found - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
.boolean
listRemove(String docId, int index, MutationOptionBuilder mutationOptionBuilder, long timeout, TimeUnit timeUnit)
Remove an element from an index in CouchbaseList with additional mutation options provided byMutationOptionBuilder
This method throws under the following conditions: -IndexOutOfBoundsException
if index is not found - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
.<E> boolean
listSet(String docId, int index, E element)
Add an element at an index in CouchbaseList This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.<E> boolean
listSet(String docId, int index, E element, long timeout, TimeUnit timeUnit)
Add an element at an index in CouchbaseList This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.<E> boolean
listSet(String docId, int index, E element, MutationOptionBuilder mutationOptionBuilder)
Add an element at an index in CouchbaseList with additional mutation options provided byMutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
.<E> boolean
listSet(String docId, int index, E element, MutationOptionBuilder mutationOptionBuilder, long timeout, TimeUnit timeUnit)
Add an element at an index in CouchbaseList with additional mutation options provided byMutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
.int
listSize(String docId)
Returns the number of elements in CouchbaseList This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.int
listSize(String docId, long timeout, TimeUnit timeUnit)
Returns the number of elements in CouchbaseList This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.LookupInBuilder
lookupIn(String docId)
Prepare a sub-document lookup through abuilder API
.<V> boolean
mapAdd(String docId, String key, V value)
Add a key value pair into CouchbaseMap If the underlying document for the map does not exist, this operation will create a new document to back the data structure.<V> boolean
mapAdd(String docId, String key, V value, long timeout, TimeUnit timeUnit)
Add a key value pair into CouchbaseMap If the underlying document for the map does not exist, this operation will create a new document to back the data structure.<V> boolean
mapAdd(String docId, String key, V value, MutationOptionBuilder mutationOptionBuilder)
Add a key value pair into CouchbaseMap with additional mutation options provided byMutationOptionBuilder
If the underlying document for the map does not exist, this operation will create a new document to back the data structure.<V> boolean
mapAdd(String docId, String key, V value, MutationOptionBuilder mutationOptionBuilder, long timeout, TimeUnit timeUnit)
Add a key value pair into CouchbaseMap with additional mutation options provided byMutationOptionBuilder
If the underlying document for the map does not exist, this operation will create a new document to back the data structure.<V> V
mapGet(String docId, String key, Class<V> valueType)
Get value of a key in the CouchbaseMap This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the key is not found in the mapPathNotFoundException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.<V> V
mapGet(String docId, String key, Class<V> valueType, long timeout, TimeUnit timeUnit)
Get value of a key in the CouchbaseMap This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.boolean
mapRemove(String docId, String key)
Remove a key value pair from CouchbaseMap This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.boolean
mapRemove(String docId, String key, long timeout, TimeUnit timeUnit)
Remove a key value pair from CouchbaseMap This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.boolean
mapRemove(String docId, String key, MutationOptionBuilder mutationOptionBuilder)
Remove a key value pair from CouchbaseMap with additional mutation options provided byMutationOptionBuilder
.boolean
mapRemove(String docId, String key, MutationOptionBuilder mutationOptionBuilder, long timeout, TimeUnit timeUnit)
Remove a key value pair from CouchbaseMap with additional mutation options provided byMutationOptionBuilder
.int
mapSize(String docId)
Returns the number key value pairs in CouchbaseMap This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.int
mapSize(String docId, long timeout, TimeUnit timeUnit)
Returns the number key value pairs in CouchbaseMap This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.MutateInBuilder
mutateIn(String docId)
Prepare a sub-document mutation through abuilder API
.String
name()
The name of theBucket
.PingReport
ping()
Performs a diagnostic active "ping" call with a random report id on all services.PingReport
ping(long timeout, TimeUnit timeUnit)
Performs a diagnostic active "ping" call on all services with a random report id.PingReport
ping(String reportId)
Performs a diagnostic active "ping" call with a custom report ID on all services.PingReport
ping(String reportId, long timeout, TimeUnit timeUnit)
Performs a diagnostic active "ping" call with a custom report ID on all services.PingReport
ping(String reportId, Collection<ServiceType> services)
Performs a diagnostic active "ping" call with a custom report id on all services.PingReport
ping(String reportId, Collection<ServiceType> services, long timeout, TimeUnit timeUnit)
Performs a diagnostic active "ping" call against all the services provided with a custom report id.PingReport
ping(Collection<ServiceType> services)
Performs a diagnostic active "ping" call with a random report id on all services.PingReport
ping(Collection<ServiceType> services, long timeout, TimeUnit timeUnit)
Performs a diagnostic active "ping" call on a list of services with a random report id.<D extends Document<?>>
Dprepend(D document)
Prepend aDocument
s content to an existing one with the default key/value timeout.<D extends Document<?>>
Dprepend(D document, long timeout, TimeUnit timeUnit)
Prepend aDocument
s content to an existing one with a custom timeout.<D extends Document<?>>
Dprepend(D document, PersistTo persistTo)
Prepend aDocument
s content to an existing one with the default key/value timeout.<D extends Document<?>>
Dprepend(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Prepend aDocument
s content to an existing one with a custom timeout.<D extends Document<?>>
Dprepend(D document, PersistTo persistTo, ReplicateTo replicateTo)
Prepend aDocument
s content to an existing one with the default key/value timeout.<D extends Document<?>>
Dprepend(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Prepend aDocument
s content to an existing one with a custom timeout.<D extends Document<?>>
Dprepend(D document, ReplicateTo replicateTo)
Prepend aDocument
s content to an existing one with the default key/value timeout.<D extends Document<?>>
Dprepend(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Prepend aDocument
s content to an existing one with a custom timeout.AnalyticsQueryResult
query(AnalyticsQuery query)
Queries Couchbase AnalyticsAnalyticsQueryResult
query(AnalyticsQuery query, long timeout, TimeUnit timeUnit)
Queries Couchbase AnalyticsN1qlQueryResult
query(N1qlQuery query)
Queries a N1QL secondary index with thedefault query timeout
.N1qlQueryResult
query(N1qlQuery query, long timeout, TimeUnit timeUnit)
Queries a N1QL secondary index with a custom timeout.N1qlQueryResult
query(Statement statement)
Queries a N1QL secondary index with thedefault query timeout
.N1qlQueryResult
query(Statement statement, long timeout, TimeUnit timeUnit)
Queries a N1QL secondary index with a custom timeout.SearchQueryResult
query(SearchQuery query)
Queries a Full-Text Index This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
SearchQueryResult
query(SearchQuery query, long timeout, TimeUnit timeUnit)
Queries a Full-Text Index This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
SpatialViewResult
query(SpatialViewQuery query)
Queries a Couchbase Server SpatialView
with thedefault view timeout
.SpatialViewResult
query(SpatialViewQuery query, long timeout, TimeUnit timeUnit)
Queries a Couchbase Server SpatialView
with a custom timeout.ViewResult
query(ViewQuery query)
Queries a Couchbase ServerView
with thedefault view timeout
.ViewResult
query(ViewQuery query, long timeout, TimeUnit timeUnit)
Queries a Couchbase ServerView
with a custom timeout.<E> E
queuePop(String docId, Class<E> elementType)
Removes the first element from CouchbaseQueue This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.<E> E
queuePop(String docId, Class<E> elementType, long timeout, TimeUnit timeUnit)
Removes the first element from CouchbaseQueue This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.<E> E
queuePop(String docId, Class<E> elementType, MutationOptionBuilder mutationOptionBuilder)
Removes the first element from CouchbaseQueue with additional mutation options provided byMutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
.<E> E
queuePop(String docId, Class<E> elementType, MutationOptionBuilder mutationOptionBuilder, long timeout, TimeUnit timeUnit)
Removes the first element from CouchbaseQueue with additional mutation options provided byMutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
.<E> boolean
queuePush(String docId, E element)
Add an element into CouchbaseQueue This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.<E> boolean
queuePush(String docId, E element, long timeout, TimeUnit timeUnit)
Add an element into CouchbaseQueue This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.<E> boolean
queuePush(String docId, E element, MutationOptionBuilder mutationOptionBuilder)
Add an element into CouchbaseQueue with additional mutation options provided byMutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
.<E> boolean
queuePush(String docId, E element, MutationOptionBuilder mutationOptionBuilder, long timeout, TimeUnit timeUnit)
Add an element into CouchbaseQueue with additional mutation options provided byMutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
.int
queueSize(String docId)
Returns the number of elements in CouchbaseQueue This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.int
queueSize(String docId, long timeout, TimeUnit timeUnit)
Returns the number of elements in CouchbaseQueue This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.<D extends Document<?>>
Dremove(D document)
Removes aDocument
from the Server with the default key/value timeout.<D extends Document<?>>
Dremove(D document, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server with a custom timeout.<D extends Document<?>>
Dremove(D document, PersistTo persistTo)
Removes aDocument
from the Server and apply a durability requirement with the default key/value timeout.<D extends Document<?>>
Dremove(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server and apply a durability requirement with a custom timeout.<D extends Document<?>>
Dremove(D document, PersistTo persistTo, ReplicateTo replicateTo)
Removes aDocument
from the Server and apply a durability requirement with the default key/value timeout.<D extends Document<?>>
Dremove(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server and apply a durability requirement with a custom timeout.<D extends Document<?>>
Dremove(D document, ReplicateTo replicateTo)
Removes aDocument
from the Server and apply a durability requirement with the default key/value timeout.<D extends Document<?>>
Dremove(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server and apply a durability requirement with a custom timeout.JsonDocument
remove(String id)
Removes aDocument
from the Server identified by its ID with the default key/value timeout.JsonDocument
remove(String id, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server identified by its ID with a custom timeout.JsonDocument
remove(String id, PersistTo persistTo)
Removes aDocument
from the Server by its ID and apply a durability requirement with the default key/value timeout.JsonDocument
remove(String id, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server by its ID and apply a durability requirement with a custom timeout.JsonDocument
remove(String id, PersistTo persistTo, ReplicateTo replicateTo)
Removes aDocument
from the Server by its ID and apply a durability requirement with the default key/value timeout.JsonDocument
remove(String id, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server by its ID and apply a durability requirement with a custom timeout.<D extends Document<?>>
Dremove(String id, PersistTo persistTo, ReplicateTo replicateTo, Class<D> target)
Removes aDocument
from the Server by its ID and apply a durability requirement with the default key/value timeout.<D extends Document<?>>
Dremove(String id, PersistTo persistTo, ReplicateTo replicateTo, Class<D> target, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server by its ID and apply a durability requirement with a custom timeout.<D extends Document<?>>
Dremove(String id, PersistTo persistTo, Class<D> target)
Removes aDocument
from the Server by its ID and apply a durability requirement with the default key/value timeout.<D extends Document<?>>
Dremove(String id, PersistTo persistTo, Class<D> target, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server by its ID and apply a durability requirement with a custom timeout.JsonDocument
remove(String id, ReplicateTo replicateTo)
Removes aDocument
from the Server by its ID and apply a durability requirement with the default key/value timeout.JsonDocument
remove(String id, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server by its ID and apply a durability requirement with a custom timeout.<D extends Document<?>>
Dremove(String id, ReplicateTo replicateTo, Class<D> target)
Removes aDocument
from the Server by its ID and apply a durability requirement with the default key/value timeout.<D extends Document<?>>
Dremove(String id, ReplicateTo replicateTo, Class<D> target, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server by its ID and apply a durability requirement with a custom timeout.<D extends Document<?>>
Dremove(String id, Class<D> target)
Removes aDocument
from the Server identified by its ID with the default key/value timeout.<D extends Document<?>>
Dremove(String id, Class<D> target, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server identified by its ID with a custom timeout.<D extends Document<?>>
Dreplace(D document)
Replace aDocument
if it does already exist with the default key/value timeout.<D extends Document<?>>
Dreplace(D document, long timeout, TimeUnit timeUnit)
Replace aDocument
if it does already exist with a custom timeout.<D extends Document<?>>
Dreplace(D document, PersistTo persistTo)
Replace aDocument
if it does exist and watch for durability constraints with the default key/value timeout.<D extends Document<?>>
Dreplace(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Replace aDocument
if it does exist and watch for durability constraints with a custom timeout.<D extends Document<?>>
Dreplace(D document, PersistTo persistTo, ReplicateTo replicateTo)
Replace aDocument
if it does exist and watch for durability constraints with the default key/value timeout.<D extends Document<?>>
Dreplace(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Replace aDocument
if it does exist and watch for durability constraints with a custom timeout.<D extends Document<?>>
Dreplace(D document, ReplicateTo replicateTo)
Replace aDocument
if it does exist and watch for durability constraints with the default key/value timeout.<D extends Document<?>>
Dreplace(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Replace aDocument
if it does exist and watch for durability constraints with a custom timeout.Repository
repository()
TheRepository
provides access to full object document mapping (ODM) capabilities.<E> boolean
setAdd(String docId, E element)
Add an element into CouchbaseSet This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.<E> boolean
setAdd(String docId, E element, long timeout, TimeUnit timeUnit)
Add an element into CouchbaseSet This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.<E> boolean
setAdd(String docId, E element, MutationOptionBuilder mutationOptionBuilder)
Add an element into CouchbaseSet with additional mutation options provided byMutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.<E> boolean
setAdd(String docId, E element, MutationOptionBuilder mutationOptionBuilder, long timeout, TimeUnit timeUnit)
Add an element into CouchbaseSet with additional mutation options provided byMutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.<E> boolean
setContains(String docId, E element)
Check if an element exists in CouchbaseSet This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.<E> boolean
setContains(String docId, E element, long timeout, TimeUnit timeUnit)
Check if an element exists in CouchbaseSet This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.<E> E
setRemove(String docId, E element)
Removes an element from CouchbaseSet This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.<E> E
setRemove(String docId, E element, long timeout, TimeUnit timeUnit)
Removes an element from CouchbaseSet This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.<E> E
setRemove(String docId, E element, MutationOptionBuilder mutationOptionBuilder)
Removes an element from CouchbaseSet with additional mutation options provided byMutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
.<E> E
setRemove(String docId, E element, MutationOptionBuilder mutationOptionBuilder, long timeout, TimeUnit timeUnit)
Removes an element from CouchbaseSet with additional mutation options provided byMutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
.int
setSize(String docId)
Returns the number of elements in CouchbaseSet This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.int
setSize(String docId, long timeout, TimeUnit timeUnit)
Returns the number of elements in CouchbaseSet This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.<D extends Document<?>>
Booleantouch(D document)
Renews the expiration time of aDocument
with the default key/value timeout.<D extends Document<?>>
Booleantouch(D document, long timeout, TimeUnit timeUnit)
Renews the expiration time of aDocument
with a custom timeout.Boolean
touch(String id, int expiry)
Renews the expiration time of aDocument
with the default key/value timeout.Boolean
touch(String id, int expiry, long timeout, TimeUnit timeUnit)
Renews the expiration time of aDocument
with a custom timeout.<D extends Document<?>>
Booleanunlock(D document)
Unlocks a write-lockedDocument
with the default key/value timeout.<D extends Document<?>>
Booleanunlock(D document, long timeout, TimeUnit timeUnit)
Unlocks a write-lockedDocument
with a custom timeout.Boolean
unlock(String id, long cas)
Unlocks a write-lockedDocument
with the default key/value timeout.Boolean
unlock(String id, long cas, long timeout, TimeUnit timeUnit)
Unlocks a write-lockedDocument
with a custom timeout.<D extends Document<?>>
Dupsert(D document)
Insert or overwrite aDocument
with the default key/value timeout.<D extends Document<?>>
Dupsert(D document, long timeout, TimeUnit timeUnit)
Insert or overwrite aDocument
with a custom timeout.<D extends Document<?>>
Dupsert(D document, PersistTo persistTo)
Insert or overwrite aDocument
and watch for durability constraints with the default key/value timeout.<D extends Document<?>>
Dupsert(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Insert or overwrite aDocument
and watch for durability constraints with a custom timeout.<D extends Document<?>>
Dupsert(D document, PersistTo persistTo, ReplicateTo replicateTo)
Insert or overwrite aDocument
and watch for durability constraints with the default key/value timeout.<D extends Document<?>>
Dupsert(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Insert or overwrite aDocument
and watch for durability constraints with a custom timeout.<D extends Document<?>>
Dupsert(D document, ReplicateTo replicateTo)
Insert or overwrite aDocument
and watch for durability constraints with the default key/value timeout.<D extends Document<?>>
Dupsert(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Insert or overwrite aDocument
and watch for durability constraints with a custom timeout.
-
-
-
Method Detail
-
async
AsyncBucket async()
Provides access to the underlying asynchronous bucket interface.- Returns:
- the asynchronous bucket.
-
core
ClusterFacade core()
Returns the underlying "core-io" library through itsClusterFacade
. Handle with care, with great power comes great responsibility. All additional checks which are normally performed by this library are skipped.- Returns:
- the underlying
ClusterFacade
from the "core-io" package.
-
environment
CouchbaseEnvironment environment()
TheCouchbaseEnvironment
used.- Returns:
- the CouchbaseEnvironment.
-
get
JsonDocument get(String id)
Retrieves aJsonDocument
by its unique ID with the default key/value timeout. If the document is found, aJsonDocument
is returned. If the document is not found, null is returned. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the unique ID of the document.- Returns:
- the found
JsonDocument
or null if not found.
-
get
JsonDocument get(String id, long timeout, TimeUnit timeUnit)
Retrieves aJsonDocument
by its unique ID with a custom timeout. If the document is found, aJsonDocument
is returned. If the document is not found, null is returned. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the unique ID of the document.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- the found
JsonDocument
or null if not found.
-
get
<D extends Document<?>> D get(D document)
Retrieves any type ofDocument
with the default key/value timeout. The document ID is taken out of theDocument
provided, as well as the target type to return. Note that not the same document is returned, but rather a new one of the same type with the freshly loaded properties. If the document is found, aDocument
is returned. If the document is not found, theObservable
completes without an item emitted. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
document
- the source document from which the ID is taken and the type is inferred.- Returns:
- the found
Document
or null.
-
get
<D extends Document<?>> D get(D document, long timeout, TimeUnit timeUnit)
Retrieves any type ofDocument
with a custom timeout. The document ID is taken out of theDocument
provided, as well as the target type to return. Note that not the same document is returned, but rather a new one of the same type with the freshly loaded properties. If the document is found, aDocument
is returned. If the document is not found, theObservable
completes without an item emitted. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
document
- the source document from which the ID is taken and the type is inferred.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- the found
Document
or null.
-
get
<D extends Document<?>> D get(String id, Class<D> target)
Retrieves any type ofDocument
by its ID with the default key/value timeout. The document ID is taken out of theDocument
provided, as well as the target type to return. Note that not the same document is returned, but rather a new one of the same type with the freshly loaded properties. If the document is found, aDocument
is returned. If the document is not found, theObservable
completes without an item emitted. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the id of the document.target
- the target document type to use.- Returns:
- the found
Document
or null.
-
get
<D extends Document<?>> D get(String id, Class<D> target, long timeout, TimeUnit timeUnit)
Retrieves any type ofDocument
by its ID with a custom timeout. The document ID is taken out of theDocument
provided, as well as the target type to return. Note that not the same document is returned, but rather a new one of the same type with the freshly loaded properties. If the document is found, aDocument
is returned. If the document is not found, theObservable
completes without an item emitted. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the id of the document.target
- the target document type to use.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- the found
Document
or null.
-
exists
boolean exists(String id)
Check whether a document with the given ID does exist in the bucket. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the id of the document.- Returns:
- true if it exists, false otherwise.
-
exists
boolean exists(String id, long timeout, TimeUnit timeUnit)
Check whether a document with the given ID does exist in the bucket. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the id of the document.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- true if it exists, false otherwise.
-
exists
<D extends Document<?>> boolean exists(D document)
Check whether a document with the given ID does exist in the bucket. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
document
- the document where the ID is extracted from.- Returns:
- true if it exists, false otherwise.
-
exists
<D extends Document<?>> boolean exists(D document, long timeout, TimeUnit timeUnit)
Check whether a document with the given ID does exist in the bucket. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
document
- the document where the ID is extracted from.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- true if it exists, false otherwise.
-
getFromReplica
List<JsonDocument> getFromReplica(String id, ReplicaMode type)
Retrieves one or more, possibly stale, representations of aJsonDocument
by its unique ID with the default timeout. Depending on theReplicaMode
selected, there can be none to fourJsonDocument
be returned from theObservable
. IfReplicaMode.FIRST
,ReplicaMode.SECOND
orReplicaMode.THIRD
are selected zero or one documents are returned, ifReplicaMode.ALL
is used, all configured replicas plus the master node may return a document. If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes. **Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriateReplicateTo
constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returningJsonDocument
responses can come in any order. Because this method is considered to be a "last resort" call against the database if a regular get didn't succeed, most errors are swallowed (but logged) and the Observable will return all successful responses. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- Parameters:
id
- id the unique ID of the document.type
- theReplicaMode
to select.- Returns:
- a List containing zero to N
JsonDocument
s.
-
getFromReplica
Iterator<JsonDocument> getFromReplica(String id)
Retrieves one or more, possibly stale, representations of aJsonDocument
by its unique ID with the default timeout. This method has theReplicaMode.ALL
preselected. If you are only interested in the first (or just some) values, you can iterate and then break out of the iterator loop. Documents are pushed into the iterator as they arrive, which distinguishes this method from theList
equivalents which wait until all responses arrive. If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes. **Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriateReplicateTo
constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returningJsonDocument
responses can come in any order. Because this method is considered to be a "last resort" call against the database if a regular get didn't succeed, most errors are swallowed (but logged) and the Observable will return all successful responses. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- Parameters:
id
- the unique ID of the document.- Returns:
- the Iterator containing Documents as they arrive.
-
getFromReplica
List<JsonDocument> getFromReplica(String id, ReplicaMode type, long timeout, TimeUnit timeUnit)
Retrieves one or more, possibly stale, representations of aJsonDocument
by its unique ID with a custom timeout. Depending on theReplicaMode
selected, there can be none to fourJsonDocument
be returned from theObservable
. IfReplicaMode.FIRST
,ReplicaMode.SECOND
orReplicaMode.THIRD
are selected zero or one documents are returned, ifReplicaMode.ALL
is used, all configured replicas plus the master node may return a document. If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes. **Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriateReplicateTo
constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returningJsonDocument
responses can come in any order. Because this method is considered to be a "last resort" call against the database if a regular get didn't succeed, most errors are swallowed (but logged) and the Observable will return all successful responses. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- Parameters:
id
- id the unique ID of the document.type
- theReplicaMode
to select.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a List containing zero to N
JsonDocument
s.
-
getFromReplica
Iterator<JsonDocument> getFromReplica(String id, long timeout, TimeUnit timeUnit)
Retrieves one or more, possibly stale, representations of aJsonDocument
by its unique ID with a custom timeout. This method has theReplicaMode.ALL
preselected. If you are only interested in the first (or just some) values, you can iterate and then break out of the iterator loop. Documents are pushed into the iterator as they arrive, which distinguishes this method from theList
equivalents which wait until all responses arrive. If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes. **Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriateReplicateTo
constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returningJsonDocument
responses can come in any order. Because this method is considered to be a "last resort" call against the database if a regular get didn't succeed, most errors are swallowed (but logged) and the Observable will return all successful responses. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- Parameters:
id
- the unique ID of the document.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- the Iterator containing Documents as they arrive.
-
getFromReplica
<D extends Document<?>> List<D> getFromReplica(D document, ReplicaMode type)
Retrieves one or more, possibly stale, representations of aJsonDocument
by its unique ID with the default timeout. Depending on theReplicaMode
selected, there can be none to fourJsonDocument
be returned from theObservable
. IfReplicaMode.FIRST
,ReplicaMode.SECOND
orReplicaMode.THIRD
are selected zero or one documents are returned, ifReplicaMode.ALL
is used, all configured replicas plus the master node may return a document. If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes. **Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriateReplicateTo
constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returningJsonDocument
responses can come in any order. Because this method is considered to be a "last resort" call against the database if a regular get didn't succeed, most errors are swallowed (but logged) and the Observable will return all successful responses. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- Parameters:
document
- the document to extract the ID from.type
- theReplicaMode
to select.- Returns:
- a List containing zero to N
JsonDocument
s.
-
getFromReplica
<D extends Document<?>> Iterator<D> getFromReplica(D document)
Retrieves one or more, possibly stale, representations of aJsonDocument
by its unique ID with the default timeout. This method has theReplicaMode.ALL
preselected. If you are only interested in the first (or just some) values, you can iterate and then break out of the iterator loop. Documents are pushed into the iterator as they arrive, which distinguishes this method from theList
equivalents which wait until all responses arrive. If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes. **Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriateReplicateTo
constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returningJsonDocument
responses can come in any order. Because this method is considered to be a "last resort" call against the database if a regular get didn't succeed, most errors are swallowed (but logged) and the Observable will return all successful responses. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- Parameters:
document
- the document to extract the ID from.- Returns:
- the Iterator containing Documents as they arrive.
-
getFromReplica
<D extends Document<?>> List<D> getFromReplica(D document, ReplicaMode type, long timeout, TimeUnit timeUnit)
Retrieves one or more, possibly stale, representations of aJsonDocument
by its unique ID with a custom timeout. Depending on theReplicaMode
selected, there can be none to fourJsonDocument
be returned from theObservable
. IfReplicaMode.FIRST
,ReplicaMode.SECOND
orReplicaMode.THIRD
are selected zero or one documents are returned, ifReplicaMode.ALL
is used, all configured replicas plus the master node may return a document. If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes. **Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriateReplicateTo
constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returningJsonDocument
responses can come in any order. Because this method is considered to be a "last resort" call against the database if a regular get didn't succeed, most errors are swallowed (but logged) and the Observable will return all successful responses. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- Parameters:
document
- the document to extract the ID from.type
- theReplicaMode
to select.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a List containing zero to N
JsonDocument
s.
-
getFromReplica
<D extends Document<?>> Iterator<D> getFromReplica(D document, long timeout, TimeUnit timeUnit)
Retrieves one or more, possibly stale, representations of aJsonDocument
by its unique ID with a custom timeout. This method has theReplicaMode.ALL
preselected. If you are only interested in the first (or just some) values, you can iterate and then break out of the iterator loop. Documents are pushed into the iterator as they arrive, which distinguishes this method from theList
equivalents which wait until all responses arrive. If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes. **Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriateReplicateTo
constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returningJsonDocument
responses can come in any order. Because this method is considered to be a "last resort" call against the database if a regular get didn't succeed, most errors are swallowed (but logged) and the Observable will return all successful responses. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- Parameters:
document
- the document to extract the ID from.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- the Iterator containing Documents as they arrive.
-
getFromReplica
<D extends Document<?>> List<D> getFromReplica(String id, ReplicaMode type, Class<D> target)
Retrieves one or more, possibly stale, representations of aJsonDocument
by its unique ID with the default timeout. Depending on theReplicaMode
selected, there can be none to fourJsonDocument
be returned from theObservable
. IfReplicaMode.FIRST
,ReplicaMode.SECOND
orReplicaMode.THIRD
are selected zero or one documents are returned, ifReplicaMode.ALL
is used, all configured replicas plus the master node may return a document. If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes. **Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriateReplicateTo
constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returningJsonDocument
responses can come in any order. Because this method is considered to be a "last resort" call against the database if a regular get didn't succeed, most errors are swallowed (but logged) and the Observable will return all successful responses. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- Parameters:
id
- the id of the document.type
- theReplicaMode
to select.- Returns:
- a List containing zero to N
JsonDocument
s.
-
getFromReplica
<D extends Document<?>> Iterator<D> getFromReplica(String id, Class<D> target)
Retrieves one or more, possibly stale, representations of aJsonDocument
by its unique ID with the default timeout. This method has theReplicaMode.ALL
preselected. If you are only interested in the first (or just some) values, you can iterate and then break out of the iterator loop. Documents are pushed into the iterator as they arrive, which distinguishes this method from theList
equivalents which wait until all responses arrive. If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes. **Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriateReplicateTo
constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returningJsonDocument
responses can come in any order. Because this method is considered to be a "last resort" call against the database if a regular get didn't succeed, most errors are swallowed (but logged) and the Observable will return all successful responses. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- Parameters:
id
- the unique ID of the document.target
- the target document type to use.- Returns:
- the Iterator containing Documents as they arrive.
-
getFromReplica
<D extends Document<?>> List<D> getFromReplica(String id, ReplicaMode type, Class<D> target, long timeout, TimeUnit timeUnit)
Retrieves one or more, possibly stale, representations of aJsonDocument
by its unique ID with a custom timeout. Depending on theReplicaMode
selected, there can be none to fourJsonDocument
be returned from theObservable
. IfReplicaMode.FIRST
,ReplicaMode.SECOND
orReplicaMode.THIRD
are selected zero or one documents are returned, ifReplicaMode.ALL
is used, all configured replicas plus the master node may return a document. If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes. **Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriateReplicateTo
constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returningJsonDocument
responses can come in any order. Because this method is considered to be a "last resort" call against the database if a regular get didn't succeed, most errors are swallowed (but logged) and the Observable will return all successful responses. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- Parameters:
id
- the id of the document.type
- theReplicaMode
to select.target
- the target document type to use.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a List containing zero to N
JsonDocument
s.
-
getFromReplica
<D extends Document<?>> Iterator<D> getFromReplica(String id, Class<D> target, long timeout, TimeUnit timeUnit)
Retrieves one or more, possibly stale, representations of aJsonDocument
by its unique ID with a custom timeout. This method has theReplicaMode.ALL
preselected. If you are only interested in the first (or just some) values, you can iterate and then break out of the iterator loop. Documents are pushed into the iterator as they arrive, which distinguishes this method from theList
equivalents which wait until all responses arrive. If the document has not been replicated yet or if the replica or master are not available (because a node has been failed over), no response is expected from these nodes. **Since data is replicated asynchronously, all data returned from this method must be considered stale. If the appropriateReplicateTo
constraints are set on write and the operation returns successfully, then the data can be considered as non-stale.** Note that the returningJsonDocument
responses can come in any order. Because this method is considered to be a "last resort" call against the database if a regular get didn't succeed, most errors are swallowed (but logged) and the Observable will return all successful responses. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- Parameters:
id
- the unique ID of the document.target
- the target document type to use.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- the Iterator containing Documents as they arrive.
-
getAndLock
JsonDocument getAndLock(String id, int lockTime)
Retrieve and lock aJsonDocument
by its unique ID with the default key/value timeout. If the document is found, aJsonDocument
is returned. If the document is not found, theObservable
completes without an item emitted. This method works similar toget(String)
, but in addition it (write) locks the document for the given lock time interval. Note that this lock time is hard capped to 30 seconds, even if provided with a higher value and is not configurable. The document will unlock afterwards automatically. Detecting an already locked document is done by checking forTemporaryLockFailureException
. Note that this exception can also be raised in other conditions, always when the error is transient and retrying may help. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- A transient error occurred, most probably the key was already locked:TemporaryLockFailureException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- id the unique ID of the document.lockTime
- the time to write lock the document (max. 30 seconds).- Returns:
- the found
JsonDocument
or null.
-
getAndLock
JsonDocument getAndLock(String id, int lockTime, long timeout, TimeUnit timeUnit)
Retrieve and lock aJsonDocument
by its unique ID with a custom timeout. If the document is found, aJsonDocument
is returned. If the document is not found, theObservable
completes without an item emitted. This method works similar toget(String)
, but in addition it (write) locks the document for the given lock time interval. Note that this lock time is hard capped to 30 seconds, even if provided with a higher value and is not configurable. The document will unlock afterwards automatically. Detecting an already locked document is done by checking forTemporaryLockFailureException
. Note that this exception can also be raised in other conditions, always when the error is transient and retrying may help. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- A transient error occurred, most probably the key was already locked:TemporaryLockFailureException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- id the unique ID of the document.lockTime
- the time to write lock the document (max. 30 seconds).timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- the found
JsonDocument
or null.
-
getAndLock
<D extends Document<?>> D getAndLock(D document, int lockTime)
Retrieve and lock aDocument
by its unique ID with the default key/value timeout. If the document is found, aDocument
is returned. If the document is not found, theObservable
completes without an item emitted. This method works similar toget(Document)
, but in addition it (write) locks the document for the given lock time interval. Note that this lock time is hard capped to 30 seconds, even if provided with a higher value and is not configurable. The document will unlock afterwards automatically. Detecting an already locked document is done by checking forTemporaryLockFailureException
. Note that this exception can also be raised in other conditions, always when the error is transient and retrying may help. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- A transient error occurred, most probably the key was already locked:TemporaryLockFailureException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
document
- the source document from which the ID is taken and the type is inferred.lockTime
- the time to write lock the document (max. 30 seconds).- Returns:
- the found
Document
or null.
-
getAndLock
<D extends Document<?>> D getAndLock(D document, int lockTime, long timeout, TimeUnit timeUnit)
Retrieve and lock aDocument
by its unique ID with a custom timeout. If the document is found, aDocument
is returned. If the document is not found, theObservable
completes without an item emitted. This method works similar toget(Document)
, but in addition it (write) locks the document for the given lock time interval. Note that this lock time is hard capped to 30 seconds, even if provided with a higher value and is not configurable. The document will unlock afterwards automatically. Detecting an already locked document is done by checking forTemporaryLockFailureException
. Note that this exception can also be raised in other conditions, always when the error is transient and retrying may help. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- A transient error occurred, most probably the key was already locked:TemporaryLockFailureException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
document
- the source document from which the ID is taken and the type is inferred.lockTime
- the time to write lock the document (max. 30 seconds).timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- the found
Document
or null.
-
getAndLock
<D extends Document<?>> D getAndLock(String id, int lockTime, Class<D> target)
Retrieve and lock aDocument
by its unique ID with the default key/value timeout. This method differs fromgetAndLock(String, int)
in that if a specificDocument
type is passed in, the appropriateTranscoder
will be selected (and not JSON conversion). If the document is found, aDocument
is returned. If the document is not found, theObservable
completes without an item emitted. This method works similar toget(String)
, but in addition it (write) locks the document for the given lock time interval. Note that this lock time is hard capped to 30 seconds, even if provided with a higher value and is not configurable. The document will unlock afterwards automatically. Detecting an already locked document is done by checking forTemporaryLockFailureException
. Note that this exception can also be raised in other conditions, always when the error is transient and retrying may help. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- A transient error occurred, most probably the key was already locked:TemporaryLockFailureException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- id the unique ID of the document.lockTime
- the time to write lock the document (max. 30 seconds).target
- the target document type to use.- Returns:
- the found
Document
or null.
-
getAndLock
<D extends Document<?>> D getAndLock(String id, int lockTime, Class<D> target, long timeout, TimeUnit timeUnit)
Retrieve and lock aDocument
by its unique ID with the a custom timeout. This method differs fromgetAndLock(String, int)
in that if a specificDocument
type is passed in, the appropriateTranscoder
will be selected (and not JSON conversion). If the document is found, aDocument
is returned. If the document is not found, theObservable
completes without an item emitted. This method works similar toget(String)
, but in addition it (write) locks the document for the given lock time interval. Note that this lock time is hard capped to 30 seconds, even if provided with a higher value and is not configurable. The document will unlock afterwards automatically. Detecting an already locked document is done by checking forTemporaryLockFailureException
. Note that this exception can also be raised in other conditions, always when the error is transient and retrying may help. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- A transient error occurred, most probably the key was already locked:TemporaryLockFailureException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- id the unique ID of the document.lockTime
- the time to write lock the document (max. 30 seconds).target
- the target document type to use.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- the found
Document
or null.
-
getAndTouch
JsonDocument getAndTouch(String id, int expiry)
Retrieve and touch aJsonDocument
by its unique ID with the default key/value timeout. If the document is found, aJsonDocument
is returned. If the document is not found, theObservable
completes without an item emitted. This method works similar toget(String)
, but in addition it touches the document, which will reset its configured expiration time to the value provided. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- id the unique ID of the document.expiry
- the new expiration time for the document.- Returns:
- the found
JsonDocument
or null.
-
getAndTouch
JsonDocument getAndTouch(String id, int expiry, long timeout, TimeUnit timeUnit)
Retrieve and touch aJsonDocument
by its unique ID with the a custom timeout. If the document is found, aJsonDocument
is returned. If the document is not found, theObservable
completes without an item emitted. This method works similar toget(String)
, but in addition it touches the document, which will reset its configured expiration time to the value provided. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- id the unique ID of the document.expiry
- the new expiration time for the document.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- the found
JsonDocument
or null.
-
getAndTouch
<D extends Document<?>> D getAndTouch(D document)
Retrieve and touch aDocument
by its unique ID with the default key/value timeout. If the document is found, aDocument
is returned. If the document is not found, theObservable
completes without an item emitted. This method works similar toget(Document)
, but in addition it touches the document, which will reset its configured expiration time set on the given document itself. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
document
- the source document from which the ID and expiry is taken and the type is inferred.- Returns:
- the found
Document
or null.
-
getAndTouch
<D extends Document<?>> D getAndTouch(D document, long timeout, TimeUnit timeUnit)
Retrieve and touch aDocument
by its unique ID with a custom timeout. If the document is found, aDocument
is returned. If the document is not found, theObservable
completes without an item emitted. This method works similar toget(Document)
, but in addition it touches the document, which will reset its configured expiration time set on the given document itself. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
document
- the source document from which the ID and expiry is taken and the type is inferred.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- the found
Document
or null.
-
getAndTouch
<D extends Document<?>> D getAndTouch(String id, int expiry, Class<D> target)
Retrieve and touch aDocument
by its unique ID with the default key/value timeout. This method differs fromgetAndTouch(String, int)
in that if a specificDocument
type is passed in, the appropriateTranscoder
will be selected (and not JSON conversion). If the document is found, aJsonDocument
is returned. If the document is not found, theObservable
completes without an item emitted. This method works similar toget(String, Class)
, but in addition it touches the document, which will reset its configured expiration time to the value provided. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- id the unique ID of the document.expiry
- the new expiration time for the document.target
- the target document type to use.- Returns:
- the found
Document
or null.
-
getAndTouch
<D extends Document<?>> D getAndTouch(String id, int expiry, Class<D> target, long timeout, TimeUnit timeUnit)
Retrieve and touch aDocument
by its unique ID with a custom timeout. This method differs fromgetAndTouch(String, int)
in that if a specificDocument
type is passed in, the appropriateTranscoder
will be selected (and not JSON conversion). If the document is found, aJsonDocument
is returned. If the document is not found, theObservable
completes without an item emitted. This method works similar toget(String, Class)
, but in addition it touches the document, which will reset its configured expiration time to the value provided. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- id the unique ID of the document.expiry
- the new expiration time for the document.target
- the target document type to use.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- the found
Document
or null.
-
insert
<D extends Document<?>> D insert(D document)
Insert aDocument
if it does not exist already with the default key/value timeout. If the givenDocument
(identified by its unique ID) already exists, the observable errors with aDocumentAlreadyExistsException
. If the operation should also override the existingDocument
,upsert(Document)
should be used instead. It will always either return a document or fail with an error. The returnedDocument
contains original properties, but has the refreshed CAS value set. This operation will return successfully if theDocument
has been acknowledged in the managed cache layer on the master server node. If increased data durability is a concern,insert(Document, PersistTo, ReplicateTo)
should be used instead. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The request content is too big:RequestTooBigException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.
-
insert
<D extends Document<?>> D insert(D document, long timeout, TimeUnit timeUnit)
Insert aDocument
if it does not exist already with a custom timeout. If the givenDocument
(identified by its unique ID) already exists, the observable errors with aDocumentAlreadyExistsException
. If the operation should also override the existingDocument
,upsert(Document)
should be used instead. It will always either return a document or fail with an error. The returnedDocument
contains original properties, but has the refreshed CAS value set. This operation will return successfully if theDocument
has been acknowledged in the managed cache layer on the master server node. If increased data durability is a concern,insert(Document, PersistTo, ReplicateTo)
should be used instead. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The request content is too big:RequestTooBigException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.
-
insert
<D extends Document<?>> D insert(D document, PersistTo persistTo, ReplicateTo replicateTo)
Insert aDocument
if it does not exist already and watch for durability constraints with the default key/value timeout. This method works exactly likeinsert(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The original insert failed because the document is already stored:DocumentAlreadyExistsException
- The request content is too big:RequestTooBigException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original insert has already happened, so the actual insert and the watching for durability constraints are two separate tasks internally.**
-
insert
<D extends Document<?>> D insert(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Insert aDocument
if it does not exist already and watch for durability constraints with a custom timeout. This method works exactly likeinsert(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The original insert failed because the document is already stored:DocumentAlreadyExistsException
- The request content is too big:RequestTooBigException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original insert has already happened, so the actual insert and the watching for durability constraints are two separate tasks internally.**
-
insert
<D extends Document<?>> D insert(D document, PersistTo persistTo)
Insert aDocument
if it does not exist already and watch for durability constraints with the default key/value timeout. This method works exactly likeinsert(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The original insert failed because the document is already stored:DocumentAlreadyExistsException
- The request content is too big:RequestTooBigException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original insert has already happened, so the actual insert and the watching for durability constraints are two separate tasks internally.**
-
insert
<D extends Document<?>> D insert(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Insert aDocument
if it does not exist already and watch for durability constraints with a custom timeout. This method works exactly likeinsert(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The original insert failed because the document is already stored:DocumentAlreadyExistsException
- The request content is too big:RequestTooBigException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original insert has already happened, so the actual insert and the watching for durability constraints are two separate tasks internally.**
-
insert
<D extends Document<?>> D insert(D document, ReplicateTo replicateTo)
Insert aDocument
if it does not exist already and watch for durability constraints with the default key/value timeout. This method works exactly likeinsert(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The original insert failed because the document is already stored:DocumentAlreadyExistsException
- The request content is too big:RequestTooBigException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original insert has already happened, so the actual insert and the watching for durability constraints are two separate tasks internally.**
-
insert
<D extends Document<?>> D insert(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Insert aDocument
if it does not exist already and watch for durability constraints with a custom timeout. This method works exactly likeinsert(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The original insert failed because the document is already stored:DocumentAlreadyExistsException
- The request content is too big:RequestTooBigException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original insert has already happened, so the actual insert and the watching for durability constraints are two separate tasks internally.**
-
upsert
<D extends Document<?>> D upsert(D document)
Insert or overwrite aDocument
with the default key/value timeout. If the givenDocument
(identified by its unique ID) already exists, it will be overridden by the current one. The returnedDocument
contains original properties, but has the refreshed CAS value set. Please note that this method will not use theDocument.cas()
for optimistic concurrency checks. If this behavior is needed, thereplace(Document)
method needs to be used. This operation will return successfully if theDocument
has been acknowledged in the managed cache layer on the master server node. If increased data durability is a concern,upsert(Document, PersistTo, ReplicateTo)
should be used instead. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The request content is too big:RequestTooBigException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.
-
upsert
<D extends Document<?>> D upsert(D document, long timeout, TimeUnit timeUnit)
Insert or overwrite aDocument
with a custom timeout. If the givenDocument
(identified by its unique ID) already exists, it will be overridden by the current one. The returnedDocument
contains original properties, but has the refreshed CAS value set. Please note that this method will not use theDocument.cas()
for optimistic concurrency checks. If this behavior is needed, thereplace(Document, long, TimeUnit)
method needs to be used. This operation will return successfully if theDocument
has been acknowledged in the managed cache layer on the master server node. If increased data durability is a concern,upsert(Document, PersistTo, ReplicateTo)
should be used instead. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The request content is too big:RequestTooBigException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.
-
upsert
<D extends Document<?>> D upsert(D document, PersistTo persistTo, ReplicateTo replicateTo)
Insert or overwrite aDocument
and watch for durability constraints with the default key/value timeout. This method works exactly likeupsert(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. Please note that this method will not use theDocument.cas()
for optimistic concurrency checks. If this behavior is needed, thereplace(Document, PersistTo, ReplicateTo)
method needs to be used. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The request content is too big:RequestTooBigException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original upsert has already happened, so the actual upsert and the watching for durability constraints are two separate tasks internally.**
-
upsert
<D extends Document<?>> D upsert(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Insert or overwrite aDocument
and watch for durability constraints with a custom timeout. This method works exactly likeupsert(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. Please note that this method will not use theDocument.cas()
for optimistic concurrency checks. If this behavior is needed, thereplace(Document, PersistTo, ReplicateTo, long, TimeUnit)
method needs to be used. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The request content is too big:RequestTooBigException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original upsert has already happened, so the actual upsert and the watching for durability constraints are two separate tasks internally.**
-
upsert
<D extends Document<?>> D upsert(D document, PersistTo persistTo)
Insert or overwrite aDocument
and watch for durability constraints with the default key/value timeout. This method works exactly likeupsert(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. Please note that this method will not use theDocument.cas()
for optimistic concurrency checks. If this behavior is needed, thereplace(Document, PersistTo)
method needs to be used. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The request content is too big:RequestTooBigException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original upsert has already happened, so the actual upsert and the watching for durability constraints are two separate tasks internally.**
-
upsert
<D extends Document<?>> D upsert(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Insert or overwrite aDocument
and watch for durability constraints with a custom timeout. This method works exactly likeupsert(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. Please note that this method will not use theDocument.cas()
for optimistic concurrency checks. If this behavior is needed, thereplace(Document, PersistTo, long, TimeUnit)
method needs to be used. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The request content is too big:RequestTooBigException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original upsert has already happened, so the actual upsert and the watching for durability constraints are two separate tasks internally.**
-
upsert
<D extends Document<?>> D upsert(D document, ReplicateTo replicateTo)
Insert or overwrite aDocument
and watch for durability constraints with the default key/value timeout. This method works exactly likeupsert(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. Please note that this method will not use theDocument.cas()
for optimistic concurrency checks. If this behavior is needed, thereplace(Document, ReplicateTo)
method needs to be used. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The request content is too big:RequestTooBigException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original upsert has already happened, so the actual upsert and the watching for durability constraints are two separate tasks internally.**
-
upsert
<D extends Document<?>> D upsert(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Insert or overwrite aDocument
and watch for durability constraints with a custom timeout. This method works exactly likeupsert(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. Please note that this method will not use theDocument.cas()
for optimistic concurrency checks. If this behavior is needed, thereplace(Document, ReplicateTo, long, TimeUnit)
method needs to be used. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The request content is too big:RequestTooBigException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original upsert has already happened, so the actual upsert and the watching for durability constraints are two separate tasks internally.**
-
replace
<D extends Document<?>> D replace(D document)
Replace aDocument
if it does already exist with the default key/value timeout. If the givenDocument
(identified by its unique ID) does not exist already, the method errors with aDocumentDoesNotExistException
. If the operation should also insert theDocument
,upsert(Document)
should be used instead. It will always either return a document or fail with an error. The returnedDocument
contains original properties, but has the refreshed CAS value set. This operation will return successfully if theDocument
has been acknowledged in the managed cache layer on the master server node. If increased data durability is a concern,replace(Document, PersistTo, ReplicateTo)
should be used instead. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The original replace failed because the document does not exist:DocumentDoesNotExistException
- The request content is too big:RequestTooBigException
- A CAS value was set and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.
-
replace
<D extends Document<?>> D replace(D document, long timeout, TimeUnit timeUnit)
Replace aDocument
if it does already exist with a custom timeout. If the givenDocument
(identified by its unique ID) does not exist already, the method errors with aDocumentDoesNotExistException
. If the operation should also insert theDocument
,upsert(Document)
should be used instead. It will always either return a document or fail with an error. The returnedDocument
contains original properties, but has the refreshed CAS value set. This operation will return successfully if theDocument
has been acknowledged in the managed cache layer on the master server node. If increased data durability is a concern,replace(Document, PersistTo, ReplicateTo)
should be used instead. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The original replace failed because the document does not exist:DocumentDoesNotExistException
- The request content is too big:RequestTooBigException
- A CAS value was set and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.
-
replace
<D extends Document<?>> D replace(D document, PersistTo persistTo, ReplicateTo replicateTo)
Replace aDocument
if it does exist and watch for durability constraints with the default key/value timeout. This method works exactly likereplace(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The original replace failed because the document does not exist:DocumentDoesNotExistException
- The request content is too big:RequestTooBigException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - A CAS value was set and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original replace has already happened, so the actual replace and the watching for durability constraints are two separate tasks internally.**
-
replace
<D extends Document<?>> D replace(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Replace aDocument
if it does exist and watch for durability constraints with a custom timeout. This method works exactly likereplace(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The original replace failed because the document does not exist:DocumentDoesNotExistException
- The request content is too big:RequestTooBigException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - A CAS value was set and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original replace has already happened, so the actual replace and the watching for durability constraints are two separate tasks internally.**
-
replace
<D extends Document<?>> D replace(D document, PersistTo persistTo)
Replace aDocument
if it does exist and watch for durability constraints with the default key/value timeout. This method works exactly likereplace(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The original replace failed because the document does not exist:DocumentDoesNotExistException
- The request content is too big:RequestTooBigException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - A CAS value was set and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original replace has already happened, so the actual replace and the watching for durability constraints are two separate tasks internally.**
-
replace
<D extends Document<?>> D replace(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Replace aDocument
if it does exist and watch for durability constraints with a custom timeout. This method works exactly likereplace(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The original replace failed because the document does not exist:DocumentDoesNotExistException
- The request content is too big:RequestTooBigException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - A CAS value was set and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original replace has already happened, so the actual replace and the watching for durability constraints are two separate tasks internally.**
-
replace
<D extends Document<?>> D replace(D document, ReplicateTo replicateTo)
Replace aDocument
if it does exist and watch for durability constraints with the default key/value timeout. This method works exactly likereplace(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The original replace failed because the document does not exist:DocumentDoesNotExistException
- The request content is too big:RequestTooBigException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - A CAS value was set and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original replace has already happened, so the actual replace and the watching for durability constraints are two separate tasks internally.**
-
replace
<D extends Document<?>> D replace(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Replace aDocument
if it does exist and watch for durability constraints with a custom timeout. This method works exactly likereplace(Document)
, but afterwards watches the server states if the given durability constraints are met. If this is the case, a new document is returned which contains the original properties, but has the refreshed CAS value set. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The original replace failed because the document does not exist:DocumentDoesNotExistException
- The request content is too big:RequestTooBigException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - A CAS value was set and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original replace has already happened, so the actual replace and the watching for durability constraints are two separate tasks internally.**
-
remove
<D extends Document<?>> D remove(D document)
Removes aDocument
from the Server with the default key/value timeout. TheDocument
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- A CAS value was set on theDocument
and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The document to remove does not exist:DocumentDoesNotExistException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
document
- the document to remove, with the ID extracted.- Returns:
- the document containing the ID.
-
remove
<D extends Document<?>> D remove(D document, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server with a custom timeout. TheDocument
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- A CAS value was set on theDocument
and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The document to remove does not exist:DocumentDoesNotExistException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
document
- the document to remove, with the ID extracted.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- the document containing the ID.
-
remove
<D extends Document<?>> D remove(D document, PersistTo persistTo, ReplicateTo replicateTo)
Removes aDocument
from the Server and apply a durability requirement with the default key/value timeout. TheDocument
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - A CAS value was set on theDocument
and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The document to remove does not exist:DocumentDoesNotExistException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
document
- the document to remove, with the ID extracted.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.- Returns:
- the document containing the ID.
-
remove
<D extends Document<?>> D remove(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server and apply a durability requirement with a custom timeout. TheDocument
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - A CAS value was set on theDocument
and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The document to remove does not exist:DocumentDoesNotExistException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
document
- the document to remove, with the ID extracted.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- the document containing the ID.
-
remove
<D extends Document<?>> D remove(D document, PersistTo persistTo)
Removes aDocument
from the Server and apply a durability requirement with the default key/value timeout. TheDocument
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - A CAS value was set on theDocument
and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The document to remove does not exist:DocumentDoesNotExistException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
document
- the document to remove, with the ID extracted.persistTo
- the persistence constraint to watch.- Returns:
- the document containing the ID.
-
remove
<D extends Document<?>> D remove(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server and apply a durability requirement with a custom timeout. TheDocument
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - A CAS value was set on theDocument
and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The document to remove does not exist:DocumentDoesNotExistException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
document
- the document to remove, with the ID extracted.persistTo
- the persistence constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- the document containing the ID.
-
remove
<D extends Document<?>> D remove(D document, ReplicateTo replicateTo)
Removes aDocument
from the Server and apply a durability requirement with the default key/value timeout. TheDocument
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - A CAS value was set on theDocument
and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The document to remove does not exist:DocumentDoesNotExistException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
document
- the document to remove, with the ID extracted.replicateTo
- the replication constraint to watch.- Returns:
- the document containing the ID.
-
remove
<D extends Document<?>> D remove(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server and apply a durability requirement with a custom timeout. TheDocument
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - A CAS value was set on theDocument
and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The document to remove does not exist:DocumentDoesNotExistException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
document
- the document to remove, with the ID extracted.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- the document containing the ID.
-
remove
JsonDocument remove(String id)
Removes aDocument
from the Server identified by its ID with the default key/value timeout. TheDocument
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The document to remove does not exist:DocumentDoesNotExistException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the id of the document to remove.- Returns:
- the document containing the ID.
-
remove
JsonDocument remove(String id, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server identified by its ID with a custom timeout. TheDocument
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The document to remove does not exist:DocumentDoesNotExistException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the id of the document to remove.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- the document containing the ID.
-
remove
JsonDocument remove(String id, PersistTo persistTo, ReplicateTo replicateTo)
Removes aDocument
from the Server by its ID and apply a durability requirement with the default key/value timeout. TheDocument
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The document to remove does not exist:DocumentDoesNotExistException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the id of the document to remove.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.- Returns:
- the document containing the ID.
-
remove
JsonDocument remove(String id, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server by its ID and apply a durability requirement with a custom timeout. TheDocument
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The document to remove does not exist:DocumentDoesNotExistException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the id of the document to remove.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- the document containing the ID.
-
remove
JsonDocument remove(String id, PersistTo persistTo)
Removes aDocument
from the Server by its ID and apply a durability requirement with the default key/value timeout. TheDocument
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The document to remove does not exist:DocumentDoesNotExistException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the id of the document to remove.persistTo
- the persistence constraint to watch.- Returns:
- the document containing the ID.
-
remove
JsonDocument remove(String id, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server by its ID and apply a durability requirement with a custom timeout. TheDocument
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The document to remove does not exist:DocumentDoesNotExistException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the id of the document to remove.persistTo
- the persistence constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- the document containing the ID.
-
remove
JsonDocument remove(String id, ReplicateTo replicateTo)
Removes aDocument
from the Server by its ID and apply a durability requirement with the default key/value timeout. TheDocument
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The document to remove does not exist:DocumentDoesNotExistException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the id of the document to remove.replicateTo
- the replication constraint to watch.- Returns:
- the document containing the ID.
-
remove
JsonDocument remove(String id, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server by its ID and apply a durability requirement with a custom timeout. TheDocument
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The document to remove does not exist:DocumentDoesNotExistException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the id of the document to remove.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- the document containing the ID.
-
remove
<D extends Document<?>> D remove(String id, Class<D> target)
Removes aDocument
from the Server identified by its ID with the default key/value timeout. TheDocument
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The document to remove does not exist:DocumentDoesNotExistException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the id of the document to remove.target
- the target document type to use.- Returns:
- the document containing the ID.
-
remove
<D extends Document<?>> D remove(String id, Class<D> target, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server identified by its ID with a custom timeout. TheDocument
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The document to remove does not exist:DocumentDoesNotExistException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the id of the document to remove.target
- the target document type to use.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- the document containing the ID.
-
remove
<D extends Document<?>> D remove(String id, PersistTo persistTo, ReplicateTo replicateTo, Class<D> target)
Removes aDocument
from the Server by its ID and apply a durability requirement with the default key/value timeout. TheDocument
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The document to remove does not exist:DocumentDoesNotExistException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the id of the document to remove.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.target
- the target document type to use.- Returns:
- the document containing the ID.
-
remove
<D extends Document<?>> D remove(String id, PersistTo persistTo, ReplicateTo replicateTo, Class<D> target, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server by its ID and apply a durability requirement with a custom timeout. TheDocument
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The document to remove does not exist:DocumentDoesNotExistException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the id of the document to remove.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.target
- the target document type to use.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- the document containing the ID.
-
remove
<D extends Document<?>> D remove(String id, PersistTo persistTo, Class<D> target)
Removes aDocument
from the Server by its ID and apply a durability requirement with the default key/value timeout. TheDocument
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The document to remove does not exist:DocumentDoesNotExistException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the id of the document to remove.persistTo
- the persistence constraint to watch.target
- the target document type to use.- Returns:
- the document containing the ID.
-
remove
<D extends Document<?>> D remove(String id, PersistTo persistTo, Class<D> target, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server by its ID and apply a durability requirement with a custom timeout. TheDocument
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The document to remove does not exist:DocumentDoesNotExistException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the id of the document to remove.persistTo
- the persistence constraint to watch.target
- the target document type to use.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- the document containing the ID.
-
remove
<D extends Document<?>> D remove(String id, ReplicateTo replicateTo, Class<D> target)
Removes aDocument
from the Server by its ID and apply a durability requirement with the default key/value timeout. TheDocument
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The document to remove does not exist:DocumentDoesNotExistException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the id of the document to remove.replicateTo
- the replication constraint to watch.target
- the target document type to use.- Returns:
- the document containing the ID.
-
remove
<D extends Document<?>> D remove(String id, ReplicateTo replicateTo, Class<D> target, long timeout, TimeUnit timeUnit)
Removes aDocument
from the Server by its ID and apply a durability requirement with a custom timeout. TheDocument
returned just has the document ID and its CAS value set, since the value and all other associated properties have been removed from the server. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The document to remove does not exist:DocumentDoesNotExistException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the id of the document to remove.replicateTo
- the replication constraint to watch.target
- the target document type to use.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- the document containing the ID.
-
query
ViewResult query(ViewQuery query)
Queries a Couchbase ServerView
with thedefault view timeout
. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the design document or view is not found:ViewDoesNotExistException
- Parameters:
query
- the query to perform.- Returns:
- a result containing all the found rows and additional information.
-
query
SpatialViewResult query(SpatialViewQuery query)
Queries a Couchbase Server SpatialView
with thedefault view timeout
. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the design document or view is not found:ViewDoesNotExistException
- Parameters:
query
- the query to perform.- Returns:
- a result containing all the found rows and additional information.
-
query
ViewResult query(ViewQuery query, long timeout, TimeUnit timeUnit)
Queries a Couchbase ServerView
with a custom timeout. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the design document or view is not found:ViewDoesNotExistException
- Parameters:
query
- the query to perform.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a result containing all the found rows and additional information.
-
query
SpatialViewResult query(SpatialViewQuery query, long timeout, TimeUnit timeUnit)
Queries a Couchbase Server SpatialView
with a custom timeout. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the design document or view is not found:ViewDoesNotExistException
- Parameters:
query
- the query to perform.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a result containing all the found rows and additional information.
-
query
N1qlQueryResult query(Statement statement)
Queries a N1QL secondary index with thedefault query timeout
. Said timeout includes the time it takes to retrieve all of the rows and errors from server. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- Parameters:
statement
- the statement in a DSL form (start with a static select() import)- Returns:
- a result containing all found rows and additional information.
-
query
N1qlQueryResult query(Statement statement, long timeout, TimeUnit timeUnit)
Queries a N1QL secondary index with a custom timeout. Said timeout includes the time it takes to retrieve all of the rows and errors from server. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- Parameters:
statement
- the statement in a DSL form (start with a static select() import)timeout
- the custom full timeout, including the time to retrieve all rows, errors, etc...timeUnit
- the unit for the timeout.- Returns:
- a result containing all found rows and additional information.
-
query
N1qlQueryResult query(N1qlQuery query)
Queries a N1QL secondary index with thedefault query timeout
. Said timeout includes the time it takes to retrieve all of the rows and errors from server. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- Parameters:
query
- the fullN1qlQuery
, including statement and any other additional parameter.- Returns:
- a result containing all found rows and additional information.
-
query
N1qlQueryResult query(N1qlQuery query, long timeout, TimeUnit timeUnit)
Queries a N1QL secondary index with a custom timeout. Said timeout includes the time it takes to retrieve all of the rows and errors from server. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- Parameters:
query
- the fullN1qlQuery
, including statement and any other additional parameter.timeout
- the custom full timeout, including the time to retrieve all rows, errors, etc...timeUnit
- the unit for the timeout.- Returns:
- a result containing all found rows and additional information.
-
query
@Committed SearchQueryResult query(SearchQuery query)
Queries a Full-Text Index This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- Parameters:
query
- the query builder.- Returns:
- a query result containing the matches and additional information.
-
query
@Committed SearchQueryResult query(SearchQuery query, long timeout, TimeUnit timeUnit)
Queries a Full-Text Index This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- Parameters:
query
- the query builder.timeout
- the custom full timeout, including the time to retrieve all rows, errors, etc...timeUnit
- the unit for the timeout.- Returns:
- a query result containing the matches and additional information.
-
query
@Committed AnalyticsQueryResult query(AnalyticsQuery query)
Queries Couchbase Analytics- Parameters:
query
- the query builder.- Returns:
- a query result containing the rows and additional information.
-
query
@Committed AnalyticsQueryResult query(AnalyticsQuery query, long timeout, TimeUnit timeUnit)
Queries Couchbase Analytics- Parameters:
query
- the query builder.timeout
- the custom full timeout, including the time to retrieve all rows, errors, etc...timeUnit
- the unit for the timeout.- Returns:
- a query result containing the rows and additional information.
-
unlock
Boolean unlock(String id, long cas)
Unlocks a write-lockedDocument
with the default key/value timeout. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The document does not exist:DocumentDoesNotExistException
- A transient error occurred, most probably the CAS value was not correct:TemporaryLockFailureException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the id of the document to unlock.cas
- the CAS value which is mandatory to unlock it.- Returns:
- a Boolean indicating if the unlock was successful or not.
-
unlock
Boolean unlock(String id, long cas, long timeout, TimeUnit timeUnit)
Unlocks a write-lockedDocument
with a custom timeout. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The document does not exist:DocumentDoesNotExistException
- A transient error occurred, most probably the CAS value was not correct:TemporaryLockFailureException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the id of the document to unlock.cas
- the CAS value which is mandatory to unlock it.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a Boolean indicating if the unlock was successful or not.
-
unlock
<D extends Document<?>> Boolean unlock(D document)
Unlocks a write-lockedDocument
with the default key/value timeout. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The document does not exist:DocumentDoesNotExistException
- A transient error occurred, most probably the CAS value was not correct:TemporaryLockFailureException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
document
- the document where ID and CAS are extracted from.- Returns:
- a Boolean indicating if the unlock was successful or not.
-
unlock
<D extends Document<?>> Boolean unlock(D document, long timeout, TimeUnit timeUnit)
Unlocks a write-lockedDocument
with a custom timeout. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The document does not exist:DocumentDoesNotExistException
- A transient error occurred, most probably the CAS value was not correct:TemporaryLockFailureException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
document
- the document where ID and CAS are extracted from.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a Boolean indicating if the unlock was successful or not.
-
touch
Boolean touch(String id, int expiry)
Renews the expiration time of aDocument
with the default key/value timeout. Compared togetAndTouch(Document)
, this method does not actually fetch the document from the server, but it just resets its expiration time to the given value. This method throws under the following conditions: - The document doesn't exist:DocumentDoesNotExistException
- The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the id of the document.expiry
- the new expiration time. 0 means no expiry.- Returns:
- a Boolean indicating if the touch had been successful or not.
-
touch
Boolean touch(String id, int expiry, long timeout, TimeUnit timeUnit)
Renews the expiration time of aDocument
with a custom timeout. Compared togetAndTouch(Document)
, this method does not actually fetch the document from the server, but it just resets its expiration time to the given value. This method throws under the following conditions: - The document doesn't exist:DocumentDoesNotExistException
- The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the id of the document.expiry
- the new expiration time. 0 means no expiry.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a Boolean indicating if the touch had been successful or not.
-
touch
<D extends Document<?>> Boolean touch(D document)
Renews the expiration time of aDocument
with the default key/value timeout. Compared togetAndTouch(Document)
, this method does not actually fetch the document from the server, but it just resets its expiration time to the given value. This method throws under the following conditions: - The document doesn't exist:DocumentDoesNotExistException
- The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
document
- the document to extract the ID and expiry from.- Returns:
- a Boolean indicating if the touch had been successful or not.
-
touch
<D extends Document<?>> Boolean touch(D document, long timeout, TimeUnit timeUnit)
Renews the expiration time of aDocument
with a custom timeout. Compared togetAndTouch(Document)
, this method does not actually fetch the document from the server, but it just resets its expiration time to the given value. This method throws under the following conditions: - The document doesn't exist:DocumentDoesNotExistException
- The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
document
- the document to extract the ID and expiry from.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a Boolean indicating if the touch had been successful or not.
-
counter
JsonLongDocument counter(String id, long delta)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet with the default kvTimeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or usinginsert(D)
to create aJsonLongDocument
. The value can also be modified by usingupsert(D)
withJsonLongDocument
. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- If the document does not exist:DocumentDoesNotExistException
. - Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the id of the document.delta
- the increment or decrement amount.- Returns:
- a
Document
containing the resulting value.
-
counter
JsonLongDocument counter(String id, long delta, PersistTo persistTo)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet with the default kvTimeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or usinginsert(D)
to create aJsonLongDocument
. The value can also be modified by usingupsert(D)
withJsonLongDocument
. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - If the document does not exist:DocumentDoesNotExistException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**- Parameters:
id
- the id of the document.delta
- the increment or decrement amount.persistTo
- the persistence constraint to watch.- Returns:
- a
Document
containing the resulting value.
-
counter
JsonLongDocument counter(String id, long delta, ReplicateTo replicateTo)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet with the default kvTimeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or usinginsert(D)
to create aJsonLongDocument
. The value can also be modified by usingupsert(D)
withJsonLongDocument
. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - If the document does not exist:DocumentDoesNotExistException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**- Parameters:
id
- the id of the document.delta
- the increment or decrement amount.replicateTo
- the replication constraint to watch.- Returns:
- a
Document
containing the resulting value.
-
counter
JsonLongDocument counter(String id, long delta, PersistTo persistTo, ReplicateTo replicateTo)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet with the default kvTimeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or usinginsert(D)
to create aJsonLongDocument
. The value can also be modified by usingupsert(D)
withJsonLongDocument
. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - If the document does not exist:DocumentDoesNotExistException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**- Parameters:
id
- the id of the document.delta
- the increment or decrement amount.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.- Returns:
- a
Document
containing the resulting value.
-
counter
JsonLongDocument counter(String id, long delta, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet with a custom timeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or usinginsert(D)
to create aJsonLongDocument
. The value can also be modified by usingupsert(D)
withJsonLongDocument
. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- If the document does not exist:DocumentDoesNotExistException
. - Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the id of the document.delta
- the increment or decrement amount.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a
Document
containing the resulting value.
-
counter
JsonLongDocument counter(String id, long delta, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet with a custom timeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or usinginsert(D)
to create aJsonLongDocument
. The value can also be modified by usingupsert(D)
withJsonLongDocument
. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - If the document does not exist:DocumentDoesNotExistException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**- Parameters:
id
- the id of the document.delta
- the increment or decrement amount.persistTo
- the persistence constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a
Document
containing the resulting value.
-
counter
JsonLongDocument counter(String id, long delta, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet with a custom timeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or usinginsert(D)
to create aJsonLongDocument
. The value can also be modified by usingupsert(D)
withJsonLongDocument
. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - If the document does not exist:DocumentDoesNotExistException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**- Parameters:
id
- the id of the document.delta
- the increment or decrement amount.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a
Document
containing the resulting value.
-
counter
JsonLongDocument counter(String id, long delta, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value or throw an exception if it does not exist yet with a custom timeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or usinginsert(D)
to create aJsonLongDocument
. The value can also be modified by usingupsert(D)
withJsonLongDocument
. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - If the document does not exist:DocumentDoesNotExistException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**- Parameters:
id
- the id of the document.delta
- the increment or decrement amount.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a
Document
containing the resulting value.
-
counter
JsonLongDocument counter(String id, long delta, long initial)
Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or usinginsert(D)
to create aJsonLongDocument
. The value can also be modified by usingupsert(D)
withJsonLongDocument
. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value.- Returns:
- a
Document
containing the resulting value.
-
counter
JsonLongDocument counter(String id, long delta, long initial, PersistTo persistTo)
Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or usinginsert(D)
to create aJsonLongDocument
. The value can also be modified by usingupsert(D)
withJsonLongDocument
. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**- Parameters:
id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value.persistTo
- the persistence constraint to watch.- Returns:
- a
Document
containing the resulting value.
-
counter
JsonLongDocument counter(String id, long delta, long initial, ReplicateTo replicateTo)
Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or usinginsert(D)
to create aJsonLongDocument
. The value can also be modified by usingupsert(D)
withJsonLongDocument
. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**- Parameters:
id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value.replicateTo
- the replication constraint to watch.- Returns:
- a
Document
containing the resulting value.
-
counter
JsonLongDocument counter(String id, long delta, long initial, PersistTo persistTo, ReplicateTo replicateTo)
Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or usinginsert(D)
to create aJsonLongDocument
. The value can also be modified by usingupsert(D)
withJsonLongDocument
. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**- Parameters:
id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.- Returns:
- a
Document
containing the resulting value.
-
counter
JsonLongDocument counter(String id, long delta, long initial, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist with a custom timeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or usinginsert(D)
to create aJsonLongDocument
. The value can also be modified by usingupsert(D)
withJsonLongDocument
. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a
Document
containing the resulting value.
-
counter
JsonLongDocument counter(String id, long delta, long initial, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist with a custom timeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or usinginsert(D)
to create aJsonLongDocument
. The value can also be modified by usingupsert(D)
withJsonLongDocument
. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**- Parameters:
id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value.persistTo
- the persistence constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a
Document
containing the resulting value.
-
counter
JsonLongDocument counter(String id, long delta, long initial, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist with a custom timeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or usinginsert(D)
to create aJsonLongDocument
. The value can also be modified by usingupsert(D)
withJsonLongDocument
. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**- Parameters:
id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a
Document
containing the resulting value.
-
counter
JsonLongDocument counter(String id, long delta, long initial, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist with a custom timeout. The initial value for the counter can be set by passing the initial value in {@link #counter)} or usinginsert(D)
to create aJsonLongDocument
. The value can also be modified by usingupsert(D)
withJsonLongDocument
. It is not allowed that the delta value will bring the actual value below zero. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**- Parameters:
id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a
Document
containing the resulting value.
-
counter
JsonLongDocument counter(String id, long delta, long initial, int expiry)
Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout. This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero. *Note*: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters! The initial value for the counter can be set by passing the initial value in {@link #counter)} or usinginsert(D)
to create aJsonLongDocument
. The value can also be modified by usingupsert(D)
withJsonLongDocument
. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value.expiry
- the new expiration time for the document, only used on creation.- Returns:
- a
Document
containing the resulting value.
-
counter
JsonLongDocument counter(String id, long delta, long initial, int expiry, PersistTo persistTo)
Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout. This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero. *Note*: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters! The initial value for the counter can be set by passing the initial value in {@link #counter)} or usinginsert(D)
to create aJsonLongDocument
. The value can also be modified by usingupsert(D)
withJsonLongDocument
. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**- Parameters:
id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value.expiry
- the new expiration time for the document, only used on creation.persistTo
- the persistence constraint to watch.- Returns:
- a
Document
containing the resulting value.
-
counter
JsonLongDocument counter(String id, long delta, long initial, int expiry, ReplicateTo replicateTo)
Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout. This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero. *Note*: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters! The initial value for the counter can be set by passing the initial value in {@link #counter)} or usinginsert(D)
to create aJsonLongDocument
. The value can also be modified by usingupsert(D)
withJsonLongDocument
. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**- Parameters:
id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value.expiry
- the new expiration time for the document, only used on creation.replicateTo
- the replication constraint to watch.- Returns:
- a
Document
containing the resulting value.
-
counter
JsonLongDocument counter(String id, long delta, long initial, int expiry, PersistTo persistTo, ReplicateTo replicateTo)
Increment or decrement a counter with the given value and a initial value if it does not exist with the default key/value timeout. This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero. *Note*: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters! The initial value for the counter can be set by passing the initial value in {@link #counter)} or usinginsert(D)
to create aJsonLongDocument
. The value can also be modified by usingupsert(D)
withJsonLongDocument
. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**- Parameters:
id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value.expiry
- the new expiration time for the document, only used on creation.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.- Returns:
- a
Document
containing the resulting value.
-
counter
JsonLongDocument counter(String id, long delta, long initial, int expiry, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist with a custom timeout. This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero. *Note*: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters! The initial value for the counter can be set by passing the initial value in {@link #counter)} or usinginsert(D)
to create aJsonLongDocument
. The value can also be modified by usingupsert(D)
withJsonLongDocument
. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value.expiry
- the new expiration time for the document, only used on creation.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a
Document
containing the resulting value.
-
counter
JsonLongDocument counter(String id, long delta, long initial, int expiry, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist with a custom timeout. This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero. *Note*: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters! The initial value for the counter can be set by passing the initial value in {@link #counter)} or usinginsert(D)
to create aJsonLongDocument
. The value can also be modified by usingupsert(D)
withJsonLongDocument
. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**- Parameters:
id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value.expiry
- the new expiration time for the document, only used on creation.persistTo
- the persistence constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a
Document
containing the resulting value.
-
counter
JsonLongDocument counter(String id, long delta, long initial, int expiry, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist with a custom timeout. This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero. *Note*: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters! The initial value for the counter can be set by passing the initial value in {@link #counter)} or usinginsert(D)
to create aJsonLongDocument
. The value can also be modified by usingupsert(D)
withJsonLongDocument
. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**- Parameters:
id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value.expiry
- the new expiration time for the document, only used on creation.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a
Document
containing the resulting value.
-
counter
JsonLongDocument counter(String id, long delta, long initial, int expiry, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Increment or decrement a counter with the given value and a initial value if it does not exist with a custom timeout. This method allows to set an expiration time for the document as well. It is not allowed that the delta value will bring the actual value below zero. *Note*: Right now it is only possible to set the TTL of the counter document when it is created, not when it is updated! If this behavior is needed, please refer to the subdocument API and use the JSON based counters! The initial value for the counter can be set by passing the initial value in {@link #counter)} or usinginsert(D)
to create aJsonLongDocument
. The value can also be modified by usingupsert(D)
withJsonLongDocument
. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original increment/decrement has already happened, so the actual increment/decrement and the watching for durability constraints are two separate tasks internally.**- Parameters:
id
- the id of the document.delta
- the increment or decrement amount.initial
- the initial value.expiry
- the new expiration time for the document, only used on creation.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a
Document
containing the resulting value.
-
append
<D extends Document<?>> D append(D document)
Append aDocument
s content to an existing one with the default key/value timeout. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the appended result, so at this point the client does not know how theDocument
now looks like. A separateget(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The request content is too big:RequestTooBigException
- If the document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
document
- the document, identified by its id, from which the content is appended to the existing one.- Returns:
- a document which mirrors the one supplied as an argument.
-
append
<D extends Document<?>> D append(D document, PersistTo persistTo)
Append aDocument
s content to an existing one with the default key/value timeout. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the appended result, so at this point the client does not know how theDocument
now looks like. A separateget(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The request content is too big:RequestTooBigException
- If the document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original append has already happened, so the actual append and the watching for durability constraints are two separate tasks internally.**- Parameters:
document
- the document, identified by its id, from which the content is appended to the existing one.persistTo
- the persistence constraint to watch.- Returns:
- a document which mirrors the one supplied as an argument.
-
append
<D extends Document<?>> D append(D document, ReplicateTo replicateTo)
Append aDocument
s content to an existing one with the default key/value timeout. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the appended result, so at this point the client does not know how theDocument
now looks like. A separateget(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The request content is too big:RequestTooBigException
- If the document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original append has already happened, so the actual append and the watching for durability constraints are two separate tasks internally.**- Parameters:
document
- the document, identified by its id, from which the content is appended to the existing one.replicateTo
- the replication constraint to watch.- Returns:
- a document which mirrors the one supplied as an argument.
-
append
<D extends Document<?>> D append(D document, PersistTo persistTo, ReplicateTo replicateTo)
Append aDocument
s content to an existing one with the default key/value timeout. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the appended result, so at this point the client does not know how theDocument
now looks like. A separateget(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The request content is too big:RequestTooBigException
- If the document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original append has already happened, so the actual append and the watching for durability constraints are two separate tasks internally.**- Parameters:
document
- the document, identified by its id, from which the content is appended to the existing one.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.- Returns:
- a document which mirrors the one supplied as an argument.
-
append
<D extends Document<?>> D append(D document, long timeout, TimeUnit timeUnit)
Append aDocument
s content to an existing one with a custom timeout. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the appended result, so at this point the client does not know how theDocument
now looks like. A separateget(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The request content is too big:RequestTooBigException
- If the document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
document
- the document, identified by its id, from which the content is appended to the existing one.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a document which mirrors the one supplied as an argument.
-
append
<D extends Document<?>> D append(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Append aDocument
s content to an existing one with a custom timeout. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the appended result, so at this point the client does not know how theDocument
now looks like. A separateget(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The request content is too big:RequestTooBigException
- If the document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original append has already happened, so the actual append and the watching for durability constraints are two separate tasks internally.**- Parameters:
document
- the document, identified by its id, from which the content is appended to the existing one.persistTo
- the persistence constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a document which mirrors the one supplied as an argument.
-
append
<D extends Document<?>> D append(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Append aDocument
s content to an existing one with a custom timeout. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the appended result, so at this point the client does not know how theDocument
now looks like. A separateget(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The request content is too big:RequestTooBigException
- If the document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original append has already happened, so the actual append and the watching for durability constraints are two separate tasks internally.**- Parameters:
document
- the document, identified by its id, from which the content is appended to the existing one.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a document which mirrors the one supplied as an argument.
-
append
<D extends Document<?>> D append(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Append aDocument
s content to an existing one with a custom timeout. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the appended result, so at this point the client does not know how theDocument
now looks like. A separateget(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The request content is too big:RequestTooBigException
- If the document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original append has already happened, so the actual append and the watching for durability constraints are two separate tasks internally.**- Parameters:
document
- the document, identified by its id, from which the content is appended to the existing one.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a document which mirrors the one supplied as an argument.
-
prepend
<D extends Document<?>> D prepend(D document)
Prepend aDocument
s content to an existing one with the default key/value timeout. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the prepended result, so at this point the client does not know how theDocument
now looks like. A separateget(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The request content is too big:RequestTooBigException
- If the document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
document
- the document, identified by its id, from which the content is prepended to the existing one.- Returns:
- a document which mirrors the one supplied as an argument.
-
prepend
<D extends Document<?>> D prepend(D document, PersistTo persistTo)
Prepend aDocument
s content to an existing one with the default key/value timeout. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the prepended result, so at this point the client does not know how theDocument
now looks like. A separateget(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The request content is too big:RequestTooBigException
- If the document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original prepend has already happened, so the actual prepend and the watching for durability constraints are two separate tasks internally.**- Parameters:
document
- the document, identified by its id, from which the content is prepended to the existing one.persistTo
- the persistence constraint to watch.- Returns:
- a document which mirrors the one supplied as an argument.
-
prepend
<D extends Document<?>> D prepend(D document, ReplicateTo replicateTo)
Prepend aDocument
s content to an existing one with the default key/value timeout. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the prepended result, so at this point the client does not know how theDocument
now looks like. A separateget(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The request content is too big:RequestTooBigException
- If the document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original prepend has already happened, so the actual prepend and the watching for durability constraints are two separate tasks internally.**- Parameters:
document
- the document, identified by its id, from which the content is prepended to the existing one.replicateTo
- the replication constraint to watch.- Returns:
- a document which mirrors the one supplied as an argument.
-
prepend
<D extends Document<?>> D prepend(D document, PersistTo persistTo, ReplicateTo replicateTo)
Prepend aDocument
s content to an existing one with the default key/value timeout. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the prepended result, so at this point the client does not know how theDocument
now looks like. A separateget(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The request content is too big:RequestTooBigException
- If the document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original prepend has already happened, so the actual prepend and the watching for durability constraints are two separate tasks internally.**- Parameters:
document
- the document, identified by its id, from which the content is prepended to the existing one.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.- Returns:
- a document which mirrors the one supplied as an argument.
-
prepend
<D extends Document<?>> D prepend(D document, long timeout, TimeUnit timeUnit)
Prepend aDocument
s content to an existing one with a custom timeout. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the prepended result, so at this point the client does not know how theDocument
now looks like. A separateget(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The request content is too big:RequestTooBigException
- If the document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
document
- the document, identified by its id, from which the content is prepended to the existing one.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a document which mirrors the one supplied as an argument.
-
prepend
<D extends Document<?>> D prepend(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)
Prepend aDocument
s content to an existing one with a custom timeout. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the prepended result, so at this point the client does not know how theDocument
now looks like. A separateget(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The request content is too big:RequestTooBigException
- If the document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original prepend has already happened, so the actual prepend and the watching for durability constraints are two separate tasks internally.**- Parameters:
document
- the document, identified by its id, from which the content is prepended to the existing one.persistTo
- the persistence constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a document which mirrors the one supplied as an argument.
-
prepend
<D extends Document<?>> D prepend(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Prepend aDocument
s content to an existing one with a custom timeout. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the prepended result, so at this point the client does not know how theDocument
now looks like. A separateget(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The request content is too big:RequestTooBigException
- If the document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original prepend has already happened, so the actual prepend and the watching for durability constraints are two separate tasks internally.**- Parameters:
document
- the document, identified by its id, from which the content is prepended to the existing one.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a document which mirrors the one supplied as an argument.
-
prepend
<D extends Document<?>> D prepend(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)
Prepend aDocument
s content to an existing one with a custom timeout. TheDocument
returned explicitly has theDocument.content()
set to null, because the server does not return the prepended result, so at this point the client does not know how theDocument
now looks like. A separateget(Document)
call needs to be issued in order to get the full current content. If theDocument
does not exist, it needs to be created upfront. Note thatJsonDocument
s in all forms are not supported, it is advised that the following ones are used: -LegacyDocument
-StringDocument
-BinaryDocument
Note that this method does not support expiration on theDocument
. If set, it will be ignored. This method throws under the following conditions: - The operation takes longer than the specified timeout:TimeoutException
wrapped in aRuntimeException
- The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The request content is too big:RequestTooBigException
- If the document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - Unexpected errors are caught and contained in a genericCouchbaseException
. ADurabilityException
typically happens if the given amount of replicas needed to fulfill the durability constraint cannot be met because either the bucket does not have enough replicas configured or they are not available in a failover event. As an example, if one replica is configured andReplicateTo.TWO
is used, the observable is errored with aDurabilityException
. The same can happen if one replica is configured, but one node has been failed over and not yet rebalanced (hence, on a subset of the partitions there is no replica available). **It is important to understand that the original prepend has already happened, so the actual prepend and the watching for durability constraints are two separate tasks internally.**- Parameters:
document
- the document, identified by its id, from which the content is prepended to the existing one.persistTo
- the persistence constraint to watch.replicateTo
- the replication constraint to watch.timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- a document which mirrors the one supplied as an argument.
-
lookupIn
@Committed @Public LookupInBuilder lookupIn(String docId)
Prepare a sub-document lookup through abuilder API
. You can use the builder to describe one or several lookup operations inside an existingJsonDocument
, then execute the lookup synchronously by calling theLookupInBuilder.execute()
method. Only the paths that you looked up inside the document will be transferred over the wire, limiting the network overhead for large documents.- Parameters:
docId
- the id of the JSON document to lookup in.- Returns:
- a builder to describe the lookup(s) to perform.
- See Also:
LookupInBuilder.execute()
-
mutateIn
@Committed @Public MutateInBuilder mutateIn(String docId)
Prepare a sub-document mutation through abuilder API
. You can use the builder to describe one or several mutation operations inside an existingJsonDocument
, then execute them synchronously by calling theMutateInBuilder.execute()
method. Only the values that you want mutated inside the document will be transferred over the wire, limiting the network overhead for large documents. A get followed by a replace of the whole document isn't needed anymore. Note that you can set the expiry, check the CAS and ask for durability constraints in the builder using methods prefixed by "with":withExpiry
,withCas
,withDurability
.- Parameters:
docId
- the id of the JSON document to mutate in.- Returns:
- a builder to describe the mutation(s) to perform.
- See Also:
MutateInBuilder.execute()
-
mapAdd
@Committed @Public <V> boolean mapAdd(String docId, String key, V value)
Add a key value pair into CouchbaseMap If the underlying document for the map does not exist, this operation will create a new document to back the data structure. This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the mapkey
- key to be storedvalue
- value to be stored- Returns:
- true if successful
-
mapAdd
@Committed @Public <V> boolean mapAdd(String docId, String key, V value, long timeout, TimeUnit timeUnit)
Add a key value pair into CouchbaseMap If the underlying document for the map does not exist, this operation will create a new document to back the data structure. This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the mapkey
- key to be storedvalue
- value to be storedtimeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- true if successful
-
mapAdd
@Committed @Public <V> boolean mapAdd(String docId, String key, V value, MutationOptionBuilder mutationOptionBuilder)
Add a key value pair into CouchbaseMap with additional mutation options provided byMutationOptionBuilder
If the underlying document for the map does not exist, this operation will create a new document to back the data structure. This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - A CAS value was set and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the mapkey
- key to be storedvalue
- value to be storedmutationOptionBuilder
- mutation optionsMutationOptionBuilder
- Returns:
- true if successful
-
mapAdd
@Committed @Public <V> boolean mapAdd(String docId, String key, V value, MutationOptionBuilder mutationOptionBuilder, long timeout, TimeUnit timeUnit)
Add a key value pair into CouchbaseMap with additional mutation options provided byMutationOptionBuilder
If the underlying document for the map does not exist, this operation will create a new document to back the data structure. This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - A CAS value was set and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the mapkey
- key to be storedvalue
- value to be storedmutationOptionBuilder
- mutation optionsMutationOptionBuilder
timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- true if successful
-
mapGet
@Committed @Public <V> V mapGet(String docId, String key, Class<V> valueType)
Get value of a key in the CouchbaseMap This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the key is not found in the mapPathNotFoundException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the mapkey
- key in the mapvalueType
- value type class- Returns:
- value if found
-
mapGet
@Committed @Public <V> V mapGet(String docId, String key, Class<V> valueType, long timeout, TimeUnit timeUnit)
Get value of a key in the CouchbaseMap This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the mapkey
- key in the mapvalueType
- value type classtimeout
- the custom timeouttimeUnit
- the unit for the timeout- Returns:
- value if found
-
mapRemove
@Committed @Public boolean mapRemove(String docId, String key)
Remove a key value pair from CouchbaseMap This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the mapkey
- key to be removed- Returns:
- true if successful, even if the key doesn't exist
-
mapRemove
@Committed @Public boolean mapRemove(String docId, String key, long timeout, TimeUnit timeUnit)
Remove a key value pair from CouchbaseMap This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the mapkey
- key to be removedtimeout
- the custom timeouttimeUnit
- the unit for the timeout- Returns:
- true if successful, even if the key doesn't exist
-
mapRemove
@Committed @Public boolean mapRemove(String docId, String key, MutationOptionBuilder mutationOptionBuilder)
Remove a key value pair from CouchbaseMap with additional mutation options provided byMutationOptionBuilder
. This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - A CAS value was set and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the mapkey
- key to be removed- Returns:
- true if successful, even if the key doesn't exist
-
mapRemove
@Committed @Public boolean mapRemove(String docId, String key, MutationOptionBuilder mutationOptionBuilder, long timeout, TimeUnit timeUnit)
Remove a key value pair from CouchbaseMap with additional mutation options provided byMutationOptionBuilder
. This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - A CAS value was set and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the mapkey
- key to be removedtimeout
- the custom timeouttimeUnit
- the unit for the timeout- Returns:
- true if successful, even if the key doesn't exist
-
mapSize
@Committed @Public int mapSize(String docId)
Returns the number key value pairs in CouchbaseMap This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the map- Returns:
- number of key value pairs
-
mapSize
@Committed @Public int mapSize(String docId, long timeout, TimeUnit timeUnit)
Returns the number key value pairs in CouchbaseMap This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the maptimeout
- the custom timeouttimeUnit
- the unit for the timeout- Returns:
- number of key value pairs
-
listGet
@Committed @Public <E> E listGet(String docId, int index, Class<E> elementType)
Get element at an index in the CouchbaseList This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the index is not found in the listPathNotFoundException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the listindex
- index in listelementType
- element type class- Returns:
- value if found
-
listGet
@Committed @Public <E> E listGet(String docId, int index, Class<E> elementType, long timeout, TimeUnit timeUnit)
Get element at an index in the CouchbaseList This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the listindex
- index in listelementType
- element type classtimeout
- the custom timeouttimeUnit
- the unit for the timeout- Returns:
- value if found
-
listAppend
@Committed @Public <E> boolean listAppend(String docId, E element)
Push an element to tail of CouchbaseList This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the listelement
- element to be pushed into the queue- Returns:
- true if successful
-
listAppend
@Committed @Public <E> boolean listAppend(String docId, E element, long timeout, TimeUnit timeUnit)
Push an element to tail of CouchbaseList This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the listelement
- element to be pushed into the queuetimeout
- the custom timeouttimeUnit
- the unit for the timeout- Returns:
- true if successful
-
listAppend
@Committed @Public <E> boolean listAppend(String docId, E element, MutationOptionBuilder mutationOptionBuilder)
Push an element to tail of CouchbaseList with additional mutation options provided byMutationOptionBuilder
. This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - If the underlying couchbase document does not exist:DocumentDoesNotExistException
- A CAS value was set and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the listelement
- element to be pushed into the queuemutationOptionBuilder
- mutation optionsMutationOptionBuilder
- Returns:
- true if successful
-
listAppend
@Committed @Public <E> boolean listAppend(String docId, E element, MutationOptionBuilder mutationOptionBuilder, long timeout, TimeUnit timeUnit)
Push an element to tail of CouchbaseList with additional mutation options provided byMutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - If the underlying couchbase document does not exist:DocumentDoesNotExistException
- A CAS value was set and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the listelement
- element to be pushed into the queuemutationOptionBuilder
- mutation optionsMutationOptionBuilder
timeout
- the custom timeouttimeUnit
- the unit for the timeout- Returns:
- true if successful
-
listRemove
@Committed @Public boolean listRemove(String docId, int index)
Remove an element from an index in CouchbaseList This method throws under the following conditions: -IndexOutOfBoundsException
if index is not found - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the listindex
- index of the element in list- Returns:
- true if successful
-
listRemove
@Committed @Public boolean listRemove(String docId, int index, long timeout, TimeUnit timeUnit)
Remove an element from an index in CouchbaseList This method throws under the following conditions: -IndexOutOfBoundsException
if index is not found - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the listindex
- index of the element in listtimeout
- the custom timeouttimeUnit
- the unit for the timeout- Returns:
- true if successful
-
listRemove
@Committed @Public boolean listRemove(String docId, int index, MutationOptionBuilder mutationOptionBuilder)
Remove an element from an index in CouchbaseList with additional mutation options provided byMutationOptionBuilder
This method throws under the following conditions: -IndexOutOfBoundsException
if index is not found - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - A CAS value was set and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the listindex
- index of the element in listmutationOptionBuilder
- mutation optionsMutationOptionBuilder
- Returns:
- true if successful
-
listRemove
@Committed @Public boolean listRemove(String docId, int index, MutationOptionBuilder mutationOptionBuilder, long timeout, TimeUnit timeUnit)
Remove an element from an index in CouchbaseList with additional mutation options provided byMutationOptionBuilder
This method throws under the following conditions: -IndexOutOfBoundsException
if index is not found - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - A CAS value was set and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the listindex
- index of the element in listmutationOptionBuilder
- mutation optionsMutationOptionBuilder
timeout
- the custom timeouttimeUnit
- the unit for the timeout- Returns:
- true if successful
-
listPrepend
@Committed @Public <E> boolean listPrepend(String docId, E element)
Shift list head to element in CouchbaseList This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - If the underlying couchbase document does not exist:DocumentDoesNotExistException
- A CAS value was set and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the listelement
- element to shift as head of list- Returns:
- true if successful
-
listPrepend
@Committed @Public <E> boolean listPrepend(String docId, E element, long timeout, TimeUnit timeUnit)
Shift list head to element in CouchbaseList This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - A CAS value was set and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the listelement
- element to shift as head of listtimeout
- the custom timeouttimeUnit
- the unit for the timeout- Returns:
- true if successful
-
listPrepend
@Committed @Public <E> boolean listPrepend(String docId, E element, MutationOptionBuilder mutationOptionBuilder)
Shift list head to element in CouchbaseList with additional mutation options provided byMutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - A CAS value was set and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the listelement
- element to shift as head of listmutationOptionBuilder
- mutation optionsMutationOptionBuilder
- Returns:
- true if successful
-
listPrepend
@Committed @Public <E> boolean listPrepend(String docId, E element, MutationOptionBuilder mutationOptionBuilder, long timeout, TimeUnit timeUnit)
Shift list head to element in CouchbaseList with additional mutation options provided byMutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - A CAS value was set and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the listelement
- element to shift as head of listmutationOptionBuilder
- mutation optionsMutationOptionBuilder
timeout
- the custom timeouttimeUnit
- the unit for the timeout- Returns:
- true if successful
-
listSet
@Committed @Public <E> boolean listSet(String docId, int index, E element)
Add an element at an index in CouchbaseList This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the listindex
- index in the listelement
- element to be added- Returns:
- true if successful
-
listSet
@Committed @Public <E> boolean listSet(String docId, int index, E element, long timeout, TimeUnit timeUnit)
Add an element at an index in CouchbaseList This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the listindex
- index in the listelement
- element to be addedtimeout
- the custom timeouttimeUnit
- the unit for the timeout- Returns:
- true if successful
-
listSet
@Committed @Public <E> boolean listSet(String docId, int index, E element, MutationOptionBuilder mutationOptionBuilder)
Add an element at an index in CouchbaseList with additional mutation options provided byMutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - A CAS value was set and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the listindex
- index in the listelement
- element to be addedmutationOptionBuilder
- mutation optionsMutationOptionBuilder
- Returns:
- true if successful
-
listSet
@Committed @Public <E> boolean listSet(String docId, int index, E element, MutationOptionBuilder mutationOptionBuilder, long timeout, TimeUnit timeUnit)
Add an element at an index in CouchbaseList with additional mutation options provided byMutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - A CAS value was set and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the listindex
- index in the listelement
- element to be addedmutationOptionBuilder
- mutation optionsMutationOptionBuilder
timeout
- the custom timeouttimeUnit
- the unit for the timeout- Returns:
- true if successful
-
listSize
@Committed @Public int listSize(String docId)
Returns the number of elements in CouchbaseList This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the list- Returns:
- number of elements
-
listSize
@Committed @Public int listSize(String docId, long timeout, TimeUnit timeUnit)
Returns the number of elements in CouchbaseList This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the listtimeout
- the custom timeouttimeUnit
- the unit for the timeout- Returns:
- number of elements
-
setAdd
@Committed @Public <E> boolean setAdd(String docId, E element)
Add an element into CouchbaseSet This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the setelement
- element to be pushed into the set- Returns:
- true if successful, false if the element exists in set
-
setAdd
@Committed @Public <E> boolean setAdd(String docId, E element, long timeout, TimeUnit timeUnit)
Add an element into CouchbaseSet This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the setelement
- element to be pushed into the settimeout
- the custom timeouttimeUnit
- the unit for the timeout- Returns:
- true if successful, false if the element exists in set
-
setAdd
@Committed @Public <E> boolean setAdd(String docId, E element, MutationOptionBuilder mutationOptionBuilder)
Add an element into CouchbaseSet with additional mutation options provided byMutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the setelement
- element to be pushed into the setmutationOptionBuilder
- mutation optionsMutationOptionBuilder
- Returns:
- true if successful, false if the element exists in set
-
setAdd
@Committed @Public <E> boolean setAdd(String docId, E element, MutationOptionBuilder mutationOptionBuilder, long timeout, TimeUnit timeUnit)
Add an element into CouchbaseSet with additional mutation options provided byMutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the setelement
- element to be pushed into the setmutationOptionBuilder
- mutation optionsMutationOptionBuilder
timeout
- the custom timeouttimeUnit
- the unit for the timeout- Returns:
- true if successful, false if the element exists in set
-
setContains
@Committed @Public <E> boolean setContains(String docId, E element)
Check if an element exists in CouchbaseSet This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the setelement
- element to check for existence- Returns:
- true if element exists, false if the element does not exist
-
setContains
@Committed @Public <E> boolean setContains(String docId, E element, long timeout, TimeUnit timeUnit)
Check if an element exists in CouchbaseSet This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the setelement
- element to check for existencetimeout
- the custom timeouttimeUnit
- the unit for the timeout- Returns:
- true if element exists, false if the element does not exist
-
setRemove
@Committed @Public <E> E setRemove(String docId, E element)
Removes an element from CouchbaseSet This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the setelement
- element to be removed- Returns:
- element removed from set (fails silently by returning the element is not found in set)
-
setRemove
@Committed @Public <E> E setRemove(String docId, E element, long timeout, TimeUnit timeUnit)
Removes an element from CouchbaseSet This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the setelement
- element to be removedtimeout
- the custom timeouttimeUnit
- the unit for the timeout- Returns:
- element removed from set (fails silently by returning the element is not found in set)
-
setRemove
@Committed @Public <E> E setRemove(String docId, E element, MutationOptionBuilder mutationOptionBuilder)
Removes an element from CouchbaseSet with additional mutation options provided byMutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - A CAS value was set and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the setelement
- element to be removedmutationOptionBuilder
- mutation optionsMutationOptionBuilder
- Returns:
- element removed from set (fails silently by returning the element is not found in set)
-
setRemove
@Committed @Public <E> E setRemove(String docId, E element, MutationOptionBuilder mutationOptionBuilder, long timeout, TimeUnit timeUnit)
Removes an element from CouchbaseSet with additional mutation options provided byMutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - A CAS value was set and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the setelement
- element to be removedmutationOptionBuilder
- mutation optionsMutationOptionBuilder
timeout
- the custom timeouttimeUnit
- the unit for the timeout- Returns:
- element removed from set (fails silently by returning the element is not found in set)
-
setSize
@Committed @Public int setSize(String docId)
Returns the number of elements in CouchbaseSet This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the set- Returns:
- number of elements in set
-
setSize
@Committed @Public int setSize(String docId, long timeout, TimeUnit timeUnit)
Returns the number of elements in CouchbaseSet This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the settimeout
- the custom timeouttimeUnit
- the unit for the timeout- Returns:
- number of elements in set
-
queuePush
@Committed @Public <E> boolean queuePush(String docId, E element)
Add an element into CouchbaseQueue This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the queueelement
- element to be pushed into the queue- Returns:
- true if successful
-
queuePush
@Committed @Public <E> boolean queuePush(String docId, E element, long timeout, TimeUnit timeUnit)
Add an element into CouchbaseQueue This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the queueelement
- element to be pushed into the queuetimeout
- the custom timeouttimeUnit
- the unit for the timeout- Returns:
- true if successful
-
queuePush
@Committed @Public <E> boolean queuePush(String docId, E element, MutationOptionBuilder mutationOptionBuilder)
Add an element into CouchbaseQueue with additional mutation options provided byMutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - A CAS value was set and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the queueelement
- element to be pushed into the queuemutationOptionBuilder
- mutation optionsMutationOptionBuilder
- Returns:
- true if successful
-
queuePush
@Committed @Public <E> boolean queuePush(String docId, E element, MutationOptionBuilder mutationOptionBuilder, long timeout, TimeUnit timeUnit)
Add an element into CouchbaseQueue with additional mutation options provided byMutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - A CAS value was set and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the queueelement
- element to be pushed into the queuemutationOptionBuilder
- mutation optionsMutationOptionBuilder
timeout
- the custom timeouttimeUnit
- the unit for the timeout- Returns:
- true if successful
-
queuePop
@Committed @Public <E> E queuePop(String docId, Class<E> elementType)
Removes the first element from CouchbaseQueue This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the queueelementType
- element type class- Returns:
- element removed from queue
-
queuePop
@Committed @Public <E> E queuePop(String docId, Class<E> elementType, long timeout, TimeUnit timeUnit)
Removes the first element from CouchbaseQueue This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the queueelementType
- element type classtimeout
- the custom timeouttimeUnit
- the unit for the timeout- Returns:
- element removed from queue
-
queuePop
@Committed @Public <E> E queuePop(String docId, Class<E> elementType, MutationOptionBuilder mutationOptionBuilder)
Removes the first element from CouchbaseQueue with additional mutation options provided byMutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - A CAS value was set and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the queueelementType
- element type class- Returns:
- element removed from queue
-
queuePop
@Committed @Public <E> E queuePop(String docId, Class<E> elementType, MutationOptionBuilder mutationOptionBuilder, long timeout, TimeUnit timeUnit)
Removes the first element from CouchbaseQueue with additional mutation options provided byMutationOptionBuilder
This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The durability constraint could not be fulfilled because of a temporary or persistent problem:DurabilityException
. - A CAS value was set and it did not match with the server:CASMismatchException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the queueelementType
- element type classtimeout
- the custom timeouttimeUnit
- the unit for the timeout- Returns:
- element removed from queue
-
queueSize
@Committed @Public int queueSize(String docId)
Returns the number of elements in CouchbaseQueue This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the queue- Returns:
- number of elements
-
queueSize
@Committed @Public int queueSize(String docId, long timeout, TimeUnit timeUnit)
Returns the number of elements in CouchbaseQueue This method throws under the following conditions: - The producer outpaces the SDK:BackpressureException
- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of retrying:RequestCancelledException
- If the underlying couchbase document does not exist:DocumentDoesNotExistException
- The server is currently not able to process the request, retrying may help:TemporaryFailureException
- The server is out of memory:CouchbaseOutOfMemoryException
- Unexpected errors are caught and contained in a genericCouchbaseException
.- Parameters:
docId
- document id backing the queuetimeout
- the custom timeouttimeUnit
- the unit for the timeout- Returns:
- number of elements
-
invalidateQueryCache
int invalidateQueryCache()
Invalidates and clears the internal query cache. This method can be used to explicitly clear the internal N1QL query cache. This cache will be filled with non-adhoc query statements (query plans) to speed up those subsequent executions. Triggering this method will wipe out the complete cache, which will not cause an interruption but rather all queries need to be re-prepared internally. This method is likely to be deprecated in the future once the server side query engine distributes its state throughout the cluster. This method will not throw under any conditions.- Returns:
- the number of entries in the cache before it was cleared out.
-
bucketManager
BucketManager bucketManager()
Provides access to theBucketManager
for administrative access. The manager lets you perform operations such as flushing a bucket or creating and managing design documents.- Returns:
- the bucket manager for administrative operations.
-
repository
@Public @Experimental Repository repository()
TheRepository
provides access to full object document mapping (ODM) capabilities. It allows you to work with POJO entities only and use annotations to customize the behaviour and mapping characteristics.- Returns:
- the repository for ODM capabilities.
-
close
Boolean close()
Closes this bucket with the default disconnect timeout.- Returns:
- true if the bucket was successfully closed.
-
close
Boolean close(long timeout, TimeUnit timeUnit)
Closes this bucket with a custom timeout.- Parameters:
timeout
- the custom timeout.timeUnit
- the unit for the timeout.- Returns:
- true if the bucket was successfully closed.
-
isClosed
boolean isClosed()
Returns true if this bucket is already closed, false if it is still open.- Returns:
- true if closed, false otherwise.
-
ping
PingReport ping(String reportId)
Performs a diagnostic active "ping" call with a custom report ID on all services. Since no timeout is provided, the management timeout from the environment will be used.- Parameters:
reportId
- the report ID to use in the report.- Returns:
- a ping report once created.
-
ping
PingReport ping(String reportId, long timeout, TimeUnit timeUnit)
Performs a diagnostic active "ping" call with a custom report ID on all services. Note that since each service has different timeouts, you need to provide a timeout that suits your needs (how long each individual service ping should take max before it times out).- Parameters:
reportId
- the report ID to use in the report.timeout
- the timeout for each individual service.timeUnit
- the unit for the timeout.- Returns:
- a ping report once created.
-
ping
PingReport ping()
Performs a diagnostic active "ping" call with a random report id on all services. Since no timeout is provided, the management timeout from the environment will be used.- Returns:
- a ping report once created.
-
ping
PingReport ping(long timeout, TimeUnit timeUnit)
Performs a diagnostic active "ping" call on all services with a random report id. Note that since each service has different timeouts, you need to provide a timeout that suits your needs (how long each individual service ping should take max before it times out).- Parameters:
timeout
- the timeout for each individual service.timeUnit
- the unit for the timeout.- Returns:
- a ping report once created.
-
ping
PingReport ping(Collection<ServiceType> services)
Performs a diagnostic active "ping" call with a random report id on all services. Since no timeout is provided, the management timeout from the environment will be used.- Parameters:
services
- collection of services which should be included.- Returns:
- a ping report once created.
-
ping
PingReport ping(Collection<ServiceType> services, long timeout, TimeUnit timeUnit)
Performs a diagnostic active "ping" call on a list of services with a random report id. Note that since each service has different timeouts, you need to provide a timeout that suits your needs (how long each individual service ping should take max before it times out).- Parameters:
services
- collection of services which should be included.timeout
- the timeout for each individual service.timeUnit
- the unit for the timeout.- Returns:
- a ping report once created.
-
ping
PingReport ping(String reportId, Collection<ServiceType> services)
Performs a diagnostic active "ping" call with a custom report id on all services. Since no timeout is provided, the management timeout from the environment will be used.- Parameters:
services
- collection of services which should be included.- Returns:
- a ping report once created.
-
ping
PingReport ping(String reportId, Collection<ServiceType> services, long timeout, TimeUnit timeUnit)
Performs a diagnostic active "ping" call against all the services provided with a custom report id. Note that since each service has different timeouts, you need to provide a timeout that suits your needs (how long each individual service ping should take max before it times out).- Parameters:
reportId
- the report ID to use in the report.services
- collection of services which should be included.timeout
- the timeout for each individual service.timeUnit
- the unit for the timeout.- Returns:
- a ping report once created.
-
exportAnalyticsDeferredResultHandle
@Experimental byte[] exportAnalyticsDeferredResultHandle(AnalyticsDeferredResultHandle handle)
Exports the deferred result handle to a serialized form which can be used across SDKs- Parameters:
handle
- the deferred result handle- Returns:
- the serialized bytes
-
importAnalyticsDeferredResultHandle
@Experimental AnalyticsDeferredResultHandle importAnalyticsDeferredResultHandle(byte[] b)
Imports from json to create aAnalyticsDeferredResultHandle
.- Parameters:
b
- the bytes to be converted to handle- Returns:
- the deferred handle instance
-
-