Skip to content

Commit

Permalink
[FEA] Fix empty softwareProperties field in worker_info.yaml file for…
Browse files Browse the repository at this point in the history
… profiling tool (#623)

* fixed null softwareProperties issue for clusterProperties

Signed-off-by: cindyyuanjiang <[email protected]>

* refactored code

Signed-off-by: cindyyuanjiang <[email protected]>

* added lod info for empty softwareProperties

Signed-off-by: cindyyuanjiang <[email protected]>

---------

Signed-off-by: cindyyuanjiang <[email protected]>
  • Loading branch information
cindyyuanjiang authored Oct 23, 2023
1 parent c3d34df commit 68be7cb
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,12 @@ 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 loadedClusterProps = yamlObjNested.load(clusterProps).asInstanceOf[ClusterProperties]
if (loadedClusterProps != null && loadedClusterProps.softwareProperties == null) {
logInfo("softwareProperties is empty from input worker_info file")
loadedClusterProps.softwareProperties = new util.LinkedHashMap[String, String]()
}
Option(loadedClusterProps)
}

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

0 comments on commit 68be7cb

Please sign in to comment.