StoreBucketTypeProps Class
Command used to set the properties on a bucket type in Riak.
As a convenience, a builder class is provided:
var storeProps = new StoreBucketTypeProps.Builder()
.withBucketType('my-type')
.withAllowMult(true)
.build();
Constructor
StoreBucketTypeProps
(
-
options -
callback -
callback
Parameters:
-
optionsObjectThe properties to store
-
[bucketType]String optionalThe bucket type in riak. If not supplied 'default is used'
-
-
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
(
chainable
-
postcommitHook
Add a pre-commit hook.
Parameters:
-
postcommitHookObjectthe hook to add.
addPrecommitHook
(
chainable
-
precommitHook
Add a pre-commit hook.
Parameters:
-
precommitHookObjectthe hook to add.
constructPbRequest
()
Object
protected
Construct and return the Riak protocol buffer message for this command.
Subclasses must override this method.
Returns:
Object:
a protocol buffer message builder
getCallback
()
Function
private
Fires the user's callback with the arguments passed in.
Returns:
Function:
the user supplied callback
getExpectedResponseCode
()
Number
private
Returns the expected response code for this command.
Returns:
Number:
the expected response code for this command.
getPbReqBuilder
()
Object
private
Returns and instance of the protocol buffer message builder for this command.
This is determined via the pbRequestName passed to the constructor.
Returns:
Object:
the builder for the protocol buffer message to be sent for this command
getRiakMessage
()
Object
private
Returns the encoded protobuf and message header.
Returns:
Object:
object containing the header and encoded protobuf
onError
(
protected
-
msg -
data
Called by RiakNode if an error occurs executing the command and all retries are exhausted.
Parameters:
-
msgStringan error message -
dataObjectadditional error data
onRiakError
(
protected
-
rpbErrorResp
Called by RiakNode when a RpbErrorResp is received and all retries are exhausted.
Commands may override this method.
Parameters:
-
rpbErrorRespObjectthe RpbErrorResp protocol buffer
onSuccess
(
Boolean
protected
-
pbResponseMessage
Called by RiakNode when a response is received.
Subclasses must override this method.
Parameters:
-
pbResponseMessageObjectthe protocol buffer received from riak
Returns:
Boolean:
true if not streaming or the last response has been received, false otherwise.
withAllowMult
(
chainable
-
allowMult
Set the allow_multi value.
Parameters:
-
allowMultBooleanwhether to allow sibling objects to be created.
withBackend
(
chainable
-
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
(
chainable
-
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
(
chainable
-
bigVClock
Set the big VClock value.
Parameters:
-
bigVClockNumberan epoch time value
withBucketType
(
chainable
-
bucketType
Set the bucket type.
If not supplied, 'default' is used.
Parameters:
-
bucketTypeStringthe bucket type in riak
withCallback
(
chainable
-
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
(
chainable
-
func
Set the chash_keyfun value.
Parameters:
-
funcObjecta object representing the Erlang func to use.
withDw
(
chainable
-
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
(
chainable
-
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
(
chainable
-
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
(
chainable
-
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
(
chainable
-
nVal
Set the nVal.
Parameters:
-
nValNumberthe number of replicas.
withOldVClock
(
chainable
-
oldVClock
Set the old VClock value
Parameters:
-
oldVClockNumberan epoch time value
withPr
(
chainable
-
pr
Set the PR value.
If not asSet the bucket default is used.
Parameters:
-
prNumberthe PR value.
withPw
(
chainable
-
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
(
chainable
-
r
Set the R value.
If not asSet the bucket default is used.
Parameters:
-
rNumberthe R value.
withRw
(
chainable
-
rw
Set the RW value.
Quorum for both operations (get and put) involved in deleting an object .
Parameters:
-
rwNumberthe RW value.
withSearchIndex
(
chainable
-
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
(
chainable
-
smallVClock
Set the small VClock value.
Parameters:
-
smallVClockNumberan epoch time value.
withW
(
chainable
-
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
(
chainable
-
youngVClock
Set the young VClock value
Parameters:
-
youngVClockNumberan epoch time value
