API Docs for: 2.2.2
Show:

RiakCluster.Builder Class

Module: Core

A Builder for constructing RiakCluster instances.

Rather than having to manually construct the options and instantiating a RiakCluster directly, this builder may be used.

var newCluster = new RiakCluster.Builder().withRiakNodes([node1, node2]).build();

Constructor

RiakCluster.Builder

()

Methods

build

() RiakCluster

Builds a RiakCluster instance.

Returns:

withExecutionAttempts

(
  • numAttempts
)
RiakCluster.Builder

Set the number of times a command will be attempted. In the case of a command failing for any reason, it will be retried on a different node.

Parameters:

  • numAttempts Number
    • the number of times to attempt a command (default: 3)

withNodeManager

(
  • nodeManager
)
chainable

Set the NodeManager for this cluster.

If not provided the RoundRobinNodeManager is used.

Parameters:

  • nodeManager NodeManager

    the node manager used to select nodes.

withQueueCommands

(
  • [maxDepth=unlimited]
  • [submitInterval=500]
)
chainable

Set whether to queue commands or not if no RiakNodes are available.

If all nodes are down (health checking) or maxConnections are in use on all nodes, the default behavior is to fail commands when submitted.

Setting this option causes the the RiakCluster to queue additional commands (FIFO) then send them when nodes/connections become available.

If maxDepth is supplied the queue is bounded and additional commands attempting to be queued will be failed. The default is an unbounded queue.

Parameters:

  • [maxDepth=unlimited] Number optional

    the maximum number of commands to queue. Default is unlimited.

  • [submitInterval=500] Number optional

    The duration in milliseconds between queue submission attempts. Default is 500.

withRiakNodes

(
  • nodes
)
RiakCluster.Builder

The RiakNodes to use.

Parameters: