abhishekrb19 commented on code in PR #16112:
URL: https://github.com/apache/druid/pull/16112#discussion_r1522447233
##########
server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataQuery.java:
##########
@@ -217,6 +217,49 @@ public CloseableIterator<DataSegmentPlus>
retrieveUnusedSegmentsPlus(
);
}
+ public List<DataSegmentPlus> retrieveSegmentsById(String datasource,
Set<String> segmentIds)
+ {
+ final List<List<String>> partitionedSegmentIds
+ = Lists.partition(new ArrayList<>(segmentIds), 100);
Review Comment:
We have a few batching constants that are set to 100:
`MAX_NUM_SEGMENTS_TO_ANNOUNCE_AT_ONCE` and `MAX_INTERVALS_PER_BATCH`. Perhaps
in a future patch, we can consolidate these to use a single constant since the
intent is the same.
##########
server/src/main/java/org/apache/druid/metadata/SegmentsMetadataManager.java:
##########
@@ -55,8 +55,17 @@ public interface SegmentsMetadataManager
int markAsUsedNonOvershadowedSegmentsInInterval(String dataSource, Interval
interval);
- int markAsUsedNonOvershadowedSegments(String dataSource, Set<String>
segmentIds)
- throws UnknownSegmentIdsException;
+ /**
+ * Marks the given segment IDs as "used" only if there are not already
overshadowed
Review Comment:
```suggestion
* Marks the given segment IDs as "used" only if they are not already
overshadowed
```
--
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]