Package org.apache.spark
Class HashPartitioner
Object
org.apache.spark.Partitioner
org.apache.spark.HashPartitioner
- All Implemented Interfaces:
- Serializable
A 
Partitioner that implements hash-based partitioning using
 Java's Object.hashCode.
 Java arrays have hashCodes that are based on the arrays' identities rather than their contents, so attempting to partition an RDD[Array[_} or RDD[(Array[_], _)] using a HashPartitioner will produce an unexpected or incorrect result.
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryMethods inherited from class org.apache.spark.PartitionerdefaultPartitioner
- 
Constructor Details- 
HashPartitionerpublic HashPartitioner(int partitions) 
 
- 
- 
Method Details- 
equals
- 
getPartition- Specified by:
- getPartitionin class- Partitioner
 
- 
hashCodepublic int hashCode()
- 
numPartitionspublic int numPartitions()- Specified by:
- numPartitionsin class- Partitioner
 
 
-