jberragan commented on code in PR #62: URL: https://github.com/apache/cassandra-analytics/pull/62#discussion_r1676167479
########## cassandra-analytics-common/src/main/java/org/apache/cassandra/spark/reader/StreamScanner.java: ########## @@ -49,30 +49,36 @@ * <p> * Upon return from the next() call the current values of the scanner can be obtained by calling * the methods in Rid, getPartitionKey(), getColumnName(), getValue(). + * * @param <Type> type of object returned by rid() method. */ @SuppressWarnings("unused") public interface StreamScanner<Type> extends Closeable { /** - * Expose the data/rid to be consumed. - * Implementation note: rid should always be updated to the current partition if hasNext returns true. + * Exposes the data to be consumed. + * <p>Implementation note: The data should always be updated to the current partition if {@code next} returns {@code true}. + * Calls to {@code data} should be idempotent and not alter the state of the underlying scanner. + * </p> * - * @return rid + * @return data of type {@code Type} */ - Type rid(); + Type data(); /** - * Indicate if there are more data/rid avaiable + * Indicate if there are more data available to read. + * <p>Implementation note: {@code next} can alter the state of the underlying scanner, + * so it should be called once and not called again until the {@code data} is consumed. + * </p> * - * @return true when the rid is available to be consumed; + * @return true when the data is available to be consumed; * otherwise, return false to indicate the scanner has exhausted * @throws IOException */ - boolean hasNext() throws IOException; + boolean next() throws IOException; Review Comment: Reworking `AbstreamStreamScanner` to be a `java.util.Iterator` is an involved change and too high risk to include in this PR. Contributions are welcome. -- 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: commits-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org