@@ -110,7 +110,7 @@ class RangePartitioner[K : Ordering : ClassTag, V](
110
110
// We allow partitions = 0, which happens when sorting an empty RDD under the default settings.
111
111
require(partitions >= 0 , s " Number of partitions cannot be negative but found $partitions. " )
112
112
113
- private var ordering = implicitly[Ordering [K ]]
113
+ protected var ordering = implicitly[Ordering [K ]]
114
114
115
115
// An array of upper bounds for the first (partitions - 1) partitions
116
116
private var rangeBounds : Array [K ] = {
@@ -156,7 +156,7 @@ class RangePartitioner[K : Ordering : ClassTag, V](
156
156
157
157
def numPartitions = rangeBounds.length + 1
158
158
159
- private var binarySearch : ((Array [K ], K ) => Int ) = CollectionsUtils .makeBinarySearch[K ]
159
+ protected var binarySearch : ((Array [K ], K ) => Int ) = CollectionsUtils .makeBinarySearch[K ]
160
160
161
161
def getPartition (key : Any ): Int = {
162
162
val k = key.asInstanceOf [K ]
@@ -204,7 +204,7 @@ class RangePartitioner[K : Ordering : ClassTag, V](
204
204
}
205
205
206
206
@ throws(classOf [IOException ])
207
- private def writeObject (out : ObjectOutputStream ): Unit = Utils .tryOrIOException {
207
+ protected def writeObject (out : ObjectOutputStream ): Unit = Utils .tryOrIOException {
208
208
val sfactory = SparkEnv .get.serializer
209
209
sfactory match {
210
210
case js : JavaSerializer => out.defaultWriteObject()
@@ -222,7 +222,7 @@ class RangePartitioner[K : Ordering : ClassTag, V](
222
222
}
223
223
224
224
@ throws(classOf [IOException ])
225
- private def readObject (in : ObjectInputStream ): Unit = Utils .tryOrIOException {
225
+ protected def readObject (in : ObjectInputStream ): Unit = Utils .tryOrIOException {
226
226
val sfactory = SparkEnv .get.serializer
227
227
sfactory match {
228
228
case js : JavaSerializer => in.defaultReadObject()
@@ -240,7 +240,7 @@ class RangePartitioner[K : Ordering : ClassTag, V](
240
240
}
241
241
}
242
242
243
- private [spark] object RangePartitioner {
243
+ object RangePartitioner {
244
244
245
245
/**
246
246
* Sketches the input RDD via reservoir sampling on each partition.
0 commit comments