diff options
author | cra14 <chandan.rajah2@bskyb.com> | 2013-04-26 12:47:12 +0100 |
---|---|---|
committer | cra14 <chandan.rajah2@bskyb.com> | 2013-04-26 12:47:12 +0100 |
commit | cbf6c2903bfd0a5fe528c54382ea791c45637ded (patch) | |
tree | 2ca67f31c4d0c1779c163cb48234e821616ec6e1 /src/main/scala/parallelai/spyglass/hbase/example/HBaseExampleRunner.scala | |
parent | d6d712287b2bcd74f0c5bbc3ecbb106741443d7c (diff) | |
download | SpyGlass-cbf6c2903bfd0a5fe528c54382ea791c45637ded.tar.gz SpyGlass-cbf6c2903bfd0a5fe528c54382ea791c45637ded.zip |
First public release of Spy Glass code base
Diffstat (limited to 'src/main/scala/parallelai/spyglass/hbase/example/HBaseExampleRunner.scala')
-rw-r--r-- | src/main/scala/parallelai/spyglass/hbase/example/HBaseExampleRunner.scala | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/main/scala/parallelai/spyglass/hbase/example/HBaseExampleRunner.scala b/src/main/scala/parallelai/spyglass/hbase/example/HBaseExampleRunner.scala new file mode 100644 index 0000000..d6b762e --- /dev/null +++ b/src/main/scala/parallelai/spyglass/hbase/example/HBaseExampleRunner.scala @@ -0,0 +1,34 @@ +package parallelai.spyglass.hbase.example + +import com.twitter.scalding.Tool +import org.joda.time.format.DateTimeFormat +import java.util.Formatter.DateTime + +object HBaseExampleRunner extends App { + val appPath = System.getenv("BIGDATA_APPCONF_PATH") + assert (appPath != null, {"Environment Variable BIGDATA_APPCONF_PATH is undefined or Null"}) + println( "Application Path is [%s]".format(appPath) ) + + val modeString = if( args.length == 0 ) { "--hdfs" } else { args(0) match { + case "hdfs" => "--hdfs" + case _ => "--local" + }} + + println(modeString) + + val jobLibPath = modeString match { + case "--hdfs" => { + val jobLibPath = System.getenv("BIGDATA_JOB_LIB_PATH") + assert (jobLibPath != null, {"Environment Variable BIGDATA_JOB_LIB_PATH is undefined or Null"}) + println( "Job Library Path Path is [%s]".format(jobLibPath) ) + jobLibPath + } + case _ => "" + } + + val output = "HBaseTest.%s.tsv" + + Tool.main(Array(classOf[HBaseExample].getName, modeString, "--app.conf.path", appPath, + "--output", output, "--debug", "true", "--job.lib.path", jobLibPath )) + +}
\ No newline at end of file |