You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/01/10 07:36:37 UTC

[GitHub] [hadoop-ozone] cxorm opened a new pull request #432: HDDS-2832. Fix listing buckets for setting --start with last bucket

cxorm opened a new pull request #432: HDDS-2832. Fix listing buckets for setting --start with last bucket
URL: https://github.com/apache/hadoop-ozone/pull/432
 
 
   ## What changes were proposed in this pull request?
   Cause listing buckets with `--start` means that we would get buckets after the `--start`, we should get empty result when we set `--start` with last bucket.
   
   But we get all buckets for now, this is caused by this [method](https://github.com/apache/hadoop-ozone/blob/master/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/OzoneVolume.java#L298#L305).
   
   When we set `--start` with last bucket, [`getNextListOfBuckets(prevBucket)`](https://github.com/apache/hadoop-ozone/blob/master/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/OzoneVolume.java#L294) would be empty list, so the first call of [`hasNext()`](https://github.com/apache/hadoop-ozone/blob/master/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/OzoneVolume.java#L298#L305) would enter the `if-block` and `currentValue` is `null`.
   
   This situation results in calling `getNextListOfBuckets(null)`, and [`currentIterator`](https://github.com/apache/hadoop-ozone/blob/master/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/OzoneVolume.java#L300#L302) would be iterator of all buckets with this length size, so we get all buckets for now.
   
   #### Proposed fix.
   The `currentValue` in [`if-block`](https://github.com/apache/hadoop-ozone/blob/master/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/OzoneVolume.java#L299#L303) would be `null` if and only if first call [`hasNext()`](https://github.com/apache/hadoop-ozone/blob/master/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/OzoneVolume.java#L298#L305) of empty list, so`currentValue` is tested ahead by this fix.
   
   ## What is the link to the Apache JIRA
   https://issues.apache.org/jira/browse/HDDS-2832
   
   ## How was this patch tested?
   [Github action passed](https://github.com/cxorm/hadoop-ozone/runs/376330188).

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [hadoop-ozone] cxorm commented on issue #432: HDDS-2832. Fix listing buckets for setting --start with last bucket

Posted by GitBox <gi...@apache.org>.
cxorm commented on issue #432: HDDS-2832. Fix listing buckets for setting --start with last bucket
URL: https://github.com/apache/hadoop-ozone/pull/432#issuecomment-597745563
 
 
   Thank you @elek for the review and commit.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [hadoop-ozone] elek commented on issue #432: HDDS-2832. Fix listing buckets for setting --start with last bucket

Posted by GitBox <gi...@apache.org>.
elek commented on issue #432: HDDS-2832. Fix listing buckets for setting --start with last bucket
URL: https://github.com/apache/hadoop-ozone/pull/432#issuecomment-597657964
 
 
   Finally, full green build: Thanks the contribution, I am merging it to the master.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [hadoop-ozone] elek closed pull request #432: HDDS-2832. Fix listing buckets for setting --start with last bucket

Posted by GitBox <gi...@apache.org>.
elek closed pull request #432: HDDS-2832. Fix listing buckets for setting --start with last bucket
URL: https://github.com/apache/hadoop-ozone/pull/432
 
 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [hadoop-ozone] cxorm commented on issue #432: HDDS-2832. Fix listing buckets for setting --start with last bucket

Posted by GitBox <gi...@apache.org>.
cxorm commented on issue #432: HDDS-2832. Fix listing buckets for setting --start with last bucket
URL: https://github.com/apache/hadoop-ozone/pull/432#issuecomment-576026600
 
 
   Test would be added in integration-test soon.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [hadoop-ozone] cxorm commented on issue #432: HDDS-2832. Fix listing buckets for setting --start with last bucket

Posted by GitBox <gi...@apache.org>.
cxorm commented on issue #432: HDDS-2832. Fix listing buckets for setting --start with last bucket
URL: https://github.com/apache/hadoop-ozone/pull/432#issuecomment-596732064
 
 
   Thanks @elek for looking on it.
   
   The [Error](https://github.com/apache/hadoop-ozone/pull/432/checks?check_run_id=495460038 ) here seems not caused by this patch.
   I have tested it with other [branch](https://github.com/cxorm/hadoop-ozone/runs/495427388), and it passed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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