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

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

                Author: ASF GitHub Bot
            Created on: 27/Apr/19 00:26
            Start Date: 27/Apr/19 00:26
    Worklog Time Spent: 10m 
      Work Description: youngoli commented on pull request #8409: [BEAM-7157] 
Allow creation of BinaryCombineFn from lambdas.
URL: https://github.com/apache/beam/pull/8409#discussion_r279135040
 
 

 ##########
 File path: 
sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Combine.java
 ##########
 @@ -435,6 +488,27 @@ public OutputT defaultValue() {
    */
   public abstract static class BinaryCombineFn<V> extends CombineFn<V, 
Holder<V>, V> {
 
+    /**
+     * Returns a {@code CombineFn} that uses the given {@code 
SerializableBiFunction} to combine
+     * values.
+     */
+    public static <V> BinaryCombineFn<V> of(SerializableBiFunction<V, V, V> 
combiner) {
+      return new BinaryCombineFn<V>() {
+        @Override
+        public V apply(V left, V right) {
+          return combiner.apply(left, right);
+        }
+      };
+    }
+
+    public static BinaryCombineFn<Long> foo() {
 
 Review comment:
   Are these two functions (foo and bar) supposed to be here? Looks like 
testing code that was left behind.
 
----------------------------------------------------------------
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]


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

    Worklog Id:     (was: 233825)
    Time Spent: 1h  (was: 50m)

> Allow creation of BinaryCombineFn from lambdas.
> -----------------------------------------------
>
>                 Key: BEAM-7157
>                 URL: https://issues.apache.org/jira/browse/BEAM-7157
>             Project: Beam
>          Issue Type: New Feature
>          Components: sdk-java-core
>            Reporter: Robert Bradshaw
>            Priority: Major
>          Time Spent: 1h
>  Remaining Estimate: 0h
>




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

Reply via email to