1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
package parallelai.spyglass.hbase.testing
import parallelai.spyglass.base.JobRunner
import com.twitter.scalding.Args
import org.apache.log4j.{Level, Logger}
object HBaseSaltTesterRunner extends App {
// if( args.length < 2 ) { throw new Exception("Not enough Args")}
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 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) )
val quorum = System.getenv("BIGDATA_QUORUM_NAMES")
assert (quorum != null, {"Environment Variable BIGDATA_QUORUM_NAMES is undefined or Null"})
println( "Quorum is [%s]".format(quorum) )
val mArgs = Args(args) // get ("make-data")
val make = mArgs.getOrElse("make.data", "false").toBoolean
val test = mArgs.getOrElse("test.data", "false").toBoolean
val delete = mArgs.getOrElse("delete.data", "false").toBoolean
val isDebug = mArgs.getOrElse("debug", "false").toBoolean
if( isDebug ) { Logger.getRootLogger.setLevel(Level.DEBUG) }
if( make ) {
JobRunner.main((List(classOf[HBaseSaltTestSetup].getName,
"--hdfs",
"--app.conf.path", appPath,
"--job.lib.path", jobLibPath,
"--quorum", quorum,
"--debug", isDebug.toString
) ::: mArgs.toList).toArray)
}
if( test ) {
JobRunner.main((List(classOf[HBaseSaltTester].getName,
"--hdfs",
"--app.conf.path", appPath,
"--job.lib.path", jobLibPath,
"--quorum", quorum,
"--debug", isDebug.toString,
"--regional", mArgs.getOrElse("regional", "false")
)::: mArgs.toList).toArray)
}
if( delete ) {
JobRunner.main((List(classOf[HBaseSaltTestShutdown].getName,
"--hdfs",
"--app.conf.path", appPath,
"--job.lib.path", jobLibPath,
"--quorum", quorum,
"--debug", isDebug.toString
)::: mArgs.toList).toArray)
}
}
|