ChenSammi commented on code in PR #9894:
URL: https://github.com/apache/ozone/pull/9894#discussion_r2979655521


##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/protocol/ListStatusLightOptions.java:
##########
@@ -0,0 +1,182 @@
+/*
+ * 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.hadoop.ozone.client.protocol;
+
+import java.util.Objects;
+
+/**
+ * Options for {@link ClientProtocol#listStatusLight(ListStatusLightOptions)}.
+ * Encapsulates all parameters to allow future extensibility without breaking
+ * the method signature.
+ */
+public final class ListStatusLightOptions {
+
+  private final String volumeName;
+  private final String bucketName;
+  private final String keyName;
+  private final boolean recursive;
+  private final String startKey;
+  private final long numEntries;
+  private final boolean allowPartialPrefixes;
+  // When keyName is empty (root listing), this is the original S3/list
+  // prefix for STS auth. Enables LIST check on this prefix instead of "*".
+  private final String listPrefix;

Review Comment:
   @fmorg-git , thanks for updating the patch. Ya, the complexity of 
listStatusLight requires us to carefully change the logic, and avoid 
introducing new complexity as we can, so reduce the new edge case uncovered 
chance.  
   
   For KeyIterator and KeyIteratorWithFSO, delimiterKeyPrefix in an interval 
field, it's initialized in initDelimiterKeyPrefix() based on the keyPrefix 
passed in the Iterator constructor.   
   
   ```
     protected void initDelimiterKeyPrefix() {
         setDelimiterKeyPrefix(getKeyPrefix());
         if (!getKeyPrefix().endsWith(OZONE_URI_DELIMITER)) {
           setDelimiterKeyPrefix(OzoneFSUtils.getParentDir(getKeyPrefix()));
         }
       } 
   ```
   So if 
   - getKeyPrefix() is "/", then delimiterKeyPrefix is "", with this patch, the 
final requestKeyName will be "/"
   - getKeyPrefix() is "/dir1", then delimiterKeyPrefix is "/", the final 
requestKeyName will be "/"
   - getKeyPrefix() is "/dir1/", then delimiterKeyPrefix is also "/dir1/", the 
final requestKeyName will be the same "/dir1/"
   
   I'm not very sure, need more time to understand the impact to existing 
logic.  The above change can satisfy the STS authorization logic? 
   
   
   



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

Reply via email to