GWphua commented on code in PR #19016:
URL: https://github.com/apache/druid/pull/19016#discussion_r2958728660


##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/CompactionTaskTest.java:
##########
@@ -2032,6 +2039,247 @@ public void drop(DataSegment segment)
         .build();
   }
 
+  @Test
+  public void testFindSegmentsToLockReturnsAllSegmentsForMinorCompaction() 
throws Exception
+  {
+    final Interval testInterval = 
Intervals.of("2024-11-18T00:00:00.000Z/2024-11-25T00:00:00.000Z");
+    final String version = "2024-11-17T23:49:06.823Z";
+
+    final List<DataSegment> allSegmentsInInterval = new ArrayList<>();
+    allSegmentsInInterval.add(createSegmentWithPartition(testInterval, 
version, 0));
+    allSegmentsInInterval.add(createSegmentWithPartition(testInterval, 
version, 2));
+    allSegmentsInInterval.add(createSegmentWithPartition(testInterval, 
version, 4));
+    final DataSegment segment6 = createSegmentWithPartition(testInterval, 
version, 6);
+    final DataSegment segment7 = createSegmentWithPartition(testInterval, 
version, 7);
+    final DataSegment segment8 = createSegmentWithPartition(testInterval, 
version, 8);
+    allSegmentsInInterval.add(segment6);
+    allSegmentsInInterval.add(segment7);
+    allSegmentsInInterval.add(segment8);
+    allSegmentsInInterval.add(createSegmentWithPartition(testInterval, 
version, 10));
+    allSegmentsInInterval.add(createSegmentWithPartition(testInterval, 
version, 12));
+
+    final MinorCompactionInputSpec minorSpec = new MinorCompactionInputSpec(
+        testInterval,
+        ImmutableList.of(segment6.toDescriptor(), segment7.toDescriptor(), 
segment8.toDescriptor())
+    );
+
+    final CompactionTask compactionTask = new Builder(DATA_SOURCE, 
segmentCacheManagerFactory)
+        .inputSpec(minorSpec)
+        .context(ImmutableMap.of(Tasks.USE_CONCURRENT_LOCKS, true))
+        .build();
+
+    final TestTaskActionClient taskActionClient = new 
TestTaskActionClient(allSegmentsInInterval);
+
+    // Verify findSegmentsToLock() returns ALL segments in interval (no 
filtering)
+    final List<DataSegment> segmentsToLock = compactionTask.findSegmentsToLock(

Review Comment:
   Since it is a legacy mode, there's no need to support it anymore. I have 
added validation and appropriate tests.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to