You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/05/21 01:41:16 UTC

[GitHub] [beam] darshanj commented on a change in pull request #11682: [BEAM-9946] | added new api in Partition Transform

darshanj commented on a change in pull request #11682:
URL: https://github.com/apache/beam/pull/11682#discussion_r428399634



##########
File path: sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Partition.java
##########
@@ -85,7 +141,14 @@
    * @throws IllegalArgumentException if {@code numPartitions <= 0}
    */
   public static <T> Partition<T> of(int numPartitions, PartitionFn<? super T> partitionFn) {
-    return new Partition<>(new PartitionDoFn<T>(numPartitions, partitionFn));
+
+    Contextful ctfFn =
+        Contextful.fn(
+            (T element, Contextful.Fn.Context c) ->
+                partitionFn.partitionFor(element, numPartitions),
+            Requirements.empty());
+    Object aClass = partitionFn;

Review comment:
       Hi, I don't get your suggestion here. I will need to wrap interface function in ContextFul.Fn. Can you eloborate please?




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