Skip to content

Instantly share code, notes, and snippets.

@pwasiewi
Forked from manku-timma/Config.scala
Created November 8, 2020 11:32
Show Gist options
  • Save pwasiewi/ad16c727ff3b9adebe4584225cda848f to your computer and use it in GitHub Desktop.
Save pwasiewi/ad16c727ff3b9adebe4584225cda848f to your computer and use it in GitHub Desktop.
Scala program to print all properties of a hadoop config
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