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 2018/10/12 06:26:49 UTC

[GitHub] dclim commented on a change in pull request #6451: Fix inconsistent segment size(#6448)

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

 ##########
 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:
   minor: `() -> metadataSegments.iterator()` can be written as `metadataSegments::iterator`

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