You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@slider.apache.org by te...@apache.org on 2015/01/29 22:55:38 UTC

incubator-slider git commit: SLIDER-734 Add usage to app-packages/hbase/README.md, introduce shell script for the wrapper

Repository: incubator-slider
Updated Branches:
  refs/heads/develop 7e8903e36 -> 44b3bc0fb


SLIDER-734 Add usage to app-packages/hbase/README.md, introduce shell script for the wrapper


Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/44b3bc0f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/44b3bc0f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/44b3bc0f

Branch: refs/heads/develop
Commit: 44b3bc0fb5f00b303901e7c575965fca2bae6638
Parents: 7e8903e
Author: tedyu <yu...@gmail.com>
Authored: Thu Jan 29 13:55:09 2015 -0800
Committer: tedyu <yu...@gmail.com>
Committed: Thu Jan 29 13:55:09 2015 -0800

----------------------------------------------------------------------
 app-packages/hbase/README.md    | 15 ++++++++++
 app-packages/hbase/hbase-slider | 53 ++++++++++++++++++++++++++++++++++++
 2 files changed, 68 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/44b3bc0f/app-packages/hbase/README.md
----------------------------------------------------------------------
diff --git a/app-packages/hbase/README.md b/app-packages/hbase/README.md
index 04d3af9..ae9763b 100644
--- a/app-packages/hbase/README.md
+++ b/app-packages/hbase/README.md
@@ -88,3 +88,18 @@ A less descriptive file name can be specified with
 Verify the content using
 
     zip -Tv apache-slider-hbase-*.zip
+
+# Extracting an HBase Client
+
+The HBase app package provides scripts to assist in client interactions with
+an HBase instance running on Slider.  These can be extracted to the HBase bin directory as follows.
+
+    unzip slider-hbase-app-package*zip hbase-slider
+    unzip slider-hbase-app-package*zip hbase-wrapper.py
+
+The dir will then contain an HBase client that can be used
+to connect to the cluster.
+
+Example of command that invokes HBase shell is:
+
+    SLIDER_HOME=</path/to/slider> ./hbase-slider <clusterName>

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/44b3bc0f/app-packages/hbase/hbase-slider
----------------------------------------------------------------------
diff --git a/app-packages/hbase/hbase-slider b/app-packages/hbase/hbase-slider
new file mode 100644
index 0000000..d3e3268
--- /dev/null
+++ b/app-packages/hbase/hbase-slider
@@ -0,0 +1,53 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# Resolve links - $0 may be a softlink
+PRG="${0}"
+
+while [ -h "${PRG}" ]; do
+  ls=`ls -ld "${PRG}"`
+  link=`expr "$ls" : '.*-> \(.*\)$'`
+  if expr "$link" : '/.*' > /dev/null; then
+    PRG="$link"
+  else
+    PRG=`dirname "${PRG}"`/"$link"
+  fi
+done
+
+# find python >= 2.6
+if [ -a /usr/bin/python2.6 ]; then
+  PYTHON=/usr/bin/python2.6
+fi
+
+if [ -z "$PYTHON" ]; then
+  PYTHON=/usr/bin/python
+fi
+
+# check for version
+majversion=`$PYTHON -V 2>&1 | awk '{print $2}' | cut -d'.' -f1`
+minversion=`$PYTHON -V 2>&1 | awk '{print $2}' | cut -d'.' -f2`
+numversion=$(( 10 * $majversion + $minversion))
+if (( $numversion < 26 )); then
+  echo "Need python version > 2.6"
+  exit 1
+fi
+
+HBASE_SLIDER_BIN_DIR=`dirname ${PRG}`
+
+$PYTHON ${HBASE_SLIDER_BIN_DIR}/hbase-wrapper.py $@