FetchSet.Builder Class
A builder for constructing FetchSet instances.
Rather than having to manually construct the options and instantiating a FetchSet directly, this builder may be used.
var fetch = new FetchSet.Builder()
.withBucketType('myBucketType')
.withBucket('myBucket')
.withKey('myKey')
.withCallback(myCallback)
.build();
Constructor
FetchSet.Builder
()
Item Index
Methods
withBasicQuorum
-
useBasicQuorum
Set the basic_quorum value. The parameter controls whether a read request should return early in some fail cases. E.g. If a quorum of nodes has already returned notfound/error, don't wait around for the rest.
Parameters:
-
useBasicQuorum
Booleanthe basic_quorum value.
withBucket
-
bucket
Set the bucket.
Parameters:
-
bucket
Stringthe bucket in Riak
withBucketType
-
bucketType
Set the bucket type.
Parameters:
-
bucketType
Stringthe bucket type in riak
withCallback
-
callback.err
-
callback.response
-
callback.response.context
-
callback.response.values
-
callback.response.isNotFound
Set the callback to be executed when the operation completes.
Parameters:
-
callback.err
StringAn error message. Will be null if no error.
-
callback.response
ObjectThe response from Riak.
-
callback.response.context
BufferAn opaque context to be used in any subsequent modification of the set.
-
callback.response.values
String | BufferAn array holding the values in the set. String by default, Buffers if setsAsBuffers was used.
-
callback.response.isNotFound
BooleanTrue if there was no set in Riak.
withKey
-
key
Set the key.
Parameters:
-
key
Stringthe key in riak.
withNotFoundOk
-
notFoundOk
Set the not_found_ok value. If true a vnode returning notfound for a key increments the r tally. False is higher consistency, true is higher availability. If not asSet the bucket default is used.
Parameters:
-
notFoundOk
Booleanthe not_found_ok value.
withPr
-
pr
Set the PR value. If not set the bucket default is used.
Parameters:
-
pr
Numberthe PR value.
withR
-
r
Set the R value. If not set the bucket default is used.
Parameters:
-
r
Numberthe R value.
withSetsAsBuffers
-
setsAsBuffers
Return sets as arrays of Buffers rather than strings. By default the contents of sets are converted to strings. Setting this to true will cause this not to occur and the raw bytes returned as Buffer objects.
Parameters:
-
setsAsBuffers
Booleantrue to not convert set contents to strings.
withTimeout
-
timeout
Set a timeout for this operation.
Parameters:
-
timeout
Numbera timeout in milliseconds.