SteNicholas commented on code in PR #3562:
URL: https://github.com/apache/celeborn/pull/3562#discussion_r2645220334
##########
common/src/main/scala/org/apache/celeborn/common/util/PbSerDeUtils.scala:
##########
@@ -114,12 +114,41 @@ object PbSerDeUtils {
fileMeta.setIsWriterClosed(true)
fileMeta
}
- new DiskFileInfo(
- userIdentifier,
- pbFileInfo.getPartitionSplitEnabled,
- meta,
- pbFileInfo.getFilePath,
- pbFileInfo.getBytesFlushed)
+ if (pbFileInfo.getStorageType != 0) {
Review Comment:
Could you simplify this implementation for better readability like following?
```
var storageType: StorageInfo.Type = null
if (pbFileInfo.getStorageType == 0) {
if (Utils.isHdfsPath(pbFileInfo.getFilePath)) {
storageType = StorageInfo.Type.HDFS
} else if (Utils.isOssPath(pbFileInfo.getFilePath)) {
storageType = StorageInfo.Type.OSS
} else if (Utils.isS3Path(pbFileInfo.getFilePath)) {
storageType = StorageInfo.Type.S3
}
} else {
storageType = StorageInfo.typesMap.get(pbFileInfo.getStorageType)
}
if (storageType != null) {
new DiskFileInfo(userIdentifier,
pbFileInfo.getPartitionSplitEnabled,
meta,
pbFileInfo.getFilePath,
storageType,
pbFileInfo.getBytesFlushed)
} else {
new DiskFileInfo(userIdentifier,
pbFileInfo.getPartitionSplitEnabled,
meta,
pbFileInfo.getFilePath,
pbFileInfo.getBytesFlushed)
}
```
--
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]