jtao15 commented on code in PR #15177: URL: https://github.com/apache/pinot/pull/15177#discussion_r1980446596
########## pinot-plugins/pinot-minion-tasks/pinot-minion-builtin-tasks/src/test/java/org/apache/pinot/plugin/minion/tasks/mergerollup/MergeRollupTaskGeneratorTest.java: ########## @@ -283,6 +283,50 @@ public void testGenerateTasksCheckConfigs() { assertTrue(pinotTaskConfigs.isEmpty()); } + /** + * Test pre-filter of task generation + */ + @Test + public void testFilterSegmentsBasedOnStatus() { + ClusterInfoAccessor mockClusterInfoProvide = mock(ClusterInfoAccessor.class); + + when(mockClusterInfoProvide.getTaskStates(MinionConstants.MergeRollupTask.TASK_TYPE)).thenReturn(new HashMap<>()); + // construct 4 following segments, among these, only 0_0 can be scheduled, others should be filtered out + // partition 0, completed 0 + SegmentZKMetadata realtimeTableSegmentMetadata1 = + getSegmentZKMetadata("testTable__0__0__0", 5000, 6000, TimeUnit.MILLISECONDS, + null, "50000", "60000"); + realtimeTableSegmentMetadata1.setStatus(CommonConstants.Segment.Realtime.Status.DONE); + // partition 0, completed 1 + SegmentZKMetadata realtimeTableSegmentMetadata2 = + getSegmentZKMetadata("testTable__0__0__1", 6000, 7000, TimeUnit.MILLISECONDS, Review Comment: I think we need to change the segment names, llc segment name pattern is tableName__partitionGroupId__seqId__timestamp. -- 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...@pinot.apache.org 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