Package com.couchbase.client.java
Class CouchbaseBucket
java.lang.Object
com.couchbase.client.java.CouchbaseBucket
- All Implemented Interfaces:
Bucket
public class CouchbaseBucket extends Object implements Bucket
-
Constructor Summary
Constructors Constructor Description CouchbaseBucket(AsyncBucket asyncBucket, CouchbaseEnvironment env, ClusterFacade core, String name, String username, String password)
Create aCouchbaseBucket
that relies on the providedAsyncBucket
.CouchbaseBucket(CouchbaseEnvironment env, ClusterFacade core, String name, String username, String password, List<Transcoder<? extends Document,?>> customTranscoders)
Create aCouchbaseBucket
that doesn't reuse an existingAsyncBucket
but rather creates one internally. -
Method Summary
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
.String
toString()
<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.
-
Constructor Details
-
CouchbaseBucket
public CouchbaseBucket(CouchbaseEnvironment env, ClusterFacade core, String name, String username, String password, List<Transcoder<? extends Document,?>> customTranscoders)Create aCouchbaseBucket
that doesn't reuse an existingAsyncBucket
but rather creates one internally. Prefer using the alternative constructorCouchbaseBucket(AsyncBucket, CouchbaseEnvironment, ClusterFacade, String, String, String)
if you can obtain an AsyncBucket externally. -
CouchbaseBucket
public CouchbaseBucket(AsyncBucket asyncBucket, CouchbaseEnvironment env, ClusterFacade core, String name, String username, String password)Create aCouchbaseBucket
that relies on the providedAsyncBucket
.
-
-
Method Details
-
async
Description copied from interface:Bucket
Provides access to the underlying asynchronous bucket interface. -
name
Description copied from interface:Bucket
The name of theBucket
. -
core
Description copied from interface:Bucket
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.- Specified by:
core
in interfaceBucket
- Returns:
- the underlying
ClusterFacade
from the "core-io" package.
-
environment
Description copied from interface:Bucket
TheCouchbaseEnvironment
used.- Specified by:
environment
in interfaceBucket
- Returns:
- the CouchbaseEnvironment.
-
repository
Description copied from interface:Bucket
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.- Specified by:
repository
in interfaceBucket
- Returns:
- the repository for ODM capabilities.
-
get
Description copied from interface:Bucket
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
.- Specified by:
get
in interfaceBucket
- Parameters:
id
- the unique ID of the document.- Returns:
- the found
JsonDocument
or null if not found.
-
get
Description copied from interface:Bucket
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
.- Specified by:
get
in interfaceBucket
- 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
Description copied from interface:Bucket
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
. -
get
Description copied from interface:Bucket
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
. -
get
Description copied from interface:Bucket
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
. -
get
Description copied from interface:Bucket
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
. -
exists
Description copied from interface:Bucket
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
. -
exists
Description copied from interface:Bucket
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
. -
exists
Description copied from interface:Bucket
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
. -
exists
Description copied from interface:Bucket
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
. -
getFromReplica
Description copied from interface:Bucket
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
- Specified by:
getFromReplica
in interfaceBucket
- Parameters:
id
- id the unique ID of the document.type
- theReplicaMode
to select.- Returns:
- a List containing zero to N
JsonDocument
s.
-
getFromReplica
public List<JsonDocument> getFromReplica(String id, ReplicaMode type, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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
- Specified by:
getFromReplica
in interfaceBucket
- 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
Description copied from interface:Bucket
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
- Specified by:
getFromReplica
in interfaceBucket
- Parameters:
document
- the document to extract the ID from.type
- theReplicaMode
to select.- Returns:
- a List containing zero to N
JsonDocument
s.
-
getFromReplica
public <D extends Document<?>> List<D> getFromReplica(D document, ReplicaMode type, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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
- Specified by:
getFromReplica
in interfaceBucket
- 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
public <D extends Document<?>> List<D> getFromReplica(String id, ReplicaMode type, Class<D> target)Description copied from interface:Bucket
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
- Specified by:
getFromReplica
in interfaceBucket
- Parameters:
id
- the id of the document.type
- theReplicaMode
to select.- Returns:
- a List containing zero to N
JsonDocument
s.
-
getFromReplica
public <D extends Document<?>> List<D> getFromReplica(String id, ReplicaMode type, Class<D> target, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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
- Specified by:
getFromReplica
in interfaceBucket
- 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
Description copied from interface:Bucket
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
- Specified by:
getFromReplica
in interfaceBucket
- Parameters:
id
- the unique ID of the document.- Returns:
- the Iterator containing Documents as they arrive.
-
getFromReplica
Description copied from interface:Bucket
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
- Specified by:
getFromReplica
in interfaceBucket
- Parameters:
document
- the document to extract the ID from.- Returns:
- the Iterator containing Documents as they arrive.
-
getFromReplica
Description copied from interface:Bucket
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
- Specified by:
getFromReplica
in interfaceBucket
- Parameters:
id
- the unique ID of the document.target
- the target document type to use.- Returns:
- the Iterator containing Documents as they arrive.
-
getFromReplica
public <D extends Document<?>> Iterator<D> getFromReplica(String id, Class<D> target, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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
- Specified by:
getFromReplica
in interfaceBucket
- 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.
-
getFromReplica
public <D extends Document<?>> Iterator<D> getFromReplica(D document, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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
- Specified by:
getFromReplica
in interfaceBucket
- 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
Description copied from interface:Bucket
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
- Specified by:
getFromReplica
in interfaceBucket
- 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.
-
getAndLock
Description copied from interface:Bucket
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 toBucket.get(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
.- Specified by:
getAndLock
in interfaceBucket
- 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
Description copied from interface:Bucket
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 toBucket.get(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
.- Specified by:
getAndLock
in interfaceBucket
- 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
Description copied from interface:Bucket
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 toBucket.get(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
.- Specified by:
getAndLock
in interfaceBucket
- 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
public <D extends Document<?>> D getAndLock(D document, int lockTime, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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 toBucket.get(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
.- Specified by:
getAndLock
in interfaceBucket
- 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
Description copied from interface:Bucket
Retrieve and lock aDocument
by its unique ID with the default key/value timeout. This method differs fromBucket.getAndLock(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 toBucket.get(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
.- Specified by:
getAndLock
in interfaceBucket
- 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
public <D extends Document<?>> D getAndLock(String id, int lockTime, Class<D> target, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
Retrieve and lock aDocument
by its unique ID with the a custom timeout. This method differs fromBucket.getAndLock(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 toBucket.get(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
.- Specified by:
getAndLock
in interfaceBucket
- 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
Description copied from interface:Bucket
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 toBucket.get(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
.- Specified by:
getAndTouch
in interfaceBucket
- Parameters:
id
- id the unique ID of the document.expiry
- the new expiration time for the document.- Returns:
- the found
JsonDocument
or null.
-
getAndTouch
Description copied from interface:Bucket
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 toBucket.get(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
.- Specified by:
getAndTouch
in interfaceBucket
- 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
Description copied from interface:Bucket
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 toBucket.get(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
.- Specified by:
getAndTouch
in interfaceBucket
- 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
Description copied from interface:Bucket
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 toBucket.get(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
.- Specified by:
getAndTouch
in interfaceBucket
- 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
Description copied from interface:Bucket
Retrieve and touch aDocument
by its unique ID with the default key/value timeout. This method differs fromBucket.getAndTouch(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 toBucket.get(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
.- Specified by:
getAndTouch
in interfaceBucket
- 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
public <D extends Document<?>> D getAndTouch(String id, int expiry, Class<D> target, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
Retrieve and touch aDocument
by its unique ID with a custom timeout. This method differs fromBucket.getAndTouch(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 toBucket.get(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
.- Specified by:
getAndTouch
in interfaceBucket
- 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
Description copied from interface:Bucket
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
,Bucket.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,Bucket.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
Description copied from interface:Bucket
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
,Bucket.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,Bucket.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
Description copied from interface:Bucket
Insert aDocument
if it does not exist already and watch for durability constraints with the default key/value timeout. This method works exactly likeBucket.insert(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
public <D extends Document<?>> D insert(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
Insert aDocument
if it does not exist already and watch for durability constraints with a custom timeout. This method works exactly likeBucket.insert(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
Description copied from interface:Bucket
Insert aDocument
if it does not exist already and watch for durability constraints with the default key/value timeout. This method works exactly likeBucket.insert(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
public <D extends Document<?>> D insert(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
Insert aDocument
if it does not exist already and watch for durability constraints with a custom timeout. This method works exactly likeBucket.insert(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
Description copied from interface:Bucket
Insert aDocument
if it does not exist already and watch for durability constraints with the default key/value timeout. This method works exactly likeBucket.insert(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
public <D extends Document<?>> D insert(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
Insert aDocument
if it does not exist already and watch for durability constraints with a custom timeout. This method works exactly likeBucket.insert(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
Description copied from interface:Bucket
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, theBucket.replace(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,Bucket.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
Description copied from interface:Bucket
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, theBucket.replace(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,Bucket.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
Description copied from interface:Bucket
Insert or overwrite aDocument
and watch for durability constraints with the default key/value timeout. This method works exactly likeBucket.upsert(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, theBucket.replace(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
public <D extends Document<?>> D upsert(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
Insert or overwrite aDocument
and watch for durability constraints with a custom timeout. This method works exactly likeBucket.upsert(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, theBucket.replace(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
Description copied from interface:Bucket
Insert or overwrite aDocument
and watch for durability constraints with the default key/value timeout. This method works exactly likeBucket.upsert(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, theBucket.replace(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
public <D extends Document<?>> D upsert(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
Insert or overwrite aDocument
and watch for durability constraints with a custom timeout. This method works exactly likeBucket.upsert(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, theBucket.replace(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
Description copied from interface:Bucket
Insert or overwrite aDocument
and watch for durability constraints with the default key/value timeout. This method works exactly likeBucket.upsert(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, theBucket.replace(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
public <D extends Document<?>> D upsert(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
Insert or overwrite aDocument
and watch for durability constraints with a custom timeout. This method works exactly likeBucket.upsert(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, theBucket.replace(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
Description copied from interface:Bucket
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
,Bucket.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,Bucket.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
Description copied from interface:Bucket
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
,Bucket.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,Bucket.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
Description copied from interface:Bucket
Replace aDocument
if it does exist and watch for durability constraints with the default key/value timeout. This method works exactly likeBucket.replace(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
public <D extends Document<?>> D replace(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
Replace aDocument
if it does exist and watch for durability constraints with a custom timeout. This method works exactly likeBucket.replace(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
Description copied from interface:Bucket
Replace aDocument
if it does exist and watch for durability constraints with the default key/value timeout. This method works exactly likeBucket.replace(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
public <D extends Document<?>> D replace(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
Replace aDocument
if it does exist and watch for durability constraints with a custom timeout. This method works exactly likeBucket.replace(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
Description copied from interface:Bucket
Replace aDocument
if it does exist and watch for durability constraints with the default key/value timeout. This method works exactly likeBucket.replace(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
public <D extends Document<?>> D replace(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
Replace aDocument
if it does exist and watch for durability constraints with a custom timeout. This method works exactly likeBucket.replace(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
Description copied from interface:Bucket
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
. -
remove
Description copied from interface:Bucket
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
. -
remove
Description copied from interface:Bucket
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
. -
remove
Description copied from interface:Bucket
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
. -
remove
Description copied from interface:Bucket
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
. -
remove
public <D extends Document<?>> D remove(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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
.- Specified by:
remove
in interfaceBucket
- 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
public <D extends Document<?>> D remove(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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
. -
remove
public <D extends Document<?>> D remove(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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
. -
remove
Description copied from interface:Bucket
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
. -
remove
Description copied from interface:Bucket
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
. -
remove
Description copied from interface:Bucket
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
. -
remove
Description copied from interface:Bucket
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
. -
remove
Description copied from interface:Bucket
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
. -
remove
public JsonDocument remove(String id, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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
. -
remove
Description copied from interface:Bucket
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
. -
remove
Description copied from interface:Bucket
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
. -
remove
Description copied from interface:Bucket
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
. -
remove
public <D extends Document<?>> D remove(String id, PersistTo persistTo, ReplicateTo replicateTo, Class<D> target)Description copied from interface:Bucket
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
. -
remove
Description copied from interface:Bucket
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
. -
remove
Description copied from interface:Bucket
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
. -
remove
public <D extends Document<?>> D remove(String id, Class<D> target, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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
. -
remove
public <D extends Document<?>> D remove(String id, PersistTo persistTo, ReplicateTo replicateTo, Class<D> target, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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
.- Specified by:
remove
in interfaceBucket
- 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
public <D extends Document<?>> D remove(String id, PersistTo persistTo, Class<D> target, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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
. -
remove
public <D extends Document<?>> D remove(String id, ReplicateTo replicateTo, Class<D> target, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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
. -
query
Description copied from interface:Bucket
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
-
query
Description copied from interface:Bucket
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
-
query
Description copied from interface:Bucket
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
-
query
Description copied from interface:Bucket
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
-
query
Description copied from interface:Bucket
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
-
query
Description copied from interface:Bucket
Queries Couchbase Analytics -
query
Description copied from interface:Bucket
Queries Couchbase Analytics -
query
Description copied from interface:Bucket
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
-
query
Description copied from interface:Bucket
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
-
query
Description copied from interface:Bucket
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
-
query
Description copied from interface:Bucket
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
- Specified by:
query
in interfaceBucket
- 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
Description copied from interface:Bucket
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
- Specified by:
query
in interfaceBucket
- 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.
-
unlock
Description copied from interface:Bucket
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
. -
unlock
Description copied from interface:Bucket
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
. -
unlock
Description copied from interface:Bucket
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
. -
unlock
Description copied from interface:Bucket
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
. -
touch
Description copied from interface:Bucket
Renews the expiration time of aDocument
with the default key/value timeout. Compared toBucket.getAndTouch(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
. -
touch
Description copied from interface:Bucket
Renews the expiration time of aDocument
with the default key/value timeout. Compared toBucket.getAndTouch(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
. -
touch
Description copied from interface:Bucket
Renews the expiration time of aDocument
with a custom timeout. Compared toBucket.getAndTouch(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
. -
touch
Description copied from interface:Bucket
Renews the expiration time of aDocument
with a custom timeout. Compared toBucket.getAndTouch(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
. -
counter
Description copied from interface:Bucket
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 usingBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingBucket.upsert(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
. -
counter
Description copied from interface:Bucket
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 usingBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingBucket.upsert(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
. -
counter
Description copied from interface:Bucket
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 usingBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingBucket.upsert(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
. -
counter
Description copied from interface:Bucket
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 usingBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingBucket.upsert(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
. -
counter
public JsonLongDocument counter(String id, long delta, long initial, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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 usingBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingBucket.upsert(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
. -
counter
public JsonLongDocument counter(String id, long delta, long initial, int expiry, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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 usingBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingBucket.upsert(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
.- Specified by:
counter
in interfaceBucket
- 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.
-
bucketManager
Description copied from interface:Bucket
Provides access to theBucketManager
for administrative access. The manager lets you perform operations such as flushing a bucket or creating and managing design documents.- Specified by:
bucketManager
in interfaceBucket
- Returns:
- the bucket manager for administrative operations.
-
append
Description copied from interface:Bucket
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 separateBucket.get(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
. -
prepend
Description copied from interface:Bucket
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 separateBucket.get(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
. -
append
Description copied from interface:Bucket
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 separateBucket.get(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
. -
prepend
Description copied from interface:Bucket
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 separateBucket.get(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
. -
counter
Description copied from interface:Bucket
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 usingBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingBucket.upsert(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.** -
counter
Description copied from interface:Bucket
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 usingBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingBucket.upsert(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.** -
counter
public JsonLongDocument counter(String id, long delta, PersistTo persistTo, ReplicateTo replicateTo)Description copied from interface:Bucket
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 usingBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingBucket.upsert(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.** -
counter
public JsonLongDocument counter(String id, long delta, PersistTo persistTo, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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 usingBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingBucket.upsert(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.** -
counter
public JsonLongDocument counter(String id, long delta, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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 usingBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingBucket.upsert(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.** -
counter
Description copied from interface:Bucket
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 usingBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingBucket.upsert(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.** -
counter
Description copied from interface:Bucket
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 usingBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingBucket.upsert(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.** -
counter
public JsonLongDocument counter(String id, long delta, long initial, PersistTo persistTo, ReplicateTo replicateTo)Description copied from interface:Bucket
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 usingBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingBucket.upsert(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.**- Specified by:
counter
in interfaceBucket
- 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
public JsonLongDocument counter(String id, long delta, long initial, PersistTo persistTo, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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 usingBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingBucket.upsert(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.**- Specified by:
counter
in interfaceBucket
- 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
public JsonLongDocument counter(String id, long delta, long initial, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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 usingBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingBucket.upsert(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.**- Specified by:
counter
in interfaceBucket
- 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
public JsonLongDocument counter(String id, long delta, long initial, int expiry, PersistTo persistTo)Description copied from interface:Bucket
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 usingBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingBucket.upsert(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.**- Specified by:
counter
in interfaceBucket
- 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
public JsonLongDocument counter(String id, long delta, long initial, int expiry, ReplicateTo replicateTo)Description copied from interface:Bucket
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 usingBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingBucket.upsert(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.**- Specified by:
counter
in interfaceBucket
- 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
public JsonLongDocument counter(String id, long delta, long initial, int expiry, PersistTo persistTo, ReplicateTo replicateTo)Description copied from interface:Bucket
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 usingBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingBucket.upsert(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.**- Specified by:
counter
in interfaceBucket
- 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
public JsonLongDocument counter(String id, long delta, long initial, int expiry, PersistTo persistTo, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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 usingBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingBucket.upsert(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.**- Specified by:
counter
in interfaceBucket
- 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
public JsonLongDocument counter(String id, long delta, long initial, int expiry, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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 usingBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingBucket.upsert(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.**- Specified by:
counter
in interfaceBucket
- 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
public JsonLongDocument counter(String id, long delta, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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 usingBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingBucket.upsert(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.**- Specified by:
counter
in interfaceBucket
- 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
public JsonLongDocument counter(String id, long delta, long initial, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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 usingBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingBucket.upsert(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.**- Specified by:
counter
in interfaceBucket
- 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
public JsonLongDocument counter(String id, long delta, long initial, int expiry, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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 usingBucket.insert(D)
to create aJsonLongDocument
. The value can also be modified by usingBucket.upsert(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.**- Specified by:
counter
in interfaceBucket
- 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
Description copied from interface:Bucket
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 separateBucket.get(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.** -
append
Description copied from interface:Bucket
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 separateBucket.get(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.** -
append
Description copied from interface:Bucket
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 separateBucket.get(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.**- Specified by:
append
in interfaceBucket
- 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
public <D extends Document<?>> D append(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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 separateBucket.get(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.**- Specified by:
append
in interfaceBucket
- 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
public <D extends Document<?>> D append(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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 separateBucket.get(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.**- Specified by:
append
in interfaceBucket
- 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
public <D extends Document<?>> D append(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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 separateBucket.get(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.**- Specified by:
append
in interfaceBucket
- 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
Description copied from interface:Bucket
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 separateBucket.get(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.** -
prepend
Description copied from interface:Bucket
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 separateBucket.get(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.** -
prepend
Description copied from interface:Bucket
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 separateBucket.get(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.**- Specified by:
prepend
in interfaceBucket
- 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
public <D extends Document<?>> D prepend(D document, PersistTo persistTo, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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 separateBucket.get(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.**- Specified by:
prepend
in interfaceBucket
- 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
public <D extends Document<?>> D prepend(D document, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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 separateBucket.get(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.**- Specified by:
prepend
in interfaceBucket
- 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
public <D extends Document<?>> D prepend(D document, PersistTo persistTo, ReplicateTo replicateTo, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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 separateBucket.get(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.**- Specified by:
prepend
in interfaceBucket
- 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
Description copied from interface:Bucket
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.- Specified by:
lookupIn
in interfaceBucket
- 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
Description copied from interface:Bucket
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
.- Specified by:
mutateIn
in interfaceBucket
- 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
Description copied from interface:Bucket
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
. -
mapAdd
Description copied from interface:Bucket
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
. -
mapAdd
public <V> boolean mapAdd(String docId, String key, V value, MutationOptionBuilder mutationOptionBuilder)Description copied from interface:Bucket
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
.- Specified by:
mapAdd
in interfaceBucket
- Parameters:
docId
- document id backing the mapkey
- key to be storedvalue
- value to be storedmutationOptionBuilder
- mutation optionsMutationOptionBuilder
- Returns:
- true if successful
-
mapAdd
public <V> boolean mapAdd(String docId, String key, V value, MutationOptionBuilder mutationOptionBuilder, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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
.- Specified by:
mapAdd
in interfaceBucket
- 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
Description copied from interface:Bucket
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
. -
mapGet
Description copied from interface:Bucket
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
. -
mapRemove
Description copied from interface:Bucket
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
. -
mapRemove
Description copied from interface:Bucket
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
. -
mapRemove
Description copied from interface:Bucket
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
. -
mapRemove
public boolean mapRemove(String docId, String key, MutationOptionBuilder mutationOptionBuilder, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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
. -
mapSize
Description copied from interface:Bucket
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
. -
mapSize
Description copied from interface:Bucket
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
. -
listGet
Description copied from interface:Bucket
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
. -
listGet
public <E> E listGet(String docId, int index, Class<E> elementType, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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
. -
listAppend
Description copied from interface:Bucket
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
.- Specified by:
listAppend
in interfaceBucket
- Parameters:
docId
- document id backing the listelement
- element to be pushed into the queue- Returns:
- true if successful
-
listAppend
Description copied from interface:Bucket
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
.- Specified by:
listAppend
in interfaceBucket
- 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
public <E> boolean listAppend(String docId, E element, MutationOptionBuilder mutationOptionBuilder)Description copied from interface:Bucket
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
.- Specified by:
listAppend
in interfaceBucket
- Parameters:
docId
- document id backing the listelement
- element to be pushed into the queuemutationOptionBuilder
- mutation optionsMutationOptionBuilder
- Returns:
- true if successful
-
listAppend
public <E> boolean listAppend(String docId, E element, MutationOptionBuilder mutationOptionBuilder, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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
.- Specified by:
listAppend
in interfaceBucket
- 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
-
listPrepend
Description copied from interface:Bucket
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
.- Specified by:
listPrepend
in interfaceBucket
- Parameters:
docId
- document id backing the listelement
- element to shift as head of list- Returns:
- true if successful
-
listPrepend
Description copied from interface:Bucket
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
.- Specified by:
listPrepend
in interfaceBucket
- 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
public <E> boolean listPrepend(String docId, E element, MutationOptionBuilder mutationOptionBuilder)Description copied from interface:Bucket
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
.- Specified by:
listPrepend
in interfaceBucket
- Parameters:
docId
- document id backing the listelement
- element to shift as head of listmutationOptionBuilder
- mutation optionsMutationOptionBuilder
- Returns:
- true if successful
-
listPrepend
public <E> boolean listPrepend(String docId, E element, MutationOptionBuilder mutationOptionBuilder, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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
.- Specified by:
listPrepend
in interfaceBucket
- 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
-
listRemove
Description copied from interface:Bucket
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
.- Specified by:
listRemove
in interfaceBucket
- Parameters:
docId
- document id backing the listindex
- index of the element in list- Returns:
- true if successful
-
listRemove
Description copied from interface:Bucket
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
.- Specified by:
listRemove
in interfaceBucket
- 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
Description copied from interface:Bucket
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
.- Specified by:
listRemove
in interfaceBucket
- Parameters:
docId
- document id backing the listindex
- index of the element in listmutationOptionBuilder
- mutation optionsMutationOptionBuilder
- Returns:
- true if successful
-
listRemove
public boolean listRemove(String docId, int index, MutationOptionBuilder mutationOptionBuilder, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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
.- Specified by:
listRemove
in interfaceBucket
- 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
-
listSet
Description copied from interface:Bucket
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
. -
listSet
Description copied from interface:Bucket
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
. -
listSet
public <E> boolean listSet(String docId, int index, E element, MutationOptionBuilder mutationOptionBuilder)Description copied from interface:Bucket
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
.- Specified by:
listSet
in interfaceBucket
- Parameters:
docId
- document id backing the listindex
- index in the listelement
- element to be addedmutationOptionBuilder
- mutation optionsMutationOptionBuilder
- Returns:
- true if successful
-
listSet
public <E> boolean listSet(String docId, int index, E element, MutationOptionBuilder mutationOptionBuilder, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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
.- Specified by:
listSet
in interfaceBucket
- 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
Description copied from interface:Bucket
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
. -
listSize
Description copied from interface:Bucket
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
. -
setAdd
Description copied from interface:Bucket
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
. -
setAdd
Description copied from interface:Bucket
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
. -
setAdd
Description copied from interface:Bucket
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
.- Specified by:
setAdd
in interfaceBucket
- 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
public <E> boolean setAdd(String docId, E element, MutationOptionBuilder mutationOptionBuilder, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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
.- Specified by:
setAdd
in interfaceBucket
- 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
Description copied from interface:Bucket
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
.- Specified by:
setContains
in interfaceBucket
- 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
Description copied from interface:Bucket
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
.- Specified by:
setContains
in interfaceBucket
- 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
Description copied from interface:Bucket
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
. -
setRemove
Description copied from interface:Bucket
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
. -
setRemove
Description copied from interface:Bucket
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
.- Specified by:
setRemove
in interfaceBucket
- 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
public <E> E setRemove(String docId, E element, MutationOptionBuilder mutationOptionBuilder, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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
.- Specified by:
setRemove
in interfaceBucket
- 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
Description copied from interface:Bucket
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
. -
setSize
Description copied from interface:Bucket
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
. -
queuePush
Description copied from interface:Bucket
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
. -
queuePush
Description copied from interface:Bucket
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
. -
queuePush
Description copied from interface:Bucket
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
.- Specified by:
queuePush
in interfaceBucket
- Parameters:
docId
- document id backing the queueelement
- element to be pushed into the queuemutationOptionBuilder
- mutation optionsMutationOptionBuilder
- Returns:
- true if successful
-
queuePush
public <E> boolean queuePush(String docId, E element, MutationOptionBuilder mutationOptionBuilder, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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
.- Specified by:
queuePush
in interfaceBucket
- 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
Description copied from interface:Bucket
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
. -
queuePop
Description copied from interface:Bucket
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
. -
queuePop
public <E> E queuePop(String docId, Class<E> elementType, MutationOptionBuilder mutationOptionBuilder)Description copied from interface:Bucket
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
. -
queuePop
public <E> E queuePop(String docId, Class<E> elementType, MutationOptionBuilder mutationOptionBuilder, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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
. -
queueSize
Description copied from interface:Bucket
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
. -
queueSize
Description copied from interface:Bucket
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
. -
close
Description copied from interface:Bucket
Closes this bucket with the default disconnect timeout. -
close
Description copied from interface:Bucket
Closes this bucket with a custom timeout. -
isClosed
public boolean isClosed()Description copied from interface:Bucket
Returns true if this bucket is already closed, false if it is still open. -
toString
-
invalidateQueryCache
public int invalidateQueryCache()Description copied from interface:Bucket
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.- Specified by:
invalidateQueryCache
in interfaceBucket
- Returns:
- the number of entries in the cache before it was cleared out.
-
ping
Description copied from interface:Bucket
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). -
ping
Description copied from interface:Bucket
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). -
ping
Description copied from interface:Bucket
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). -
ping
public PingReport ping(String reportId, Collection<ServiceType> services, long timeout, TimeUnit timeUnit)Description copied from interface:Bucket
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). -
exportAnalyticsDeferredResultHandle
Description copied from interface:Bucket
Exports the deferred result handle to a serialized form which can be used across SDKs- Specified by:
exportAnalyticsDeferredResultHandle
in interfaceBucket
- Parameters:
handle
- the deferred result handle- Returns:
- the serialized bytes
-
importAnalyticsDeferredResultHandle
Description copied from interface:Bucket
Imports from json to create aAnalyticsDeferredResultHandle
.- Specified by:
importAnalyticsDeferredResultHandle
in interfaceBucket
- Parameters:
b
- the bytes to be converted to handle- Returns:
- the deferred handle instance
-
ping
Description copied from interface:Bucket
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. -
ping
Description copied from interface:Bucket
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. -
ping
Description copied from interface:Bucket
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. -
ping
Description copied from interface:Bucket
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.
-