jihoonson commented on a change in pull request #9905:
URL: https://github.com/apache/druid/pull/9905#discussion_r436077498



##########
File path: 
indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionTask.java
##########
@@ -524,10 +524,28 @@ private String createIndexTaskSpecId(int i)
                                  .add(p)
       );
 
-      final List<ParallelIndexIngestionSpec> specs = new 
ArrayList<>(intervalToSegments.size());
-      for (Entry<Interval, List<Pair<QueryableIndex, DataSegment>>> entry : 
intervalToSegments.entrySet()) {
-        final Interval interval = entry.getKey();
-        final List<Pair<QueryableIndex, DataSegment>> segmentsToCompact = 
entry.getValue();
+      // unify overlapping intervals to ensure overlapping segments compacting 
in the same indexSpec
+      List<Pair<Interval, List<Pair<QueryableIndex, DataSegment>>>> 
intervalToSegmentsUnified = new ArrayList<>();
+      Iterator<Interval> iterator = intervalToSegments.keySet().iterator();
+      Interval union = iterator.next();
+      List<Pair<QueryableIndex, DataSegment>> segments = new 
ArrayList<>(intervalToSegments.get(union));

Review comment:
       Oops, sorry I missed the CI failure.
   
   ```
   [ERROR] 
org.apache.druid.indexing.common.task.CompactionTask.createIngestionSchema(TaskToolbox,
 CompactionTask$SegmentProvider, CompactionTask$PartitionConfigurationManager, 
DimensionsSpec, AggregatorFactory[], Granularity, ObjectMapper, 
CoordinatorClient, SegmentLoaderFactory, RetryPolicyFactory) makes inefficient 
use of keySet iterator instead of entrySet iterator 
[org.apache.druid.indexing.common.task.CompactionTask] At 
CompactionTask.java:[line 531] WMI_WRONG_MAP_ITERATOR
   ```
   
   This means you are calling `HashMap.get()` even though you can iterate the 
`Entry` set. Would you fix this please?




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

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