Permalink
Browse files

Add transfer_limit to riak_admin and improve cluster commands

  • Loading branch information...
1 parent ffd78ad commit 86c4e15f8c45d70a569f28d314e2b9e802268294 @jtuple jtuple committed Jun 8, 2012
Showing with 16 additions and 5 deletions.
  1. +16 −5 rel/files/riak-admin
View
@@ -89,15 +89,15 @@ cluster_admin()
;;
leave)
if [ $# -eq 1 ]; then
- node=""
+ ensure_node_running
+ $NODETOOL rpc riak_core_console stage_leave
elif [ $# -eq 2 ]; then
- node="$2"
+ ensure_node_running
+ $NODETOOL rpc riak_core_console stage_leave "$2"
else
echo "Usage: $SCRIPT cluster leave [<node>]"
exit 1
fi
- ensure_node_running
- $NODETOOL rpc riak_core_console stage_leave "$node"
;;
force-remove)
if [ $# -ne 2 ]; then
@@ -569,12 +569,23 @@ case "$1" in
shift
cluster_admin "$@"
;;
+ transfer_limit)
@Vagabond

Vagabond Jun 8, 2012

Contributor

Why did you make it an underscore command? I think we're trying to switch to hyphen commands.

@jtuple

jtuple Jun 8, 2012

Contributor

This still needs to merge with the "underscore" / "hyphen" changes that were made in master anyway. AFAIK, that allows both "_" and "-". Wasn't sure which was used as the new default that the other was converted into. WIll deal with that when I deal with merge conflicts.

+ if [ $# -gt 3 ]; then
@Vagabond

Vagabond Jun 8, 2012

Contributor

If riak-admin transfer_limit is valid, shouldn't this be gt 2? Also how about an upper bound on the argument count?

@jtuple

jtuple Jun 8, 2012

Contributor

This is an upper bound. And the string "transfer_limit" is the first argument. 'transfer_limit' is 1, 'transfer_limit N' is 2, 'transfer_limit node N' is 3. Anything higher is failure, and usage printed.

@Vagabond

Vagabond Jun 8, 2012

Contributor

Oh right, my bad.

+ echo "Usage: $SCRIPT transfer_limit"
+ echo " $SCRIPT transfer_limit <limit>"
+ echo " $SCRIPT transfer_limit <node> <limit>"
+ exit
+ fi
+ ensure_node_running
+ shift
+ $NODETOOL rpc riak_core_console transfer_limit "$@"
+ ;;
*)
echo "Usage: $SCRIPT { cluster | join | leave | backup | restore | test | "
echo " reip | js_reload | erl_reload | wait-for-service | "
echo " ringready | transfers | force-remove | down | "
echo " cluster_info | member_status | ring_status | vnode-status |"
- echo " diag | status | "
+ echo " diag | status | transfer_limit | "
echo " top [-interval N] [-sort reductions|memory|msg_q} [-lines N]"
exit 1
;;

0 comments on commit 86c4e15

Please sign in to comment.