Closed mogadanez closed 8 years ago
You should be able to use removeNode
followed by addNode
using your updated node configuration. Does this not work as expected?
yes, but it require me to store and manage list of nodes in parallel.
so when I get new nodes list, I need compare this list with current nodes inside
client.getRiakCluster().nodes
and make decision which nodes is new, and which is old and should be removed. Also when calling addNode I need construct node manual, but on initial client creation I just provided string array in Riak.Client([])
As for me such code can be bundled inside, since it pretty common.
Based on your need to dynamically modify the nodes you're using, I recommend building the RiakNode
objects yourself, passing them to the RiakCluster
constructor, and using that RiakCluster
object as the argument to the client constructor. That way you will have the exact same list of nodes to manage as the Client
object, and can use the removeNode
and addNode
methods from then on.
Updating a RiakNode
while it is running is not trivial to implement, which is why none of the Riak client libraries support this feature.
now RiakCluster have methods
addNode
andremoveNode
it will be nice to haveupdateNodes
methoduse case: when cluster configuration is updated and I receive some notification event i want update client without restarting application.