Skip to content

Commit 2f552a5

Browse files
committed
Minor changes about naming and order
1 parent c92a281 commit 2f552a5

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

core/src/main/scala/org/apache/spark/Dependency.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ class ShuffleDependency[K, V, C](
6666
val ascending: Boolean = true)
6767
extends Dependency(rdd.asInstanceOf[RDD[Product2[K, V]]]) {
6868

69-
def isKeySorted = keyOrdering.isDefined
70-
7169
val shuffleId: Int = rdd.context.newShuffleId()
7270

7371
val shuffleHandle: ShuffleHandle = rdd.context.env.shuffleManager.registerShuffle(

core/src/main/scala/org/apache/spark/rdd/OrderedRDDFunctions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@ class OrderedRDDFunctions[K : Ordering : ClassTag,
5959
val part = new RangePartitioner(numPartitions, self, ascending)
6060
new ShuffledRDD[K, V, V, P](self, part)
6161
.setKeyOrdering(ordering)
62-
.setAscendingFlag(ascending)
62+
.setSortFlag(ascending)
6363
}
6464
}

core/src/main/scala/org/apache/spark/rdd/ShuffledRDD.scala

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,6 @@ class ShuffledRDD[K, V, C, P <: Product2[K, C] : ClassTag](
6565
this
6666
}
6767

68-
def setAscendingFlag(ascending: Boolean): ShuffledRDD[K, V, C, P] = {
69-
this.ascending = ascending
70-
this
71-
}
72-
7368
/** Set aggregator for RDD's shuffle. */
7469
def setAggregator(aggregator: Aggregator[K, V, C]): ShuffledRDD[K, V, C, P] = {
7570
this.aggregator = Option(aggregator)
@@ -82,6 +77,12 @@ class ShuffledRDD[K, V, C, P <: Product2[K, C] : ClassTag](
8277
this
8378
}
8479

80+
/** Set sort flag for RDD's sorting. */
81+
def setSortFlag(ascending: Boolean): ShuffledRDD[K, V, C, P] = {
82+
this.ascending = ascending
83+
this
84+
}
85+
8586
override def getDependencies: Seq[Dependency[_]] = {
8687
List(new ShuffleDependency(prev, part, serializer,
8788
keyOrdering, aggregator, mapSideCombine, ascending))

0 commit comments

Comments
 (0)