You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2019/04/11 01:53:23 UTC

[GitHub] [incubator-druid] jon-wei commented on a change in pull request #7425: Add is_overshadowed column to sys.segments table

jon-wei 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_r274229676
 
 

 ##########
 File path: server/src/main/java/org/apache/druid/server/http/MetadataResource.java
 ##########
 @@ -164,26 +168,68 @@ 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 -> {
+        if (overshadowedSegments.contains(segment.getId())) {
 
 Review comment:
   This block could be 
   
   ```
   return new SegmentWithOvershadowedStatus(
     segment, 
     overshadowedSegments.contains(segment.getId())
   );
   ```

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


With regards,
Apache Git Services

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