Skip to content

Commit

Permalink
fixed null softwareProperties issue for clusterProperties
Browse files Browse the repository at this point in the history
Signed-off-by: cindyyuanjiang <[email protected]>
  • Loading branch information
cindyyuanjiang committed Oct 19, 2023
1 parent 10f289c commit 3582fb7
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,11 @@ object AutoTuner extends Logging {
representer.getPropertyUtils.setSkipMissingProperties(true)
val constructor = new Constructor(classOf[ClusterProperties], new LoaderOptions())
val yamlObjNested = new Yaml(constructor, representer)
Option(yamlObjNested.load(clusterProps).asInstanceOf[ClusterProperties])
val clusterPropsOpt = Option(yamlObjNested.load(clusterProps).asInstanceOf[ClusterProperties])
if (clusterPropsOpt.isDefined && clusterPropsOpt.get.softwareProperties == null) {
clusterPropsOpt.get.softwareProperties = new util.LinkedHashMap[String, String]()
}
clusterPropsOpt
}

def loadClusterProps(filePath: String): Option[ClusterProperties] = {
Expand Down

0 comments on commit 3582fb7

Please sign in to comment.