xianjingfeng commented on code in PR #2419:
URL: https://github.com/apache/uniffle/pull/2419#discussion_r2020352841
##########
storage/src/test/java/org/apache/uniffle/storage/common/DefaultStorageMediaProviderTest.java:
##########
@@ -40,7 +40,7 @@ public void testStorageProvider() {
StorageMedia.OBJECT_STORE,
provider.getStorageMediaFor("cos://bucket-name/b/path"));
// by default, the local file should report as HDD
- assertEquals(StorageMedia.HDD,
provider.getStorageMediaFor("/path/to/base/dir"));
+ assertEquals(StorageMedia.HDD,
provider.getStorageMediaFor("path/to/base/dir"));
assertEquals(StorageMedia.HDD,
provider.getStorageMediaFor("file:///path/to/a/dir"));
Review Comment:
I think the result of this line is correct, but the underlying logic is
wrong. Currently, if the path contains `file://`,
`DefaultStorageMediaProvider#getFileStore` will return null. I think the follow
line should be changed to
`URI uri = new URI(baseDir);`.
https://github.com/apache/uniffle/blob/76a4dcf76b41529dfda36569140c48c3f0554722/storage/src/main/java/org/apache/uniffle/storage/common/DefaultStorageMediaProvider.java#L65
And then this line should be changed as the follow.
```suggestion
assertEquals(provider.getStorageMediaFor("/")
provider.getStorageMediaFor("file:///path/to/a/dir"));
```
WDYT? @advancedxy @asalamon74
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]