public static class RiakCluster.Builder extends Object
RiakCluster instances.| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_EXECUTION_ATTEMPTS |
| Constructor and Description |
|---|
RiakCluster.Builder(List<RiakNode> riakNodes)
Instantiate a Builder containing the supplied
RiakNodes |
RiakCluster.Builder(RiakNode node)
Instantiate a Builder containing a single
RiakNode |
| Modifier and Type | Method and Description |
|---|---|
RiakCluster |
build()
Instantiates the
RiakCluster |
RiakCluster.Builder |
withBootstrap(io.netty.bootstrap.Bootstrap bootstrap)
The Netty
Bootstrap this cluster will use. |
RiakCluster.Builder |
withExecutionAttempts(int numberOfAttempts)
Sets the number of times the
RiakCluster will attempt an
operation before returning it as failed. |
RiakCluster.Builder |
withExecutor(ScheduledExecutorService executor)
Sets the Threadpool for this cluster.
|
RiakCluster.Builder |
withNodeManager(NodeManager nodeManager)
|
public static final int DEFAULT_EXECUTION_ATTEMPTS
public RiakCluster.Builder(List<RiakNode> riakNodes)
RiakNodesriakNodes - - a List of unstarted RiakNode objectspublic RiakCluster.Builder withExecutionAttempts(int numberOfAttempts)
RiakCluster will attempt an
operation before returning it as failed.numberOfAttempts - public RiakCluster.Builder withNodeManager(NodeManager nodeManager)
nodeManager - public RiakCluster.Builder withExecutor(ScheduledExecutorService executor)
RiakNodes.
At the very least it needs to have
two threads available. It is not necessary to supply your own as the
RiakCluster will instantiate one upon construction if this is
not asSet.executor - public RiakCluster.Builder withBootstrap(io.netty.bootstrap.Bootstrap bootstrap)
Bootstrap this cluster will use.
This Bootstrap is passed down to the RiakNodes.
It is not necessary to supply your
own as the RiakCluster will instantiate one upon construction
if this is not asSet.bootstrap - public RiakCluster build() throws UnknownHostException
RiakClusterUnknownHostException - if a node fails to start due to a DNS lookupCopyright © 2015. All rights reserved.