class HashPartitioner extends Partitioner
A org.apache.spark.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.
- Source
- Partitioner.scala
- Alphabetic
- By Inheritance
- HashPartitioner
- Partitioner
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new HashPartitioner(partitions: Int)
Value Members
-
def
equals(other: Any): Boolean
- Definition Classes
- HashPartitioner → AnyRef → Any
-
def
getPartition(key: Any): Int
- Definition Classes
- HashPartitioner → Partitioner
-
def
hashCode(): Int
- Definition Classes
- HashPartitioner → AnyRef → Any
-
def
numPartitions: Int
- Definition Classes
- HashPartitioner → Partitioner