yihua commented on code in PR #10672:
URL: https://github.com/apache/hudi/pull/10672#discussion_r1493061022


##########
hudi-hadoop-common/src/main/java/org/apache/hudi/storage/hadoop/HoodieHadoopStorage.java:
##########
@@ -60,108 +60,108 @@ public URI getUri() {
   }
 
   @Override
-  public OutputStream create(HoodieLocation location, boolean overwrite) 
throws IOException {
-    return fs.create(convertHoodieLocationToPath(location), overwrite);
+  public OutputStream create(StoragePath path, boolean overwrite) throws 
IOException {
+    return fs.create(convertToHadoopPath(path), overwrite);
   }
 
   @Override
-  public InputStream open(HoodieLocation location) throws IOException {
-    return fs.open(convertHoodieLocationToPath(location));
+  public InputStream open(StoragePath path) throws IOException {
+    return fs.open(convertToHadoopPath(path));
   }
 
   @Override
-  public OutputStream append(HoodieLocation location) throws IOException {
-    return fs.append(convertHoodieLocationToPath(location));
+  public OutputStream append(StoragePath path) throws IOException {
+    return fs.append(convertToHadoopPath(path));
   }
 
   @Override
-  public boolean exists(HoodieLocation location) throws IOException {
-    return fs.exists(convertHoodieLocationToPath(location));
+  public boolean exists(StoragePath path) throws IOException {
+    return fs.exists(convertToHadoopPath(path));
   }
 
   @Override
-  public HoodieFileStatus getFileStatus(HoodieLocation location) throws 
IOException {
-    return 
convertToHoodieFileStatus(fs.getFileStatus(convertHoodieLocationToPath(location)));
+  public StoragePathInfo getPathInfo(StoragePath path) throws IOException {
+    return 
convertToStoragePathInfo(fs.getFileStatus(convertToHadoopPath(path)));
   }
 
   @Override
-  public boolean createDirectory(HoodieLocation location) throws IOException {
-    return fs.mkdirs(convertHoodieLocationToPath(location));
+  public boolean createDirectory(StoragePath path) throws IOException {
+    return fs.mkdirs(convertToHadoopPath(path));
   }
 
   @Override
-  public List<HoodieFileStatus> listDirectEntries(HoodieLocation location) 
throws IOException {
-    return Arrays.stream(fs.listStatus(convertHoodieLocationToPath(location)))
-        .map(this::convertToHoodieFileStatus)
+  public List<StoragePathInfo> listDirectEntries(StoragePath path) throws 
IOException {
+    return Arrays.stream(fs.listStatus(convertToHadoopPath(path)))
+        .map(this::convertToStoragePathInfo)
         .collect(Collectors.toList());
   }
 
   @Override
-  public List<HoodieFileStatus> listFiles(HoodieLocation location) throws 
IOException {
-    List<HoodieFileStatus> result = new ArrayList<>();
-    RemoteIterator<LocatedFileStatus> iterator = 
fs.listFiles(convertHoodieLocationToPath(location), true);
+  public List<StoragePathInfo> listFiles(StoragePath path) throws IOException {
+    List<StoragePathInfo> result = new ArrayList<>();
+    RemoteIterator<LocatedFileStatus> iterator = 
fs.listFiles(convertToHadoopPath(path), true);
     while (iterator.hasNext()) {
-      result.add(convertToHoodieFileStatus(iterator.next()));
+      result.add(convertToStoragePathInfo(iterator.next()));
     }
     return result;
   }
 
   @Override
-  public List<HoodieFileStatus> listDirectEntries(List<HoodieLocation> 
locationList) throws IOException {
-    return Arrays.stream(fs.listStatus(locationList.stream()
-            .map(this::convertHoodieLocationToPath)
+  public List<StoragePathInfo> listDirectEntries(List<StoragePath> pathList) 
throws IOException {
+    return Arrays.stream(fs.listStatus(pathList.stream()
+            .map(this::convertToHadoopPath)
             .toArray(Path[]::new)))
-        .map(this::convertToHoodieFileStatus)
+        .map(this::convertToStoragePathInfo)
         .collect(Collectors.toList());
   }
 
   @Override
-  public List<HoodieFileStatus> listDirectEntries(HoodieLocation location,
-                                                  HoodieLocationFilter filter)
+  public List<StoragePathInfo> listDirectEntries(StoragePath path,
+                                                 StoragePathFilter filter)
       throws IOException {
     return Arrays.stream(fs.listStatus(
-            convertHoodieLocationToPath(location), path ->
-                filter.accept(convertPathToHoodieLocation(path))))
-        .map(this::convertToHoodieFileStatus)
+            convertToHadoopPath(path), e ->
+                filter.accept(convertToStoragePath(e))))
+        .map(this::convertToStoragePathInfo)
         .collect(Collectors.toList());
   }
 
   @Override
-  public List<HoodieFileStatus> globEntries(HoodieLocation locationPattern)
+  public List<StoragePathInfo> globEntries(StoragePath pathPattern)
       throws IOException {
-    return 
Arrays.stream(fs.globStatus(convertHoodieLocationToPath(locationPattern)))
-        .map(this::convertToHoodieFileStatus)
+    return Arrays.stream(fs.globStatus(convertToHadoopPath(pathPattern)))
+        .map(this::convertToStoragePathInfo)
         .collect(Collectors.toList());
   }
 
   @Override
-  public List<HoodieFileStatus> globEntries(HoodieLocation locationPattern, 
HoodieLocationFilter filter)
+  public List<StoragePathInfo> globEntries(StoragePath pathPattern, 
StoragePathFilter filter)
       throws IOException {
-    return 
Arrays.stream(fs.globStatus(convertHoodieLocationToPath(locationPattern), path 
->
-            filter.accept(convertPathToHoodieLocation(path))))
-        .map(this::convertToHoodieFileStatus)
+    return Arrays.stream(fs.globStatus(convertToHadoopPath(pathPattern), path 
->
+            filter.accept(convertToStoragePath(path))))
+        .map(this::convertToStoragePathInfo)
         .collect(Collectors.toList());
   }
 
   @Override
-  public boolean rename(HoodieLocation oldLocation, HoodieLocation 
newLocation) throws IOException {
-    return fs.rename(convertHoodieLocationToPath(oldLocation), 
convertHoodieLocationToPath(newLocation));
+  public boolean rename(StoragePath oldPath, StoragePath newPath) throws 
IOException {
+    return fs.rename(convertToHadoopPath(oldPath), 
convertToHadoopPath(newPath));
   }
 
   @Override
-  public boolean deleteDirectory(HoodieLocation location) throws IOException {
-    return fs.delete(convertHoodieLocationToPath(location), true);
+  public boolean deleteDirectory(StoragePath path) throws IOException {
+    return fs.delete(convertToHadoopPath(path), true);

Review Comment:
   will do in a separate PR.



-- 
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]

Reply via email to