leventov commented on a change in pull request #7425: Add is_overshadowed 
column to sys.segments table
URL: https://github.com/apache/incubator-druid/pull/7425#discussion_r274972691
 
 

 ##########
 File path: 
server/src/main/java/org/apache/druid/server/http/MetadataResource.java
 ##########
 @@ -171,26 +175,67 @@ public Response getDatabaseSegments(
         .stream()
         .flatMap(t -> t.getSegments().stream());
 
-    final Function<DataSegment, Iterable<ResourceAction>> raGenerator = 
segment -> Collections.singletonList(
-        
AuthorizationUtils.DATASOURCE_READ_RA_GENERATOR.apply(segment.getDataSource()));
+    if (includeOvershadowedStatus != null) {
+      final Set<SegmentId> overshadowedSegments = 
findOvershadowedSegments(druidDataSources);
+      //transform DataSegment to SegmentWithOvershadowedStatus objects
+      final Stream<SegmentWithOvershadowedStatus> 
segmentsWithOvershadowedStatus = metadataSegments
+          .map(
+              segment -> new SegmentWithOvershadowedStatus(
+                  segment,
+                  overshadowedSegments.contains(segment.getId())
+              )).collect(Collectors.toList()).stream();
 
 Review comment:
   Not formatted properly

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to