mchades commented on code in PR #7215:
URL: https://github.com/apache/gravitino/pull/7215#discussion_r2103664055


##########
api/src/main/java/org/apache/gravitino/file/FileInfo.java:
##########
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.gravitino.file;
+
+import java.time.Instant;
+
+public interface FileInfo {
+
+    /** @return Name of the file object. */
+    String name();
+
+    /** @return Whether this is a file (true). */
+    boolean isFile();

Review Comment:
   suggest changing to `isDir()`



##########
api/src/main/java/org/apache/gravitino/file/FileInfo.java:
##########
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.gravitino.file;
+
+import java.time.Instant;
+
+public interface FileInfo {
+
+    /** @return Name of the file object. */

Review Comment:
   the filename or directory name



##########
core/src/main/java/org/apache/gravitino/catalog/FilesetFileOps.java:
##########
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.gravitino.catalog;
+
+import org.apache.gravitino.NameIdentifier;
+import org.apache.gravitino.exceptions.NoSuchFilesetException;
+import org.apache.gravitino.file.FileInfo;
+
+/**
+ * The {@code FilesetFileOps} interface defines operations for managing files 
within filesets.
+ * This interface is designed to be used internally by the server and not 
exposed to public
+ * client APIs to avoid confusion.
+ */
+public interface FilesetFileOps {
+
+    /**
+     * List files and directories within a fileset.
+     *
+     * @param ident A fileset identifier.
+     * @param path The path within the fileset to list files from. Empty 
string for root.
+     * @param limit Maximum number of files to return.
+     * @param offset Starting position in the list for pagination.
+     * @return Array of FileInfo objects containing file metadata.
+     * @throws NoSuchFilesetException If the fileset does not exist.
+     */
+    FileInfo[] listFiles(NameIdentifier ident, String path, int limit, int 
offset)

Review Comment:
   suggest:
   
   ```java
   /**
      * List the files in a fileset with a specific location name and sub path.
      * @param ident A fileset identifier.
      * @param locationName The location name. If null, the default location 
will be used.
      * @param subPath The sub path under the fileset.
      * @return An array of file information objects.
      */
     FileInfo[] listFiles(NameIdentifier ident, String locationName, String 
subPath);
   ```



##########
api/src/main/java/org/apache/gravitino/file/FileInfo.java:
##########
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.gravitino.file;
+
+import java.time.Instant;
+
+public interface FileInfo {
+
+    /** @return Name of the file object. */
+    String name();
+
+    /** @return Whether this is a file (true). */
+    boolean isFile();
+
+    /** @return The file size in bytes. */

Review Comment:
   0 for directory



##########
api/src/main/java/org/apache/gravitino/file/FileInfo.java:
##########
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.gravitino.file;
+
+import java.time.Instant;
+
+public interface FileInfo {

Review Comment:
   I suggest moving this interface to the `common` module, as other clients do 
not use it.



##########
api/src/main/java/org/apache/gravitino/file/FileInfo.java:
##########
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.gravitino.file;
+
+import java.time.Instant;
+
+public interface FileInfo {
+
+    /** @return Name of the file object. */
+    String name();
+
+    /** @return Whether this is a file (true). */
+    boolean isFile();
+
+    /** @return The file size in bytes. */
+    long size();
+
+    /** @return The last modification time as an Instant. */
+    Instant lastModified();
+
+    /** @return The block size in bytes, or 0 if not applicable. */
+    long blockSize();

Review Comment:
   unncessary, suggest to remove



##########
api/src/main/java/org/apache/gravitino/file/FileInfo.java:
##########
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.gravitino.file;
+
+import java.time.Instant;
+
+public interface FileInfo {
+
+    /** @return Name of the file object. */
+    String name();
+
+    /** @return Whether this is a file (true). */
+    boolean isFile();
+
+    /** @return The file size in bytes. */
+    long size();
+
+    /** @return The last modification time as an Instant. */
+    Instant lastModified();

Review Comment:
   suggest using long to avoid the time zone issue, as most FS providers 
provide the timestamp



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