Skip to content

Commit

Permalink
[SPARK-7357] Improving HBaseTest example
Browse files Browse the repository at this point in the history
Author: Jihong MA <[email protected]>

Closes apache#5904 from JihongMA/SPARK-7357 and squashes the following commits:

7d6153a [Jihong MA] SPARK-7357 Improving HBaseTest example
JihongMA authored and srowen committed May 5, 2015
1 parent 4222da6 commit 51f4620
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions examples/src/main/scala/org/apache/spark/examples/HBaseTest.scala
Original file line number Diff line number Diff line change
@@ -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))

0 comments on commit 51f4620

Please sign in to comment.