Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make command callbacks only run on local node #8

Open
andrewjstone opened this issue Dec 4, 2014 · 1 comment
Open

Make command callbacks only run on local node #8

andrewjstone opened this issue Dec 4, 2014 · 1 comment

Comments

@andrewjstone
Copy link
Contributor

When using the set command the registered callback will be called on local or remote nodes automatically depending upon the --node and --all flags. Right now however, command callbacks must do the cross node calls themselves instead of being told where to run. Make this more inline with set and call the functions in the right locations automatically.

@andrewjstone andrewjstone self-assigned this Dec 4, 2014
@andrewjstone
Copy link
Contributor Author

After thinking about this more I think it's overkill, (at least for now). Most commands are status which show summary information and require contacting multiple nodes. Sometimes there is interest for info on a given node, but this still may require using cluster metadata or rpc-ing all nodes as is currently done in riak-admin handoff status. In this case running a callback function only on the given node is actually the wrong thing to do. Therefore we must maintain 2 ways to register commands which seems to unnecessarily complicate thing.

As some commands will want to contact a given node or all nodes, the functions are exported already from riak_cli_nodes to find all nodes and contact a given node via rpc.

As another 'intermediate' step I created a PR that includes a riak_cli_typecast module that will build up a library of usable functions that can be used to simplify command registration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant