HBASE-16044 Fix 'hbase shell' output parsing in graceful_stop.sh
Change-Id: I94b2f665105837d31281be66d620b6152c3bc9d1
This commit is contained in:
parent
3b5fbf8d73
commit
a396ae773a
|
@ -106,7 +106,7 @@ if [ "$nob" == "true" ]; then
|
|||
HBASE_BALANCER_STATE=false
|
||||
else
|
||||
log "Disabling load balancer"
|
||||
HBASE_BALANCER_STATE=$(echo 'balance_switch false' | "$bin"/hbase --config "${HBASE_CONF_DIR}" shell | tail -3 | head -1)
|
||||
HBASE_BALANCER_STATE=$(echo 'balance_switch false' | "$bin"/hbase --config "${HBASE_CONF_DIR}" shell -n | tail -1)
|
||||
log "Previous balancer state was $HBASE_BALANCER_STATE"
|
||||
fi
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@ else
|
|||
zkrs="$zparent/$zkrs"
|
||||
online_regionservers=`$bin/hbase zkcli ls $zkrs 2>&1 | tail -1 | sed "s/\[//" | sed "s/\]//"`
|
||||
echo "Disabling load balancer"
|
||||
HBASE_BALANCER_STATE=$(echo 'balance_switch false' | "$bin"/hbase --config "${HBASE_CONF_DIR}" shell | tail -3 | head -1)
|
||||
HBASE_BALANCER_STATE=$(echo 'balance_switch false' | "$bin"/hbase --config "${HBASE_CONF_DIR}" shell -n | tail -1)
|
||||
echo "Previous balancer state was $HBASE_BALANCER_STATE"
|
||||
|
||||
for rs in $online_regionservers
|
||||
|
|
|
@ -31,7 +31,9 @@ EOF
|
|||
end
|
||||
|
||||
def command(enableDisable)
|
||||
formatter.row([admin.balance_switch(enableDisable)? "true" : "false"])
|
||||
prev_state = admin.balance_switch(enableDisable)? "true" : "false"
|
||||
formatter.row(["Previous balancer state : #{prev_state}"])
|
||||
prev_state
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -30,7 +30,9 @@ EOF
|
|||
end
|
||||
|
||||
def command()
|
||||
formatter.row([admin.balancer_enabled?.to_s])
|
||||
state = admin.balancer_enabled?
|
||||
formatter.row([state.to_s])
|
||||
state
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue