SLIDER-303 Enhance get-hbase-site.sh to obtain information about gateways

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

Branch: refs/heads/feature/SLIDER-149_Support_a_YARN_service_registry
Commit: a1bbf4dba7613ca2d8b0942ed2b3df3a8bebe17a
Parents: 66cbd37
Author: tedyu <yuzhih...@gmail.com>
Authored: Fri Aug 8 10:45:48 2014 -0700
Committer: tedyu <yuzhih...@gmail.com>
Committed: Fri Aug 8 10:45:48 2014 -0700

----------------------------------------------------------------------
 app-packages/hbase/get-hbase-site.sh | 26 +++++++++-----------------
 app-packages/hbase/links.py          | 15 +++++++++++++++
 2 files changed, 24 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/a1bbf4db/app-packages/hbase/get-hbase-site.sh
----------------------------------------------------------------------
diff --git a/app-packages/hbase/get-hbase-site.sh 
b/app-packages/hbase/get-hbase-site.sh
index 04f9d3d..5211d83 100755
--- a/app-packages/hbase/get-hbase-site.sh
+++ b/app-packages/hbase/get-hbase-site.sh
@@ -1,25 +1,17 @@
-# 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
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 #
-#     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.
-
 tuple=`slider status $1 | grep "info.am.web.url"`
+echo $tuple
 FS=":"
 url=`echo $tuple | awk '{split($0,array,": ")} END{print array[2]}'`
 url="${url%,}"
 url="${url%\"}"
 url="${url#\"}"
-url="${url}ws/v1/slider/publisher/slider/hbase-site.xml"
-curl -k -o hbase-site.dnld $url
+siteurl="${url}ws/v1/slider/publisher/slider/hbase-site.xml"
+curl -k -o hbase-site.dnld $siteurl
 grep -v 'hbase.tmp.dir' hbase-site.dnld > hbase-site.xml
+
+linksurl="${url}ws/v1/slider/publisher/slider/quicklinks"
+curl -k -o links.json $linksurl
+python $DIR/links.py
+#| sed -e 's/\/\///g' | awk 'BEGIN { FS = ":" } ; { print $2 }'

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/a1bbf4db/app-packages/hbase/links.py
----------------------------------------------------------------------
diff --git a/app-packages/hbase/links.py b/app-packages/hbase/links.py
new file mode 100644
index 0000000..c77e620
--- /dev/null
+++ b/app-packages/hbase/links.py
@@ -0,0 +1,15 @@
+from __future__ import print_function
+import logging
+import json
+
+file = open("links.json")
+links = json.load(file)
+file.close()
+if links.has_key("entries"):
+  entries = links["entries"]
+  if entries.has_key("org.apache.slider.hbase.rest"):
+    print("org.apache.slider.hbase.rest : %s" % 
entries["org.apache.slider.hbase.rest"])
+  if entries.has_key("org.apache.slider.hbase.thrift"):
+    print("org.apache.slider.hbase.thrift : %s" % 
entries["org.apache.slider.hbase.thrift"])
+  if entries.has_key("org.apache.slider.hbase.thrift2"):
+    print("org.apache.slider.hbase.thrift2 : %s" % 
entries["org.apache.slider.hbase.thrift2"])

Reply via email to