Jackie-Jiang commented on a change in pull request #5444:
URL: https://github.com/apache/incubator-pinot/pull/5444#discussion_r432700876



##########
File path: 
pinot-core/src/main/java/org/apache/pinot/core/common/BlockDocIdIterator.java
##########
@@ -25,25 +25,16 @@
 public interface BlockDocIdIterator {
 
   /**
-   * Get the next document id.
-   *
-   * @return Next document id or EOF if there is no more documents
+   * Returns the next matched document id, or {@link Constants#EOF} if there 
is no more matched document.
+   * <p>NOTE: There should be no more call to this method after it returns 
{@link Constants#EOF}.
    */
   int next();
 
   /**
-   * Advance to the first document whose id is equal or greater than the given 
target document id.
-   * <p>If the given target document id is smaller or equal to the current 
document id, then return the current one.
-   *
-   * @param targetDocId The target document id
-   * @return First document id that is equal or greater than target or EOF if 
no document matches
+   * Returns the first matched document whose id is equal to or greater than 
the given target document id, or
+   * {@link Constants#EOF} if there is no such document.
+   * <p>NOTE: The target document id should be greater than the document id 
previous returned.

Review comment:
       No, the `advance(targetDocId)` here is equivalent to 
`skipTo(targetDocId)` and `next()` where you already iterate over the 
`targetDocId`. From an iterator's perspective, it should not return the same 
value twice. With this assumption, we can save one if check inside the 
`advance(targetDocId)`.
   Updated the javadoc to make it more clear.




----------------------------------------------------------------
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to