I want to use a RangePartitioner in my Java Spark Application, but I have no clue how to set the two scala parameters scala.math.Ordering<K> evidence$1
and scala.reflect.ClassTag<K> evidence$2
. Can someone give me an example?
Here is the link to the JavaDoc of RangePartitioner (it was no help for me because I'm new to Spark and Scala...):
My Code actually looks like:
JavaPairRDD<Integer, String> partitionedRDD = rdd.partitionBy(new RangePartitioner<Integer, String>(10, rdd, true, evidence$1, evidence$2));
Here you can find an example of how to use RangePartitioner from java.
https://github.com/PacktPublishing/Apache-Spark-2x-for-Java-Developers/blob/master/src/main/java/com/packt/sfjd/ch7/Partitioning.java.
If you wants to implements a custom Comparator for a custom object:
then pass to Range Partitioner Applying
Ordering$.MODULE$.comparatorToOrdering(new MyCustomComparator()) to convert the Java comparator to scala ordering