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:
-
optionsObjectThe options for this command.
-
[bucketType=default]String optionalThe bucket type in riak. If not supplied 'default' is used.
-
bucketStringThe bucket in riak.
-
keyStringThe 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.
-
objectsRiakObject[] | 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).
-
-
callbackFunctionThe callback to be executed when the operation completes.
-
errStringAn error message. Will be null if no error.
-
responseObjectthe response from Riak.
-
isNotFoundBooleanTrue if there was no value in Riak. -
isUnchangedBooleanTrue if the object has not changed (based on a vclock provided via ifModified) -
vclockBufferThe vector clock for this object (and its siblings) -
valuesObject | RiakObject[]An array of one or more values. Either RiakObjects or JS objects if convertToJs was used.
-
-
dataObjectadditional 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:
-
msgStringan error message -
dataObjectadditional error data
onRiakError
-
rpbErrorResp
Parameters:
-
rpbErrorRespObjectthe RpbErrorResp protocol buffer
onSuccess
-
pbResponseMessage
Parameters:
-
pbResponseMessageObjectthe protocol buffer received from riak
