basho/riak-go-client

Make creation of defaultNode optional [JIRA: CLIENTS-601]

Closed this issue · 8 comments

func optNodes(nodes []*Node) (rv []*Node, err error) {

makes a default Node that is not desireable for my use case. Is there any reason that creating a cluster with no nodes is not allowed?

Hi @IvanMalison -

I checked the Ruby client and Node.js clients and all create at least one node (the default) when a new cluster object is created. The Go client works in the same manner for consistency's sake.

Could you describe your use case? Could you delay creating the Cluster object until at least one Node is ready?

Could you describe your use case?
Just writing some code that monitors a file containing a hosts list and automatically updates the cluster whenever the file changes.

Could you delay creating the Cluster object until at least one Node is ready?

I COULD but it would make my code much messier because it would require me to make the cluster creation lazy.

I'm not even necessarily saying that creating the default node shouldn't be the default, but there should at least be some way to remove that node if you want (or shortcircuit its creation at the very least).

There is a RemoveNode method on the cluster.

func (c *Cluster) RemoveNode(n *Node) error {

There is a RemoveNode method on the cluster.

func (c *Cluster) RemoveNode(n *Node) error {

yep BUT you can't even get access to the default node because nodes is private.

@IvanMalison I'll get to work on this, stay tuned.

@IvanMalison you're all set, tagged as version 1.3

Great thanks!

Hey @IvanMalison - you've been really helpful around here of late. Would you mind sending me an email with an address? I'd love to send you some stickers as a thank you - mbrender /at/ basho.com