HBASE-16044 Fix 'hbase shell' output parsing in graceful_stop.sh

Change-Id: I94b2f665105837d31281be66d620b6152c3bc9d1
This commit is contained in:
Apekshit Sharma 2016-06-28 16:55:09 -07:00
parent 3b5fbf8d73
commit a396ae773a
4 changed files with 8 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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