public static class RiakCluster.Builder extends Object
RiakCluster
instances.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_EXECUTION_ATTEMPTS |
static int |
DEFAULT_OPERATION_QUEUE_DEPTH |
Constructor and Description |
---|
Builder(Collection<HostAndPort> remoteHosts,
RiakNode.Builder nodeBuilder)
Instantiate a Builder containing the
RiakNode s that will be build by using provided builder. |
Builder(List<RiakNode> riakNodes)
Instantiate a Builder containing the supplied
RiakNode s |
Builder(RiakNode.Builder nodeBuilder,
List<String> remoteAddresses)
Instantiate a Builder containing the
RiakNode s that will be build by using provided builder. |
Builder(RiakNode.Builder nodeBuilder,
String... remoteAddresses)
Instantiate a Builder containing the
RiakNode s that will be build by using provided builder. |
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)
|
RiakCluster.Builder |
withOperationQueueMaxDepth(int operationQueueMaxDepth)
Set the maximum number of operations to queue.
|
public static final int DEFAULT_EXECUTION_ATTEMPTS
public static final int DEFAULT_OPERATION_QUEUE_DEPTH
public Builder(List<RiakNode> riakNodes)
RiakNode
sriakNodes
- - a List of unstarted RiakNode objectspublic Builder(RiakNode.Builder nodeBuilder, List<String> remoteAddresses) throws UnknownHostException
RiakNode
s that will be build by using provided builder.
The RiakNode.Builder is used for setting common properties among the nodes.UnknownHostException
RiakNode.Builder.buildNodes(RiakNode.Builder, List)
public Builder(Collection<HostAndPort> remoteHosts, RiakNode.Builder nodeBuilder) throws UnknownHostException
RiakNode
s that will be build by using provided builder.
The RiakNode.Builder is used for setting common properties among the nodes.UnknownHostException
RiakNode.Builder.buildNodes(Collection, RiakNode.Builder)
public Builder(RiakNode.Builder nodeBuilder, String... remoteAddresses) throws UnknownHostException
RiakNode
s that will be build by using provided builder.
The RiakNode.Builder is used for setting common properties among the nodes.UnknownHostException
RiakNode.Builder.buildNodes(RiakNode.Builder, String...)
public 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.Builder withOperationQueueMaxDepth(int operationQueueMaxDepth)
Please note that while using the Operation Queue, operations may be executed out of the order that they were added in.
operationQueueMaxDepth
- - maximum number of operations to queue if all connections are busyDEFAULT_OPERATION_QUEUE_DEPTH
public RiakCluster build()
RiakCluster
Copyright © 2016. All rights reserved.