apilloud commented on a change in pull request #11682:
URL: https://github.com/apache/beam/pull/11682#discussion_r428778641
##########
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:
The statement `Object aClass = partitionFn;` has no effect. You can just
pass `partitionFn` directly into the function.
----------------------------------------------------------------
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]