xuzhiwen1255 commented on code in PR #21971: URL: https://github.com/apache/flink/pull/21971#discussion_r1192908722
########## flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/SequenceGenerator.java: ########## @@ -111,11 +120,20 @@ public boolean hasNext() { return !this.valuesToEmit.isEmpty(); } - private static int safeDivide(long left, long right) { - Preconditions.checkArgument(right > 0); - Preconditions.checkArgument(left >= 0); - Preconditions.checkArgument(left <= Integer.MAX_VALUE * right); - return (int) (left / right); + private static long safeDivide(long totalRows, long stepSize) { + Preconditions.checkArgument(stepSize > 0, "cannot be equal to 0"); + Preconditions.checkArgument(totalRows >= 0, "Cannot be less than 0"); + return totalRows / stepSize; + } + + @VisibleForTesting + public long getStart() { + return start; + } + + @VisibleForTesting + public long getEnd() { + return end; Review Comment: Sorry, I may not understand it a bit. Does adding the numberOfElementsLimit parameter have any meaning for us to test the actual sequence generation? -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org