|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object org.apache.spark.Partitioner org.apache.spark.RangePartitioner<K,V>
public class RangePartitioner<K,V>
A Partitioner
that partitions sortable records by range into roughly
equal ranges. The ranges are determined by sampling the content of the RDD passed in.
Note that the actual number of partitions created by the RangePartitioner might not be the same
as the partitions
parameter, in the case where the number of sampled records is less than
the value of partitions
.
Constructor Summary | |
---|---|
RangePartitioner(int partitions,
RDD<? extends scala.Product2<K,V>> rdd,
boolean ascending,
scala.math.Ordering<K> evidence$1,
scala.reflect.ClassTag<K> evidence$2)
|
Method Summary | ||
---|---|---|
static
|
determineBounds(scala.collection.mutable.ArrayBuffer<scala.Tuple2<K,Object>> candidates,
int partitions,
scala.math.Ordering<K> evidence$4,
scala.reflect.ClassTag<K> evidence$5)
Determines the bounds for range partitioning from candidates with weights indicating how many items each represents. |
|
boolean |
equals(Object other)
|
|
int |
getPartition(Object key)
|
|
int |
hashCode()
|
|
int |
numPartitions()
|
|
static
|
sketch(RDD<K> rdd,
int sampleSizePerPartition,
scala.reflect.ClassTag<K> evidence$3)
Sketches the input RDD via reservoir sampling on each partition. |
Methods inherited from class org.apache.spark.Partitioner |
---|
defaultPartitioner |
Methods inherited from class Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RangePartitioner(int partitions, RDD<? extends scala.Product2<K,V>> rdd, boolean ascending, scala.math.Ordering<K> evidence$1, scala.reflect.ClassTag<K> evidence$2)
Method Detail |
---|
public static <K> scala.Tuple2<Object,scala.Tuple3<Object,Object,Object>[]> sketch(RDD<K> rdd, int sampleSizePerPartition, scala.reflect.ClassTag<K> evidence$3)
rdd
- the input RDD to sketchsampleSizePerPartition
- max sample size per partitionevidence$3
- (undocumented)
public static <K> Object determineBounds(scala.collection.mutable.ArrayBuffer<scala.Tuple2<K,Object>> candidates, int partitions, scala.math.Ordering<K> evidence$4, scala.reflect.ClassTag<K> evidence$5)
candidates
- unordered candidates with weightspartitions
- number of partitionsevidence$4
- (undocumented)evidence$5
- (undocumented)
public int numPartitions()
numPartitions
in class Partitioner
public int getPartition(Object key)
getPartition
in class Partitioner
public boolean equals(Object other)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |