the-other-tim-brown commented on code in PR #10768:
URL: https://github.com/apache/hudi/pull/10768#discussion_r1504426495


##########
hudi-utilities/src/test/java/org/apache/hudi/utilities/sources/helpers/TestCheckpointUtils.java:
##########
@@ -245,6 +245,29 @@ public void testSplitAndMergeRanges() {
     assertEquals(300, mergedRanges[0].untilOffset());
   }
 
+  @Test
+  public void testNumAllocatedEventsGreaterThanNumActualEvents() {
+    int[] partitions = new int[] {0, 1, 2, 3, 4};
+    long[] committedOffsets =
+        new long[] {76888767, 76725043, 76899767, 76833267, 76952055};
+    long[] latestOffsets =
+        new long[] {77005407, 76768151, 76985456, 76917973, 77080447};
+    OffsetRange[] ranges =
+        KafkaOffsetGen.CheckpointUtils.computeOffsetRanges(
+            makeOffsetMap(partitions, committedOffsets),
+            makeOffsetMap(partitions, latestOffsets),
+            400000,
+            20);
+
+    long totalNewMsgs = 
KafkaOffsetGen.CheckpointUtils.totalNewMessages(ranges);
+    assertEquals(400000, totalNewMsgs);
+    for (OffsetRange range : ranges) {

Review Comment:
   Do you want to assert on the actual ranges that are computed to show that 
they are properly distributed?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to