[ 
https://issues.apache.org/jira/browse/HDFS-11779?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16030721#comment-16030721
 ] 

Weiwei Yang commented on HDFS-11779:
------------------------------------

Thanks [~linyiqun] and [~nandakumar131] for the comments, I have uploaded v8 
patch with following changes

Comment from [~linyiqun]

bq. The maxNumOfKeys < 0 should be maxNumOfKeys <=0, var maxNumOfKeys should be 
a positive number.

It makes sense. Allow {{maxNumOfKeys = 0}} seems unnecessary, I have updated 
the patch so it only takes value *(0, MAX_LISTBUCKETS_SIZE]*.

Comments from [~nandakumar131]

bq. Can we use getVolumeKey(volumeName) as prevKey in 
MetadataManagerImpl#listBuckets, so that we can skip iterating over the other 
previous volumes?

Good catch. I agree, that improves the performance. I have updated the patch to 
do so. The change is done in {{MetadataManagerImpl#listBuckets}}. 

bq. So even if the startKey is not valid, we will proceed with the next valid 
key. We are returning an empty list only if the filters doesn't match.

If startKey is not valid, once done {{iterator.seek(key)}}, the iterator will 
not return any item in next iteration. The doc is correct. You can refer to the 
test case in {{TestKeySpaceManager}}

{code}
// Provide an invalid bucket name as start key.
listBucketArgs = new ListArgs(volArgs, null, 100, "unknown_bucket_name");
result = storageHandler.listBuckets(listBucketArgs);
Assert.assertEquals(0, result.getBuckets().size());
{code}

Thanks

> Ozone: KSM: add listBuckets
> ---------------------------
>
>                 Key: HDFS-11779
>                 URL: https://issues.apache.org/jira/browse/HDFS-11779
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: ozone
>    Affects Versions: HDFS-7240
>            Reporter: Anu Engineer
>            Assignee: Weiwei Yang
>         Attachments: HDFS-11779-HDFS-7240.001.patch, 
> HDFS-11779-HDFS-7240.002.patch, HDFS-11779-HDFS-7240.003.patch, 
> HDFS-11779-HDFS-7240.004.patch, HDFS-11779-HDFS-7240.005.patch, 
> HDFS-11779-HDFS-7240.006.patch, HDFS-11779-HDFS-7240.007.patch, 
> HDFS-11779-HDFS-7240.008.patch
>
>
> Lists buckets of a given volume. Similar to listVolumes, paging supported via 
> prevKey, prefix and maxKeys.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to