Conf is a class that holds data of configuration.
ConfigLoader loads configurations by using typesafe.com's config library.
ConfigLoader loads configurations by using typesafe.com's config library.
You should set the application environment, then ConfigLoad will read the configuration
file [app_env].conf in your resources directory.
Multiple solutions are possible to configure application environment:
-
Otherwise you can set the JVM property app.environment. For example, by adding -Dapp.environment=local in your command,
ConfigLoader will read the conf file local.conf
-
You can also create app.environment in the default configuration file (example: application.conf,
application.properties)
confPath with the name of you configuration file.
Then ConfigLoader will read directly the given fileThe priority of the above solution is:
configPath >> setAppEnv >> JVM property >> `app.environment` in default config file
If none of the above parameters are set, ConfigLoader will try to read its fallback configuration file
Configuration parameters: Spark documentation
Configuration parameters: Spark documentation
Conf is a class that holds data of configuration. Internally, Conf use a ConcurrentHashMap for saving the configuration arguments.
We can instantiate a Conf directly from a Scala Map or a Config from the typesafe config library.
We can also instantiate manually
Configuration arguments can be retrieved by calling the get() method. Conf provide also several implicit converters that handle the type conversion.
For example: