StorePropsBase Class
Constructor
StorePropsBase
-
options -
pbRequestName -
pbResponseName -
callback -
callback
Parameters:
-
optionsObjectThe properties to store
-
[r]Number optionalThe R value.
-
[pr]Number optionalThe PR value.
-
[w]Number optionalThe W value.
-
[dw]Number optionalThe DW value.
-
[pw]Number optionalThe PW value.
-
[rw]Number optionalThe RW value.
-
[notFoundOk]Boolean optionalIf true a vnode returning notfound for a key increments the r tally.
-
[basicQuorum]Boolean optionalControls whether a read request should return early in some fail cases.
-
[nVal]Number optionalThe number of replicas.
-
[allowMult]Boolean optionalWhether to allow sibling objects to be created.
-
[lastWriteWins]Boolean optionalWhether to ignore vector clocks when writing.
-
[oldVClock]Number optionalAn epoch time value.
-
[youngVClock]Number optionalAn epoch time value.
-
[bigVClock]Number optionalAn epoch time value.
-
[smallVClock]Number optionalAn epoch time value.
-
[backend]Sring optionalThe name of the backend to use.
-
[search]Boolean optionalEnable the pre-commit hook for Legacy Riak search.
-
[searchIndex]String optionalThe name of the search index to use.
-
[chashKeyfun]Object optionalAn object representing the Erlang func to use.
-
[precommit]Object optionalArray of precommit hooks
-
[postcommit]Object optionalArray of postcommit hooks
-
-
pbRequestNameStringname of the Riak protocol buffer this command will send
-
pbResponseNameStringname of the Riak protocol buffer this command will receive
-
callbackFunctionThe callback to be executed when the operation completes.
-
errStringAn error message. Will be null if no error.
-
responseBooleanthe response from Riak. This will be true.
-
-
callbackFunctionThe callback to be executed when the operation completes.
-
StringAn error message. Will ne null if no error.
-
ObjectThe response from Riak. This is an oject with all the bucket properties.
-
Objectadditional error data. Will be null if no error.
-
Item Index
Methods
- addPostcommitHook
- addPrecommitHook
- constructPbRequest
- getCallback
- getExpectedResponseCode
- getPbReqBuilder
- getRiakMessage
- onError
- onRiakError
- onSuccess
- withAllowMult
- withBackend
- withBasicQuorum
- withBigVClock
- withBucketType
- withCallback
- withChashkeyFunction
- withDw
- withLastWriteWins
- withLegacySearchEnabled
- withNotFoundOk
- withNVal
- withOldVClock
- withPr
- withPw
- withR
- withRw
- withSearchIndex
- withSmallVClock
- withW
- withYoungVClock
Methods
addPostcommitHook
-
postcommitHook
Add a pre-commit hook.
Parameters:
-
postcommitHookObjectthe hook to add.
addPrecommitHook
-
precommitHook
Add a pre-commit hook.
Parameters:
-
precommitHookObjectthe hook to add.
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
Returns:
withAllowMult
-
allowMult
Set the allow_multi value.
Parameters:
-
allowMultBooleanwhether to allow sibling objects to be created.
withBackend
-
backend
Set the backend used by this bucket. Only applies when using riak_kv_multi_backend in Riak.
Parameters:
-
backendSringthe name of the backend to use.
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:
-
useBasicQuorumBooleanthe basic_quorum value.
withBigVClock
-
bigVClock
Set the big VClock value.
Parameters:
-
bigVClockNumberan epoch time value
withBucketType
-
bucketType
Set the bucket type. If not supplied, 'default' is used.
Parameters:
-
bucketTypeStringthe bucket type in riak
withCallback
-
callback
Set the callback to be executed when the operation completes.
Parameters:
-
callbackFunctionThe callback to be executed when the operation completes.
-
errStringAn error message. Will ne null if no error.
-
responseObjectThe response from Riak. This is an oject with all the bucket properties.
-
withChashkeyFunction
-
func
Set the chash_keyfun value.
Parameters:
-
funcObjecta object representing the Erlang func to use.
withDw
-
dw
Set the DW value. How many replicas to commit to durable storage before returning a successful response. If not set the bucket default is used.
Parameters:
-
dwNumberthe DW value.
withLastWriteWins
-
lastWriteWins
Set the last_write_wins value. Unless you really know what you're doing, you probably do not want to set this to true.
Parameters:
-
lastWriteWinsBooleanwhether to ignore vector clocks when writing.
withLegacySearchEnabled
-
search
Enable Legacy Riak Search. Setting this to true causes the search pre-commit hook to be added.
Note this is only for legacy Riak (< v2.0) Search support.
Parameters:
-
searchBooleanenable add/remove (true/false) the pre-commit hook for Legacy Riak Search.
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.
Parameters:
-
notFoundOkBooleanthe not_found_ok value.
withNVal
-
nVal
Set the nVal.
Parameters:
-
nValNumberthe number of replicas.
withOldVClock
-
oldVClock
Set the old VClock value
Parameters:
-
oldVClockNumberan epoch time value
withPr
-
pr
Set the PR value. If not asSet the bucket default is used.
Parameters:
-
prNumberthe PR value.
withPw
-
pw
Set the PW value. How many primary nodes must be up when the write is attempted. If not set the bucket default is used.
Parameters:
-
pwNumberthe PW value.
withR
-
r
Set the R value. If not asSet the bucket default is used.
Parameters:
-
rNumberthe R value.
withRw
-
rw
Set the RW value. Quorum for both operations (get and put) involved in deleting an object .
Parameters:
-
rwNumberthe RW value.
withSearchIndex
-
searchIndex
Associate a Search Index. This only applies if Yokozuna is enabled in Riak v2.0.
Parameters:
-
searchIndexStringThe name of the search index to use.
withSmallVClock
-
smallVClock
Set the small VClock value.
Parameters:
-
smallVClockNumberan epoch time value.
withW
-
w
Set the W value. How many replicas to write to before returning a successful response. If not set the bucket default is used.
Parameters:
-
wNumberthe W value.
withYoungVClock
-
youngVClock
Set the young VClock value
Parameters:
-
youngVClockNumberan epoch time value
