org.mule.modules

mule-module-riak

config

Namespacehttp://www.mulesoft.org/schema/mule/riak
Schema Locationhttp://www.mulesoft.org/schema/mule/riak/current/mule-riak.xsd  (View Schema)
Schema Version3.4.0
Minimum Mule Version3.4.0

Module Overview

Riak Connector. Based on Basho's Java client.

Summary

Configuration
<riak:config>
Configure an instance of this module
Message Processors
<riak:create-bucket>
Create a new bucket using the provided name.
<riak:delete>
Delete the object at the specified key of the specified bucket.
<riak:fetch>
Fetches data from a Bucket and stores it in the current message payload.
<riak:fetch-bin-index>
Retrieve all the keys matching the bin index range or value.
<riak:fetch-bucket>
Fetches a bucket by name.
<riak:fetch-int-index>
Retrieve all the keys matching the integer index range or value.
<riak:fetch-keys>
Retrieve all the keys in the specified bucket.
<riak:get-statistics>
Perform the Riak /stats operation on the node(s) this client is connected to.
<riak:list-bucket-names>
Retrieve the bucket names.
<riak:map-reduce-bin-index>
Performs a map-reduce operation that uses a Bin index query as input.
<riak:map-reduce-bucket>
Performs a map-reduce over a bucket.
<riak:map-reduce-bucket-key>
Performs a map-reduce over a set of bucket/key/keydata inputs.
<riak:map-reduce-int-index>
Performs a map-reduce operation that uses an Int index query as input.
<riak:map-reduce-search>
Performs a map-reduce operation that uses a Riak Search query as input.
<riak:store>
Stores the current message payload into a Bucket.
<riak:update-bucket>
Update a bucket using the provided name.
<riak:walk>
Walks the provided links starting at the object defined by the specified key and bucket name.

Configuration

To use the this module within a flow the namespace to the module must be included. The resulting flow will look similar to the following:

<mule xmlns="http://www.mulesoft.org/schema/mule/core"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:riak="http://www.mulesoft.org/schema/mule/riak"
      xsi:schemaLocation="
               http://www.mulesoft.org/schema/mule/core
               http://www.mulesoft.org/schema/mule/core/current/mule.xsd
               http://www.mulesoft.org/schema/mule/riak
               http://www.mulesoft.org/schema/mule/riak/current/mule-riak.xsd">

      <!-- here goes your flows and configuration elements -->

</mule>

This module is configured using the config element. This element must be placed outside of your flows and at the root of your Mule application. You can create as many configurations as you deem necessary as long as each carries its own name.

Each message processor, message source or transformer carries a config-ref attribute that allows the invoker to specify which configuration to use.

Attributes
TypeNameDefault ValueDescriptionJava TypeMIME TypeEncoding
xs:string name Optional. Give a name to this configuration so it can be later referenced.
xs:int clusterTotalMaximumConnections 0 Optional. If a cluster client is used (ie.
httpClientConfiguration Optional. The HTTP client configuration to use to connect to Riak.
httpClientConfigurations Optional. The HTTP cluster client configurations to use to connect to Riak.
xs:boolean lazyLoadBucketProperties false Optional. Allows to defer fetching bucket properties from Riak until they are required by one of the Bucket methods that accesses them.
protobufClientConfiguration Optional. The Protocol Buffer client configuration to use to connect to Riak.
protobufClientConfigurations Optional. The Protocol Buffer cluster client configurations to use to connect to Riak.
retrier Optional. A Retrier to use to perform actions.
xs:int retryCount 1 Optional. The number of retries to attempt if no retrier has been configured and the DefaultRetrier is used.

Example

INCLUDE_ERROR

Example

INCLUDE_ERROR

Example

INCLUDE_ERROR

Example

INCLUDE_ERROR

Example

INCLUDE_ERROR

Message Processors

<riak:create-bucket>

Create a new bucket using the provided name.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
bucketName The name of the new bucket. String */* UTF-8
allowSiblings false Optional. Should the bucket have allow_mult set to true? boolean */*
backend Optional. Which backend this bucket uses. Not supported by the Protobuf API. String */* UTF-8
enableSearch false Optional. To enable or disable search and related commit hooks (support for both pre-1.0 and 1.0 search). Not supported by the Protobuf API. boolean */*
lastWriteWins Optional. Set this bucket last_write_wins. Not supported by the Protobuf API. Boolean */*
notFoundOK Optional. Default notfound_ok value. Not supported by the Protobuf API. Boolean */*
nVal 3 Optional. The n_val for this bucket. int */*
smallVClock Optional. The small_vclock prune size. Not supported by the Protobuf API. Integer */*
bigVClock Optional. The big_vclock prune size. Not supported by the Protobuf API. Integer */*
oldVClock Optional. The old_vclock prune age. Not supported by the Protobuf API. Long */*
youngVClock Optional. The young_vclock prune age. Not supported by the Protobuf API. Long */*
chashKeyFunction Optional. Erlang function names to be used as the chash_key_fun. Not supported by the Protobuf API. FunctionConfiguration */*
linkWalkFunction Optional. Erlang function names to be used as the link_walk_fun. Not supported by the Protobuf API. FunctionConfiguration */*
quorumConfiguration Optional. The specific quorum configuration to use for the operation. QuorumConfiguration */*
Child Elements
NameDefault ValueDescriptionJava Type
<riak:pre-commit-hooks> Optional. Erlang or JavaScript function names to be used as pre-commit hooks. Not supported by the Protobuf API. List<FunctionConfiguration>
<riak:post-commit-hooks> Optional. Erlang function names to be used as post-commit hooks. Not supported by the Protobuf API. List<FunctionConfiguration>
Returns
Return Type Description
Bucket the newly created Bucket.
Exception Payloads
Payload ClassDescription
RiakRetryFailedException thrown if the operation can't succeed.

<riak:delete>

Delete the object at the specified key of the specified bucket.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
bucketName The name of the bucket to fetch from. String */* UTF-8
key The key at which the data must be stored. String */* UTF-8
vClock Optional. Vector clock to delete. Acceptable types are VClock, byte[] or String. Object */*
fetchBeforeDelete Optional. If you want to provide a vclock to delete, but don't have one, setting this true will have the operation first perform a fetch (using the supplied r/pr parameters). Boolean */*
quorumConfiguration Optional. The specific quorum configuration to use for the operation. QuorumConfiguration */*
muleEvent The current MuleEvent. MuleEvent */*
Exception Payloads
Payload ClassDescription
RiakException thrown if the operation can't succeed.
UnsupportedEncodingException thrown if a vector clock String can't be converted to byte[] using the MuleEvent's encoding.

<riak:fetch>

Fetches data from a Bucket and stores it in the current message payload.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
bucketName The name of the bucket to fetch from. String */* UTF-8
key The key at which the data must be stored. String */* UTF-8
ifModifiedVClock Optional. Fetch only if the stored vector clock is different from the provided vector clock. Acceptable types are VClock , byte[] or String. Object */*
modifiedSince Optional. Fetch only if the stored value has been modified after the provided date. Date */*
notFoundOK Optional. If a notfound response counts towards satisfying the r value. Boolean */*
returnDeletedVClock Optional. If an object has been deleted, return the tombstone vclock. Boolean */*
quorumConfiguration Optional. The specific quorum configuration to use for the operation. QuorumConfiguration */*
resolver Optional. The ConflictResolver to use on any sibling results returned from the fetch (and store if returnBody is true). ConflictResolver<IRiakObject> */*
muleEvent The current MuleEvent. MuleEvent */*
Returns
Return Type Description
byte[] the byte[] representing the stored value if returnBody is true, null if returnBody is false.
Exception Payloads
Payload ClassDescription
RiakRetryFailedException thrown if the operation can't succeed.
UnsupportedEncodingException thrown if a vector clock String can't be converted to byte[] using the MuleEvent's encoding.

<riak:fetch-bin-index>

Retrieve all the keys matching the bin index range or value.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
bucketName The name of the bucket to fetch from. String */* UTF-8
indexName The name of the index. String */* UTF-8
from Optional. The start value of the index range. String */* UTF-8
to Optional. The end value of the index range. String */* UTF-8
value Optional. The fixed index value. String */* UTF-8
Returns
Return Type Description
List<String> the list of keys that match the index range or value.
Exception Payloads
Payload ClassDescription
RiakException thrown if the operation can't succeed.

<riak:fetch-bucket>

Fetches a bucket by name.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
bucketName The name of the bucket. String */* UTF-8
Returns
Return Type Description
Bucket the fetched Bucket.
Exception Payloads
Payload ClassDescription
RiakRetryFailedException thrown if the operation can't succeed.

<riak:fetch-int-index>

Retrieve all the keys matching the integer index range or value.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
bucketName The name of the bucket to fetch from. String */* UTF-8
indexName The name of the index. String */* UTF-8
from Optional. The start value of the index range. Integer */*
to Optional. The end value of the index range. Integer */*
value Optional. The fixed index value. Integer */*
Returns
Return Type Description
List<String> the list of keys that match the index range or value.
Exception Payloads
Payload ClassDescription
RiakException thrown if the operation can't succeed.

<riak:fetch-keys>

Retrieve all the keys in the specified bucket.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
bucketName The name of the bucket to fetch from. String */* UTF-8
Returns
Return Type Description
Iterable<String> an Iterable of String keys.
Exception Payloads
Payload ClassDescription
RiakException thrown if the operation can't succeed.

<riak:get-statistics>

Perform the Riak /stats operation on the node(s) this client is connected to.

This is not supported by the Protobuf API.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
Returns
Return Type Description
Iterable<NodeStats> an Iterable object that contains one or more NodeStats
Exception Payloads
Payload ClassDescription
RiakException If Riak does not respond or if the protobuf API is being used

<riak:list-bucket-names>

Retrieve the bucket names.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
Returns
Return Type Description
Set<String> a set of Bucket names.
Exception Payloads
Payload ClassDescription
RiakException thrown if the fetch operation can't succeed.

<riak:map-reduce-bin-index>

Performs a map-reduce operation that uses a Bin index query as input.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
bucketName The name of the bucket to execute the map-reduce on. String */* UTF-8
indexName The name of the index to query. String */* UTF-8
from Optional. The start value of the index range. String */* UTF-8
to Optional. The end value of the index range. String */* UTF-8
value Optional. The fixed index value. String */* UTF-8
timeout Optional. The maximum duration in milliseconds for the map-reduce operation. Long */*
Child Elements
NameDefault ValueDescriptionJava Type
<riak:phases> Optional. A List of map-reduce phases defined with MapReducePhaseConfiguration instances. List<MapReducePhaseConfiguration>
Returns
Return Type Description
String the raw JSON string of the result.
Exception Payloads
Payload ClassDescription
RiakException thrown if the operation can't succeed.

<riak:map-reduce-bucket>

Performs a map-reduce over a bucket.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
bucketName Optional. The name of the bucket to execute the map-reduce on. String */* UTF-8
timeout Optional. The maximum duration in milliseconds for the map-reduce operation. Long */*
Child Elements
NameDefault ValueDescriptionJava Type
<riak:key-filters> Optional. A List of KeyFilter to apply on the inputs of the map-reduce operation. List<KeyFilter>
<riak:phases> Optional. A List of map-reduce phases defined with MapReducePhaseConfiguration instances. List<MapReducePhaseConfiguration>
Returns
Return Type Description
String the raw JSON string of the result.
Exception Payloads
Payload ClassDescription
RiakException thrown if the operation can't succeed.

<riak:map-reduce-bucket-key>

Performs a map-reduce over a set of bucket/key/keydata inputs.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
timeout Optional. The maximum duration in milliseconds for the map-reduce operation. Long */*
Child Elements
NameDefault ValueDescriptionJava Type
<riak:inputs> A List of BucketKeyInputConfiguration used as input for the map-reduce operation. List<BucketKeyInputConfiguration>
<riak:phases> Optional. A List of map-reduce phases defined with MapReducePhaseConfiguration instances. List<MapReducePhaseConfiguration>
Returns
Return Type Description
String the raw JSON string of the result.
Exception Payloads
Payload ClassDescription
RiakException thrown if the operation can't succeed.

<riak:map-reduce-int-index>

Performs a map-reduce operation that uses an Int index query as input.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
bucketName The name of the bucket to execute the map-reduce on. String */* UTF-8
indexName The name of the index to query. String */* UTF-8
from Optional. The start value of the index range. Long */*
to Optional. The end value of the index range. Long */*
value Optional. The fixed index value. Long */*
timeout Optional. The maximum duration in milliseconds for the map-reduce operation. Long */*
Child Elements
NameDefault ValueDescriptionJava Type
<riak:phases> Optional. A List of map-reduce phases defined with MapReducePhaseConfiguration instances. List<MapReducePhaseConfiguration>
Returns
Return Type Description
String the raw JSON string of the result.
Exception Payloads
Payload ClassDescription
RiakException thrown if the operation can't succeed.

<riak:map-reduce-search>

Performs a map-reduce operation that uses a Riak Search query as input.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
bucketName The name of the bucket to execute the map-reduce on. String */* UTF-8
query The query to run to provide data to the map-reduce operation. String */* UTF-8
timeout Optional. The maximum duration in milliseconds for the map-reduce operation. Long */*
Child Elements
NameDefault ValueDescriptionJava Type
<riak:phases> Optional. A List of map-reduce phases defined with MapReducePhaseConfiguration instances. List<MapReducePhaseConfiguration>
Returns
Return Type Description
String the raw JSON string of the result.
Exception Payloads
Payload ClassDescription
RiakException thrown if the operation can't succeed.

<riak:store>

Stores the current message payload into a Bucket.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
bucketName The name of the bucket to store into. String */* UTF-8
key Optional. The key at which the data must be stored, which is optional if the current message payload is a IRiakObject. String */* UTF-8
contentType Optional. The content type of the data being stored. Defaults to the mime type of the current message payload. String */* UTF-8
ifNoneMatch false Optional. True if you want a conditional store, false otherwise, defaults to false. NOTE: This has different meanings depending on the underlying transport. boolean */*
ifNotModified false Optional. True if you want a conditional store, false otherwise, defaults to false. NOTE: This has different meanings depending on the underlying transport. boolean */*
returnBody false Optional. Should the store operation return a response body? boolean */*
withoutFetch false Optional. Eliminates fetching the existing value before storing the current one. boolean */*
notFoundOK Optional. If notfound_ok counts towards r count (for the pre-store fetch). Boolean */*
returnDeletedVClock Optional. If the object has just been deleted, there maybe a tombstone value vclock, set to true to have this returned in the pre-store fetch. Boolean */*
quorumConfiguration Optional. The specific quorum configuration to use for the operation. QuorumConfiguration */*
resolver Optional. The ConflictResolver to use on any sibling results returned from the fetch (and store if returnBody is true). ConflictResolver<IRiakObject> */*
mutation Optional. If provided, the current message payload is disregard and the Mutation is applied to generate the data to store. Mutation<IRiakObject> */*
value The current message payload to store, auto-transformed into bytes[] if needed, or stored as-is if it's a IRiakObject. Object */*
muleEvent The current MuleEvent. MuleEvent */*
Returns
Return Type Description
byte[] the byte[] representing the stored value if returnBody is true, null if returnBody is false.
Exception Payloads
Payload ClassDescription
RiakRetryFailedException thrown if the operation can't succeed.
MuleException thrown if the operation can't succeed.

<riak:update-bucket>

Update a bucket using the provided name.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
bucketName The name of the new bucket. String */* UTF-8
allowSiblings false Optional. Should the bucket have allow_mult set to true? boolean */*
backend Optional. Which backend this bucket uses. Not supported by the Protobuf API. String */* UTF-8
enableSearch false Optional. To enable or disable search and related commit hooks (support for both pre-1.0 and 1.0 search). Not supported by the Protobuf API. boolean */*
lastWriteWins Optional. Set this bucket last_write_wins. Not supported by the Protobuf API. Boolean */*
notFoundOK Optional. Default notfound_ok value. Not supported by the Protobuf API. Boolean */*
nVal 3 Optional. The n_val for this bucket. int */*
smallVClock Optional. The small_vclock prune size. Not supported by the Protobuf API. Integer */*
bigVClock Optional. The big_vclock prune size. Not supported by the Protobuf API. Integer */*
oldVClock Optional. The old_vclock prune age. Not supported by the Protobuf API. Long */*
youngVClock Optional. The young_vclock prune age. Not supported by the Protobuf API. Long */*
chashKeyFunction Optional. Erlang function names to be used as the chash_key_fun. Not supported by the Protobuf API. FunctionConfiguration */*
linkWalkFunction Optional. Erlang function names to be used as the link_walk_fun. Not supported by the Protobuf API. FunctionConfiguration */*
quorumConfiguration Optional. The specific quorum configuration to use for the operation. QuorumConfiguration */*
Child Elements
NameDefault ValueDescriptionJava Type
<riak:pre-commit-hooks> Optional. Erlang or JavaScript function names to be used as pre-commit hooks. Not supported by the Protobuf API. List<FunctionConfiguration>
<riak:post-commit-hooks> Optional. Erlang function names to be used as post-commit hooks. Not supported by the Protobuf API. List<FunctionConfiguration>
Returns
Return Type Description
Bucket the newly created Bucket.
Exception Payloads
Payload ClassDescription
RiakRetryFailedException thrown if the operation can't succeed.

<riak:walk>

Walks the provided links starting at the object defined by the specified key and bucket name.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
bucketName The name of the bucket to fetch from. String */* UTF-8
key The key at which the data must be stored. String */* UTF-8
Child Elements
NameDefault ValueDescriptionJava Type
<riak:link-walks> The links that must be walked. List<LinkWalkStepConfiguration>
Returns
Return Type Description
WalkResult the WalkResult.
Exception Payloads
Payload ClassDescription
RiakException thrown if the operation can't succeed.

Message Sources

Transformers