SteNicholas commented on code in PR #3477:
URL: https://github.com/apache/celeborn/pull/3477#discussion_r2354117636
##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/storage/StorageManager.scala:
##########
@@ -773,21 +773,30 @@ final private[worker] class StorageManager(conf:
CelebornConf, workerSource: Abs
false
}
}
-
- val dfsCleaned = hadoopFs match {
- case dfs: FileSystem =>
- val dfsDir = if (hasHDFSStorage) hdfsDir else if (hasOssStorage)
ossDir else s3Dir
- val dfsWorkPath = new Path(dfsDir, conf.workerWorkingDir)
- // DFS path not exist when first time initialize
- if (dfs.exists(dfsWorkPath)) {
- !dfs.listFiles(dfsWorkPath, false).hasNext
- } else {
- true
+ val dfsCleaned = hadoopFs == null || hadoopFs.asScala.forall {
+ case (storageType, fs) =>
+ val dfsDir =
+ if (storageType == StorageInfo.Type.HDFS)
+ hdfsDir
+ else if (storageType == StorageInfo.Type.OSS) ossDir
+ else s3Dir
+ try {
+ val dfsWorkPath = new Path(dfsDir, conf.workerWorkingDir)
+ // DFS path not exist when first time initialize
+ if (fs.exists(dfsWorkPath)) {
Review Comment:
```suggestion
!fs.exists(dfsWorkPath) || !fs.listFiles(dfsWorkPath,
false).hasNext
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]