[ 
https://issues.apache.org/jira/browse/BEAM-4461?focusedWorklogId=142081&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-142081
 ]

ASF GitHub Bot logged work on BEAM-4461:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 07/Sep/18 08:00
            Start Date: 07/Sep/18 08:00
    Worklog Time Spent: 10m 
      Work Description: reuvenlax commented on a change in pull request #6318: 
[BEAM-4461] Some fixes to Combiners needed for Schema support.
URL: https://github.com/apache/beam/pull/6318#discussion_r215876628
 
 

 ##########
 File path: sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Top.java
 ##########
 @@ -168,7 +168,40 @@ private Top() {
    * {@code PCollection} of {@code KV}s and return the top values associated 
with each key.
    */
   public static <T extends Comparable<T>> Combine.Globally<T, List<T>> 
largest(int count) {
-    return Combine.globally(new TopCombineFn<>(count, new Natural<T>()));
+    return Combine.globally(largestFn(count));
+  }
+
+  /** Returns a {@link TopCombineFn} that aggregates the largest count values. 
*/
+  public static <T extends Comparable<T>> TopCombineFn<T, Natural<T>> 
largestFn(int count) {
+    return new TopCombineFn<T, Natural<T>>(count, new Natural<T>()) {};
+  }
+  /** Returns a {@link TopCombineFn} that aggregates the largest count long 
values. */
+  public static TopCombineFn<Long, Natural<Long>> largestLongsFn(int count) {
+    return new TopCombineFn<Long, Natural<Long>>(count, new Natural<Long>()) 
{};
 
 Review comment:
   No, this isn't allowed for anonymous inner classes

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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 142081)
    Time Spent: 6h 10m  (was: 6h)

> Create a library of useful transforms that use schemas
> ------------------------------------------------------
>
>                 Key: BEAM-4461
>                 URL: https://issues.apache.org/jira/browse/BEAM-4461
>             Project: Beam
>          Issue Type: Sub-task
>          Components: sdk-java-core
>            Reporter: Reuven Lax
>            Assignee: Reuven Lax
>            Priority: Major
>          Time Spent: 6h 10m
>  Remaining Estimate: 0h
>
> e.g. JoinBy(fields). Project, Filter, etc.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to