aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authortedyu <yuzhihong@gmail.com>2015-04-27 14:42:40 -0700
committerReynold Xin <rxin@databricks.com>2015-04-27 14:42:40 -0700
commitef82bddc11d1aea42e22d2f85613a869cbe9a990 (patch)
tree1aa1db989d20a6ce8884a3b281aff999669f8eee /examples
parent7078f6028bf012235c664b02ec3541cbb0a248a7 (diff)
downloadspark-ef82bddc11d1aea42e22d2f85613a869cbe9a990.tar.gz
spark-ef82bddc11d1aea42e22d2f85613a869cbe9a990.tar.bz2
spark-ef82bddc11d1aea42e22d2f85613a869cbe9a990.zip
SPARK-7107 Add parameter for zookeeper.znode.parent to hbase_inputformat...
....py Author: tedyu <yuzhihong@gmail.com> Closes #5673 from tedyu/master and squashes the following commits: ab7c72b [tedyu] SPARK-7107 Adjust indentation to pass Python style tests 6e25939 [tedyu] Adjust line length to be shorter than 100 characters 18d172a [tedyu] SPARK-7107 Add parameter for zookeeper.znode.parent to hbase_inputformat.py
Diffstat (limited to 'examples')
-rw-r--r--examples/src/main/python/hbase_inputformat.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/src/main/python/hbase_inputformat.py b/examples/src/main/python/hbase_inputformat.py
index e17819d5fe..5b82a14fba 100644
--- a/examples/src/main/python/hbase_inputformat.py
+++ b/examples/src/main/python/hbase_inputformat.py
@@ -54,8 +54,9 @@ if __name__ == "__main__":
Run with example jar:
./bin/spark-submit --driver-class-path /path/to/example/jar \
- /path/to/examples/hbase_inputformat.py <host> <table>
+ /path/to/examples/hbase_inputformat.py <host> <table> [<znode>]
Assumes you have some data in HBase already, running on <host>, in <table>
+ optionally, you can specify parent znode for your hbase cluster - <znode>
""", file=sys.stderr)
exit(-1)
@@ -64,6 +65,9 @@ if __name__ == "__main__":
sc = SparkContext(appName="HBaseInputFormat")
conf = {"hbase.zookeeper.quorum": host, "hbase.mapreduce.inputtable": table}
+ if len(sys.argv) > 3:
+ conf = {"hbase.zookeeper.quorum": host, "zookeeper.znode.parent": sys.argv[3],
+ "hbase.mapreduce.inputtable": table}
keyConv = "org.apache.spark.examples.pythonconverters.ImmutableBytesWritableToStringConverter"
valueConv = "org.apache.spark.examples.pythonconverters.HBaseResultToStringConverter"