surekhasaharan commented on a change in pull request #6451: Fix inconsistent 
segment size(#6448)
URL: https://github.com/apache/incubator-druid/pull/6451#discussion_r224833007
 
 

 ##########
 File path: 
server/src/main/java/org/apache/druid/server/http/MetadataResource.java
 ##########
 @@ -151,16 +151,15 @@ public Response getDatabaseSegmentDataSource(
   public Response getDatabaseSegments(@Context final HttpServletRequest req)
   {
     final Collection<ImmutableDruidDataSource> druidDataSources = 
metadataSegmentManager.getInventory();
-    final Set<DataSegment> metadataSegments = druidDataSources
+    final Stream<DataSegment> metadataSegments = druidDataSources
         .stream()
-        .flatMap(t -> t.getSegments().stream())
-        .collect(Collectors.toSet());
+        .flatMap(t -> t.getSegments().stream());
 
     Function<DataSegment, Iterable<ResourceAction>> raGenerator = segment -> 
Collections.singletonList(
         
AuthorizationUtils.DATASOURCE_READ_RA_GENERATOR.apply(segment.getDataSource()));
 
     final Iterable<DataSegment> authorizedSegments = 
AuthorizationUtils.filterAuthorizedResources(
-        req, metadataSegments, raGenerator, authorizerMapper);
+        req, () -> metadataSegments.iterator(), raGenerator, authorizerMapper);
 
 Review comment:
   done

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to