Client Class
A Class that represents a Riak client.
The client constructor accepts a RiakCluster, or a list of host[:port] from which it will create a RiakCluster using our default configuration.
var Riak = require('basho-riak-client');
var client = new Riak.Client(['192.168.1.1:8087', '192.168.1.2:8087']);
Two styles of use are supported. Each command you can send to Riak is a class and can be instantiated then executed by the client's execute() method. In addition, convenience methods are provided directly by the Client class that corrispond to each of the commands.
// Using the builder, but options can also be passed directly to the constructor
var fetch = new KV.FetchValue.Builder() 
             .withBucket('myBucket')
             .withKey('myKey')
             .withCallback(callback)
             .build();
             
client.execute(fetch);
or
client.fetchValue({ bucket: 'myBucket', key: 'myKey' }, callback);
All command callbacks are the typical node.js function(err, resp) style.
Constructor
Client
        - 
                        cluster
- 
                        [callback]
Parameters:
- 
                        clusterString | RiakCluster- either an array of host[:port] strings or the cluster to use. See RiakCluster.
 
- 
                        [callback]Function optional- called when cluster is started (optional)
 - 
                                    [err]Object optional- set to an error if one occurrs during start.
 
- 
                                    [client]Object optional- the client object.
 
- 
                                    [cluster]Object optional- the cluster object.
 
 
Item Index
Methods
- deleteIndex
- deleteValue
- execute
- fetchBucketProps
- fetchBucketTypeProps
- fetchCounter
- fetchIndex
- fetchMap
- fetchPreflist
- fetchSchema
- fetchSet
- fetchValue
- getRiakCluster
- ListBuckets
- listKeys
- mapReduce
- ping
- resetBucketProps
- search
- secondaryIndexQuery
- shutdown
- stop
- storeBucketProps
- storeBucketTypeProps
- storeIndex
- storeSchema
- storeValue
- tsDelete
- tsDescribe
- tsGet
- tsListKeys
- tsQuery
- tsStore
- updateCounter
- updateMap
- updateSet
Methods
deleteIndex
        - 
                        options
- 
                        callback
See DeleteIndex
Parameters:
- 
                        optionsObjectThe options for this operation. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
deleteValue
        - 
                        options
- 
                        callback
See DeleteValue
Parameters:
- 
                        optionsObjectThe options for this operation. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
execute
        - 
                        command
Parameters:
- 
                        commandObjectAny Riak command object from the various modules. 
fetchBucketProps
        - 
                        options
- 
                        callback
See FetchBucketProps
Parameters:
- 
                        optionsObjectThe options for this operation. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
fetchBucketTypeProps
        - 
                        options
- 
                        callback
Parameters:
- 
                        optionsObjectThe options for this operation. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
fetchCounter
        - 
                        options
- 
                        callback
See FetchCounter
Parameters:
- 
                        optionsObjectThe options for this operation. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
fetchIndex
        - 
                        options
- 
                        callback
See FetchIndex
Parameters:
- 
                        optionsObjectThe options for this operation. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
fetchMap
        - 
                        options
- 
                        callback
See FetchMap
Parameters:
- 
                        optionsObjectThe options for this operation. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
fetchPreflist
        - 
                        options
- 
                        callback
See FetchPreflist
Parameters:
- 
                        optionsObjectThe options for this operation. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
fetchSchema
        - 
                        options
- 
                        callback
See FetchSchema
Parameters:
- 
                        optionsObjectThe options for this operation. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
fetchSet
        - 
                        options
- 
                        callback
See FetchSet
Parameters:
- 
                        optionsObjectThe options for this operation. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
fetchValue
        - 
                        options
- 
                        callback
See FetchValue
Parameters:
- 
                        optionsObjectThe options for this operation. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
getRiakCluster
        ()
        
            Core.RiakCluster
        
    
    Get the client's RiakCluster.
Returns:
ListBuckets
        - 
                        options
- 
                        callback
See ListBuckets
Parameters:
- 
                        optionsObjectThe options for this operation. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
listKeys
        - 
                        options
- 
                        callback
See ListKeys
Parameters:
- 
                        optionsObjectThe options for this operation. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
mapReduce
        - 
                        query
- 
                        callback
- 
                        [stream=true]
See MapReduce
Parameters:
- 
                        queryStringThe map-reduce query. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
- 
                        [stream=true]Boolean optionalStream the results or accumulate before calling callback. 
ping
        - 
                        callback
See Ping
Parameters:
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
resetBucketProps
        - 
                        options
- 
                        callback
See ResetBucketProps
Parameters:
- 
                        optionsObjectThe options for this operation. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
search
        - 
                        options
- 
                        callback
See Search
Parameters:
- 
                        optionsObjectThe options for this operation. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
secondaryIndexQuery
        - 
                        options
- 
                        callback
Parameters:
- 
                        optionsObjectThe options for this operation. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
shutdown
        - 
                        callback
Shut down the client gracefully.
This will cause all connections to be closed and any remaining in-flight commands to finish.
The provided callback will be added as a stateChange listener to the client's RiakCluster.
Parameters:
- 
                        callbackFunction- will be registered as a stateChange listener on the RiakCluster.
 
stop
        - 
                        callback
Stop the client gracefully.
This will cause all connections to be closed and any remaining in-flight commands to finish.
The provided callback will be called when the client is completely stopped.
Parameters:
- 
                        callbackFunction- will be called when client is stopped.
 - 
                                    [err]Object optional- set to an error if one occurrs during stop.
 
- 
                                    [state]Object optional- the state of the cluster at shutdown.
 
 
storeBucketProps
        - 
                        options
- 
                        callback
See StoreBucketProps
Parameters:
- 
                        optionsObjectThe options for this operation. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
storeBucketTypeProps
        - 
                        options
- 
                        callback
Parameters:
- 
                        optionsObjectThe options for this operation. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
storeIndex
        - 
                        options
- 
                        callback
See StoreIndex
Parameters:
- 
                        optionsObjectThe options for this operation. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
storeSchema
        - 
                        options
- 
                        callback
See StoreSchema
Parameters:
- 
                        optionsObjectThe options for this operation. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
storeValue
        - 
                        options
- 
                        callback
See StoreValue
Parameters:
- 
                        optionsObjectThe options for this operation. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
tsDelete
        - 
                        options
- 
                        callback
See Delete
Parameters:
- 
                        optionsObjectThe options for this operation. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
tsDescribe
        - 
                        options
- 
                        callback
See Describe
Parameters:
- 
                        optionsObjectThe options for this operation. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
tsGet
        - 
                        options
- 
                        callback
See Get
Parameters:
- 
                        optionsObjectThe options for this operation. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
tsListKeys
        - 
                        options
- 
                        callback
See ListKeys
Parameters:
- 
                        optionsObjectThe options for this operation. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
tsQuery
        - 
                        options
- 
                        callback
See Query
Parameters:
- 
                        optionsObjectThe options for this operation. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
tsStore
        - 
                        options
- 
                        callback
See Store
Parameters:
- 
                        optionsObjectThe options for this operation. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
updateCounter
        - 
                        options
- 
                        callback
See UpdateCounter
Parameters:
- 
                        optionsObjectThe options for this operation. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
updateMap
        - 
                        options
- 
                        callback
See UpdateMap
Parameters:
- 
                        optionsObjectThe options for this operation. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
updateSet
        - 
                        options
- 
                        callback
See UpdateSet
Parameters:
- 
                        optionsObjectThe options for this operation. 
- 
                        callbackFunctionThe callback to be executed when the operation completes. 
