bin/hbase | 5 +++-- bin/hbase-cleanup.sh | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bin/hbase b/bin/hbase index 5c1352d..90dda24 100755 --- a/bin/hbase +++ b/bin/hbase @@ -564,16 +564,17 @@ elif [ "$COMMAND" = "zookeeper" ] ; then fi elif [ "$COMMAND" = "clean" ] ; then case $1 in - --cleanZk|--cleanHdfs|--cleanAll) + --cleanZk|--cleanHdfs|--cleanAll|--cleanAcls) matches="yes" ;; *) ;; esac if [ $# -ne 1 -o "$matches" = "" ]; then - echo "Usage: hbase clean (--cleanZk|--cleanHdfs|--cleanAll)" + echo "Usage: hbase clean (--cleanZk|--cleanHdfs|--cleanAll|--cleanAcls)" echo "Options: " echo " --cleanZk cleans hbase related data from zookeeper." echo " --cleanHdfs cleans hbase related data from hdfs." echo " --cleanAll cleans hbase related data from both zookeeper and hdfs." + echo " --cleanAcls cleans hbase acl related data in zookeeper." exit 1; fi "$bin"/hbase-cleanup.sh --config ${HBASE_CONF_DIR} $@ diff --git a/bin/hbase-cleanup.sh b/bin/hbase-cleanup.sh index 3a764df..8925fb1 100755 --- a/bin/hbase-cleanup.sh +++ b/bin/hbase-cleanup.sh @@ -57,6 +57,9 @@ if [ "$zparent" == "null" ]; then zparent="/hbase"; fi hrootdir=`$bin/hbase org.apache.hadoop.hbase.util.HBaseConfTool hbase.rootdir` if [ "$hrootdir" == "null" ]; then hrootdir="file:///tmp/hbase-${USER}/hbase"; fi +hwaldir=`$bin/hbase org.apache.hadoop.hbase.util.HBaseConfTool hbase.wal.dir` +if [ "$hwaldir" != "null" ]; then hrootdir="$hrootdir $hwaldir"; fi + check_for_znodes() { command=$1; case $command in @@ -98,13 +101,13 @@ execute_clean_acls() { clean_up() { case $1 in --cleanZk) - execute_zk_command "rmr ${zparent}"; + execute_zk_command "deleteall ${zparent}"; ;; --cleanHdfs) execute_hdfs_command "-rm -R ${hrootdir}" ;; --cleanAll) - execute_zk_command "rmr ${zparent}"; + execute_zk_command "deleteall ${zparent}"; execute_hdfs_command "-rm -R ${hrootdir}" ;; --cleanAcls)