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 2019/12/11 08:09:11 UTC

[GitHub] [hadoop-ozone] adoroszlai commented on a change in pull request #339: HDDS-2553. Iterator.next() methods should throw NoSuchElementException

adoroszlai commented on a change in pull request #339: HDDS-2553. Iterator.next() methods should throw NoSuchElementException
URL: https://github.com/apache/hadoop-ozone/pull/339#discussion_r356448026
 
 

 ##########
 File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/common/ChunkBufferImplWithByteBuffer.java
 ##########
 @@ -53,6 +54,9 @@ public boolean hasNext() {
       @Override
       public ByteBuffer next() {
         final ByteBuffer duplicated = buffer.duplicate();
+        if (!buffer.hasRemaining()) {
 
 Review comment:
   Rebase is not required while GitHub says:
   
   > This branch has no conflicts with the base branch
   
   Even if there are conflicts, a merge from `master` is preferred over rebase, to avoid the need for force push.
   
   Regarding unit test, I would tweak the existing one, adding to the end of https://github.com/apache/hadoop-ozone/blob/050d58b6d0f59e251519a4108930fa78f850b231/hadoop-hdds/common/src/test/java/org/apache/hadoop/ozone/common/TestChunkBuffer.java#L111-L134
   
   these:
   
   ```
       Assert.assertFalse(i.hasNext());
       Assertions.assertThrows(NoSuchElementException.class, i::next);
   ```
   
   `TestChunkBuffer` tests both implementations of `ChunkBuffer` without code duplication.

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