我在 application.conf 中有以下内容,并试图找出定义我的类以加载配置的最佳方法:
allKeys {
mysql {
dev {
host = <host1>
user = <user1>
}
prod {
host = <host1>
user = <user1>
}
hdfs {
endpoint = <host1>
port = <port1>
}
}
my case classes:
case class Settings(mysql: DbSettings, hdfs: HdfsSettings)
case class DbSettings(host: String, user: String)
case class HdfsSettings(endpoint: String, port: String)
我在知道如何正确加载它时遇到问题,以便它在 hdfs 中查找类似键时不会失败。