Created
January 19, 2015 13:45
-
-
Save manku-timma/c6afc68c88df4895eecd to your computer and use it in GitHub Desktop.
Scala program to print all properties of a hadoop config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.hadoop.conf.Configured | |
import org.apache.hadoop.util.Tool | |
import org.apache.hadoop.util.ToolRunner | |
import scala.collection.JavaConversions._ | |
object Config extends Configured with Tool { | |
def run(args: Array[String]) : Int = { | |
getConf.map(x => (x.getKey, x.getValue)).toList.sorted.foreach(println) | |
return 0 | |
} | |
def main(args: Array[String]) { ToolRunner.run(Config, args) } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Shell script to run this
CLASS=$1
software/scala-2.10.4/bin/scalac
-cp $(/usr/lib/hadoop2/bin/hadoop classpath)
$CLASS.scala &&
jar cf $CLASS.jar *.class &&
~/src/spark-2/bin/spark-submit --class $CLASS $CLASS.jar