Skip to content

Commit

Permalink
refactored code
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 3582fb7 commit 5d60350
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1035,11 +1035,11 @@ object AutoTuner extends Logging {
representer.getPropertyUtils.setSkipMissingProperties(true)
val constructor = new Constructor(classOf[ClusterProperties], new LoaderOptions())
val yamlObjNested = new Yaml(constructor, representer)
val clusterPropsOpt = Option(yamlObjNested.load(clusterProps).asInstanceOf[ClusterProperties])
if (clusterPropsOpt.isDefined && clusterPropsOpt.get.softwareProperties == null) {
clusterPropsOpt.get.softwareProperties = new util.LinkedHashMap[String, String]()
val loadedClusterProps = yamlObjNested.load(clusterProps).asInstanceOf[ClusterProperties]
if (loadedClusterProps != null && loadedClusterProps.softwareProperties == null) {
loadedClusterProps.softwareProperties = new util.LinkedHashMap[String, String]()
}
clusterPropsOpt
Option(loadedClusterProps)
}

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

0 comments on commit 5d60350

Please sign in to comment.