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
RiakNode s |
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)
RiakNode
sriakNodes
- - 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)
RiakNode
s.
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 RiakNode
s.
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
RiakCluster
UnknownHostException
- if a node fails to start due to a DNS lookupCopyright © 2014. All rights reserved.