leventov commented on a change in pull request #7595: Optimize overshadowed 
segments computation
URL: https://github.com/apache/incubator-druid/pull/7595#discussion_r291285065
 
 

 ##########
 File path: core/src/main/java/org/apache/druid/utils/CollectionUtils.java
 ##########
 @@ -68,6 +71,17 @@ public int size()
     };
   }
 
+  /**
+   * Returns a transformed map from the given input map where the value is 
modified based on the given valueMapper
+   * function.
+   */
+  public static <K, V, V2> Map<K, V2> transformValues(Map<K, V> map, 
Function<V, V2> valueMapper)
 
 Review comment:
   You can actually enforce usage of the new method using by adding these two 
Structural Search patterns:
   ```
   $x$.entrySet().stream().collect(Collectors.toMap(Entry::getKey, $y$))
   ```
   and
   ```
   $x$.entrySet().stream().collect(Collectors.toMap($k$ -> $k$.getKey(), $y$))
   ```

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

Reply via email to