Repository: spark Updated Branches: refs/heads/master 4222da68d -> 51f462003
[SPARK-7357] Improving HBaseTest example Author: Jihong MA <[email protected]> Closes #5904 from JihongMA/SPARK-7357 and squashes the following commits: 7d6153a [Jihong MA] SPARK-7357 Improving HBaseTest example Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/51f46200 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/51f46200 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/51f46200 Branch: refs/heads/master Commit: 51f462003b416eac92feb5a6725f6c2994389010 Parents: 4222da6 Author: Jihong MA <[email protected]> Authored: Tue May 5 12:40:41 2015 +0100 Committer: Sean Owen <[email protected]> Committed: Tue May 5 12:40:41 2015 +0100 ---------------------------------------------------------------------- .../scala/org/apache/spark/examples/HBaseTest.scala | 12 ++++++++++++ 1 file changed, 12 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/51f46200/examples/src/main/scala/org/apache/spark/examples/HBaseTest.scala ---------------------------------------------------------------------- diff --git a/examples/src/main/scala/org/apache/spark/examples/HBaseTest.scala b/examples/src/main/scala/org/apache/spark/examples/HBaseTest.scala index f4684b4..849887d 100644 --- a/examples/src/main/scala/org/apache/spark/examples/HBaseTest.scala +++ b/examples/src/main/scala/org/apache/spark/examples/HBaseTest.scala @@ -28,7 +28,19 @@ object HBaseTest { def main(args: Array[String]) { val sparkConf = new SparkConf().setAppName("HBaseTest") val sc = new SparkContext(sparkConf) + + // please ensure HBASE_CONF_DIR is on classpath of spark driver + // e.g: set it through spark.driver.extraClassPath property + // in spark-defaults.conf or through --driver-class-path + // command line option of spark-submit + val conf = HBaseConfiguration.create() + + if (args.length < 1) { + System.err.println("Usage: HBaseTest <table_name>") + System.exit(1) + } + // Other options for configuring scan behavior are available. More information available at // http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/mapreduce/TableInputFormat.html conf.set(TableInputFormat.INPUT_TABLE, args(0)) --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
