FetchValue Class
Command used to fetch an object from Riak.
As a convenience, a builder class is provided:
var fetch = new FetchValue.Builder()
.withBucket('myBucket')
.withKey('myKey')
.withCallback(myCallback)
.build();
Constructor
FetchValue
-
options
-
callback
Parameters:
-
options
ObjectThe options for this command.
-
[bucketType=default]
String optionalThe bucket type in riak. If not supplied 'default' is used.
-
bucket
StringThe bucket in riak.
-
key
StringThe key for the object you want to fetch.
-
[convertToJs=false]
Boolean optionalConvert the values stored in riak to a JS object using JSON.parse()
-
[conflictResolver]
Function optionalA function used to resolve siblings to a single object.
-
objects
RiakObject[] | ObjectThe array of objects returned from Riak.
-
-
[timeout]
Number optionalSet a timeout for this operation.
-
[r]
Number optionalThe R value to use for this fetch.
-
[pr]
Number optionalThe PR value to use for this fetch.
-
[notFoundOk]
Boolean optionalIf true a vnode returning notfound for a key increments the r tally.
-
[useBasicQuorum]
Boolean optionalControls whether a read request should return early in some fail cases.
-
[returnDeletedVClock]
Boolean optionalTrue to return tombstones.
-
[headOnly]
Boolean optionalReturn only the metadata.
-
[ifModified]
Buffer optionalReturn the object if the supplied vclock does not match (the object is modified).
-
-
callback
FunctionThe callback to be executed when the operation completes.
-
err
StringAn error message. Will be null if no error.
-
response
Objectthe response from Riak.
-
isNotFound
BooleanTrue if there was no value in Riak. -
isUnchanged
BooleanTrue if the object has not changed (based on a vclock provided via ifModified) -
vclock
BufferThe vector clock for this object (and its siblings) -
values
Object | RiakObject[]An array of one or more values. Either RiakObjects or JS objects if convertToJs was used.
-
-
data
Objectadditional error data. Will be null if no error.
-
Item Index
Methods
constructPbRequest
()
Object
protected
Returns:
getCallback
()
Function
private
Returns:
getExpectedResponseCode
()
Number
private
Returns:
getPbReqBuilder
()
Object
private
Returns:
getRiakMessage
()
Object
private
Returns:
onError
-
msg
-
data
Parameters:
-
msg
Stringan error message -
data
Objectadditional error data
onRiakError
-
rpbErrorResp
Parameters:
-
rpbErrorResp
Objectthe RpbErrorResp protocol buffer
onSuccess
-
pbResponseMessage
Parameters:
-
pbResponseMessage
Objectthe protocol buffer received from riak