You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "whbing (via GitHub)" <gi...@apache.org> on 2023/08/11 07:13:54 UTC

[GitHub] [ozone] whbing commented on pull request #5170: HDDS-7713. listKeys for prefix path as key is redundant

whbing commented on PR #5170:
URL: https://github.com/apache/ozone/pull/5170#issuecomment-1674303861

   LGTM Overall. Thanks ! Here's a minor suggestion from my perspective. 
   We can add test in `TestListKeysWithFSO` to compare the listKeys results of `legacyBucket` and `fsoBucket`. I've written a demo test in `TestListKeysWithFSO`:
   ```java
   private static void buildNameSpaceTree(OzoneBucket ozoneBucket)
         throws Exception {
       LinkedList<String> keys = new LinkedList<>();
       // ignore other codes    
       keys.add("/a1/b3/e3/e31.tx");
       keys.add("/a1/b3/e3/e31.tx1");
      // ignore other codes
       createKeys(ozoneBucket, keys);
     }
   
     @Test
     public void testListKeysWithValidStartKey() throws Exception {
       // case-10: keyPrefix corresponds an exist file and other file's prefix
       expectedKeys =
           getExpectedKeyList("a1/b3/e3/e31.tx", "", legacyOzoneBucket);
       checkKeyList("a1/b3/e3/e31.tx", "", expectedKeys, fsoOzoneBucket);
     }
   ```
   Result will be `Actual   :[a1/b3/e3/e31.tx, a1/b3/e3/e31.tx] ` without PR  and `Actual   :[a1/b3/e3/e31.tx]` with this PR.
   Since the result from `fsoBucket` is not consistent with `legacybucket` in the above case (In fact, I'v  noticed this duplication problem, as well as other omission problem in fsoBucket, see issue [HDDS-9065](https://issues.apache.org/jira/browse/HDDS-9065)), we can first modify the test to:
   ```java
     @Test
     public void testListKeysWithValidStartKey() throws Exception {
       // case-10: keyPrefix corresponds an exist file and other file's prefix
       expectedKeys = newLinkedList(Arrays.asList("a1/b3/e3/e31.tx"));
       checkKeyList("a1/b3/e3/e31.tx", "", expectedKeys, fsoOzoneBucket);
     }
   ```
   


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org