surekhasaharan commented on a change in pull request #7595: Optimize
overshadowed segments computation
URL: https://github.com/apache/incubator-druid/pull/7595#discussion_r291312862
##########
File path:
server/src/main/java/org/apache/druid/metadata/SQLMetadataSegmentManager.java
##########
@@ -729,14 +717,21 @@ public DataSegment map(int index, ResultSet r,
StatementContext ctx) throws SQLE
// a segment remove call reflected in MetadataResource API calls. These
updates outside of scheduled poll may be
// added back in removeDataSource and removeSegment methods after the
on-demand polling changes from
// https://github.com/apache/incubator-druid/pull/7653 are in.
- dataSourcesSnapshot = new DataSourcesSnapshot(newDataSources.entrySet()
- .stream()
-
.collect(Collectors.toMap(
- e ->
e.getKey(),
- e ->
e.getValue().toImmutableDruidDataSource()
- )));
+ final Map<String, ImmutableDruidDataSource> updatedDataSources =
CollectionUtils.transformValues(
+ newDataSources,
+ v -> v.toImmutableDruidDataSource()
+ );
+ dataSourcesSnapshot = new DataSourcesSnapshot(updatedDataSources);
}
+ /**
Review comment:
removed
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]