DeleteValue Class
Command used to delete a value from Riak.
As a convenience, a builder class is provided:
var deleteValue = new DeleteValue.Builder()
.withBucket('myBucket')
.withKey('myKey')
.withVClock(vclock)
.withCallback(callback)
.build();
Constructor
DeleteValue
(
-
options
-
callback
Parameters:
-
options
ObjectThe options for this command.
-
[bucketType=default]
String optionalThe bucket type in Riak. If not suppled 'default' is used.
-
bucket
StringThe bucket in Riak.
-
key
StringThe key for the object you want to delete.
-
[vclock]
Buffer optionalThe vector clock to use.
-
[timeout]
Number optionalSet a timeout for this operation.
-
[r]
Number optionalThe R value to use.
-
[pr]
Number optionalThe PR value to use.
-
[w]
Number optionalThe W value to use.
-
[dw]
Number optionalThe DW value to use.
-
[pw]
Number optionalThe PW value to use.
-
[rw]
Number optionalThe RW value to use.
-
-
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. Will be true unless there was an error.
-
data
Objectadditional error data. Will be null if no error.
-
Item Index
Methods
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.