UUIDPartitioner extends ConfigurablePartitioner implements ProvidesAlias { @Override public int numPartitions() { return numPartitions; }  @Override void configure(Config config); @Override void configureRDD(JavaPairRDD<Row, Row> rdd); @Override int getPartition(Object rowObject); @Override int numPartitions(); @Override String getAlias();  }
@Test public void testNumPartitions() { ConfigurablePartitioner p = new UUIDPartitioner(); JavaPairRDD<Row, Row> rdd = Contexts.getSparkSession().range(10).javaRDD().map(new LongToRowFunction()).mapToPair(new UUIDKeyFunction()).repartition(10); p.configure(ConfigFactory.empty()); p.configureRDD(rdd); assertEquals(p.numPartitions(), 10); }