OK it turned up pretty simple once I established where to read the conf
file in yarn mode and get the values for different keys
val dbHost = conf.getString("dbHost")
val dbPort = conf.getString("dbPort")
val dbConnection = conf.getString("dbConnection")
val namespace =
Many thanks Chris.
In my Spark streaming I would like to use the config file to read the
parameters in. Taking your example, I have
val globalConfig = ConfigFactory.load()
val conf = globalConfig.getConfig(sparkAppName) // extract out
top level key from top level namespace
This seems to work-
val printEntry = new
java.util.function.Consumer[java.util.Map.Entry[String,com.typesafe.config.ConfigValue]]
{
override def accept(a:
java.util.Map.Entry[String,com.typesafe.config.ConfigValue]): Unit = {
println(a.getKey)
}
}
Hi,
I have a config file application.conf that I am trying to read.
The skeleton code is as follows:
```
import com.typesafe.config.ConfigFactory
import scala.collection.JavaConverters
def main(args: Array[String]): Unit = {
val globalConfig = ConfigFactory.load() // pass in filename