public class AssignIndexFunction<T>
extends java.lang.Object
implements org.apache.spark.api.java.function.Function2<java.lang.Integer,java.util.Iterator<T>,java.util.Iterator<scala.Tuple2<java.lang.Integer,T>>>
BalancedPartitioner
to enable partitioning to be done in a way that is more reliable (less random) than standard .repartition callsConstructor and Description |
---|
AssignIndexFunction(int[] partitionElementStartIdxs) |
Modifier and Type | Method and Description |
---|---|
java.util.Iterator<scala.Tuple2<java.lang.Integer,T>> |
call(java.lang.Integer partionNum,
java.util.Iterator<T> v2) |
public AssignIndexFunction(int[] partitionElementStartIdxs)
partitionElementStartIdxs
- These are the start indexes for elements in each partition (determined from the
number of elements in each partition). Thus length of the array must be equal
to the number of partitions