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:
-
options
ObjectThe properties to store
-
[bucketType]
String optionalThe bucket type in riak. If not supplied 'default is used'
-
-
callback
FunctionThe callback to be executed when the operation completes.
-
err
StringAn error message. Will be null if no error.
-
response
Booleanthe response from Riak. This will be true.
-
-
callback
FunctionThe callback to be executed when the operation completes.
-
String
An error message. Will ne null if no error.
-
Object
The response from Riak. This is an oject with all the bucket properties.
-
Object
additional 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:
-
postcommitHook
Objectthe hook to add.
addPrecommitHook
(
chainable
-
precommitHook
Add a pre-commit hook.
Parameters:
-
precommitHook
Objectthe 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:
-
msg
Stringan error message -
data
Objectadditional error data
onRiakError
(
protected
-
rpbErrorResp
Called by RiakNode when a RpbErrorResp is received and all retries are exhausted.
Commands may override this method.
Parameters:
-
rpbErrorResp
Objectthe RpbErrorResp protocol buffer
onSuccess
(
Boolean
protected
-
pbResponseMessage
Called by RiakNode when a response is received.
Subclasses must override this method.
Parameters:
-
pbResponseMessage
Objectthe 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:
-
allowMult
Booleanwhether 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:
-
backend
Sringthe 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:
-
useBasicQuorum
Booleanthe basic_quorum value.
withBigVClock
(
chainable
-
bigVClock
Set the big VClock value.
Parameters:
-
bigVClock
Numberan epoch time value
withBucketType
(
chainable
-
bucketType
Set the bucket type.
If not supplied, 'default' is used.
Parameters:
-
bucketType
Stringthe bucket type in riak
withCallback
(
chainable
-
callback
Set the callback to be executed when the operation completes.
Parameters:
-
callback
FunctionThe callback to be executed when the operation completes.-
err
StringAn error message. Will ne null if no error.
-
response
ObjectThe response from Riak. This is an oject with all the bucket properties.
-
withChashkeyFunction
(
chainable
-
func
Set the chash_keyfun value.
Parameters:
-
func
Objecta 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:
-
dw
Numberthe 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:
-
lastWriteWins
Booleanwhether 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:
-
search
Booleanenable 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:
-
notFoundOk
Booleanthe not_found_ok value.
withNVal
(
chainable
-
nVal
Set the nVal.
Parameters:
-
nVal
Numberthe number of replicas.
withOldVClock
(
chainable
-
oldVClock
Set the old VClock value
Parameters:
-
oldVClock
Numberan epoch time value
withPr
(
chainable
-
pr
Set the PR value.
If not asSet the bucket default is used.
Parameters:
-
pr
Numberthe 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:
-
pw
Numberthe PW value.
withR
(
chainable
-
r
Set the R value.
If not asSet the bucket default is used.
Parameters:
-
r
Numberthe R value.
withRw
(
chainable
-
rw
Set the RW value.
Quorum for both operations (get and put) involved in deleting an object .
Parameters:
-
rw
Numberthe RW value.
withSearchIndex
(
chainable
-
searchIndex
Associate a Search Index.
This only applies if Yokozuna is enabled in
Riak v2.0.
Parameters:
-
searchIndex
StringThe name of the search index to use.
withSmallVClock
(
chainable
-
smallVClock
Set the small VClock value.
Parameters:
-
smallVClock
Numberan 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:
-
w
Numberthe W value.
withYoungVClock
(
chainable
-
youngVClock
Set the young VClock value
Parameters:
-
youngVClock
Numberan epoch time value