xloya commented on code in PR #4281:
URL: https://github.com/apache/gravitino/pull/4281#discussion_r1704979590


##########
api/src/main/java/org/apache/gravitino/file/FilesetDataOperationCtx.java:
##########
@@ -0,0 +1,41 @@
+/*
+ * 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 org.apache.gravitino.annotation.Evolving;
+
+/**
+ * An interface representing a fileset data operation context. This interface 
defines some
+ * information need to report to the server.
+ *
+ * <p>{@link FilesetDataOperationCtx} defines the basic properties of a 
fileset data operation
+ * context object.
+ */
+@Evolving
+public interface FilesetDataOperationCtx {
+  /** @return The sub path which is operated by the data operation . */
+  String subPath();
+
+  /** @return The data operation type. */
+  FilesetDataOperation operation();
+
+  /** @return The client type of the data operation. */
+  ClientType clientType();
+}

Review Comment:
   @jerryshao Yes, I agree with you that using `Map<String, String>` is more 
scalable.
   I briefly looked at the implementation of `CallerContext` in Hadoop. 
According to the description in the 
PR(https://issues.apache.org/jira/browse/HDFS-9184), there will be the 
following interaction process:
   1. When the client initiates an RPC request to the server, it fills the 
context into the Header of the RPC request.
   2. After receiving the request, the server obtains the context from the 
Header of the RPC request and performs an audit record.
   This means that in this way, we can put these audit contents into the Header 
of the `getFilesetContext` API request, and only keep the `subPath` information 
in the Request Body to exchange Fileset metadata and real paths.
   Do you think we should keep the context in the Request Body in the form of 
`Map<String, String>`, or put it in the Header?
   In addition, the purpose of adding this API is not only for auditing, but 
also to unify the logic of converting and obtaining real paths in various 
language clients, which can make the logic in PyGVFS/Hadoop GVFS simpler.



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