Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
spark
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cs525-sp18-g07
spark
Commits
6738178d
Commit
6738178d
authored
11 years ago
by
Reynold Xin
Browse files
Options
Downloads
Patches
Plain Diff
SPARK-772: groupByKey should disable map side combine.
parent
d93851ae
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/src/main/scala/spark/PairRDDFunctions.scala
+5
-3
5 additions, 3 deletions
core/src/main/scala/spark/PairRDDFunctions.scala
with
5 additions
and
3 deletions
core/src/main/scala/spark/PairRDDFunctions.scala
+
5
−
3
View file @
6738178d
...
...
@@ -19,7 +19,7 @@ import org.apache.hadoop.mapred.JobConf
import
org.apache.hadoop.mapred.OutputFormat
import
org.apache.hadoop.mapreduce.lib.output.
{
FileOutputFormat
=>
NewFileOutputFormat
}
import
org.apache.hadoop.mapreduce.
{
OutputFormat
=>
NewOutputFormat
,
RecordWriter
=>
NewRecordWriter
,
Job
=>
NewAPIHadoopJob
,
HadoopMapReduceUtil
,
TaskAttemptID
,
TaskAttemptContext
}
import
org.apache.hadoop.mapreduce.
{
OutputFormat
=>
NewOutputFormat
,
RecordWriter
=>
NewRecordWriter
,
Job
=>
NewAPIHadoopJob
,
HadoopMapReduceUtil
}
import
spark.partial.BoundedDouble
import
spark.partial.PartialResult
...
...
@@ -187,11 +187,13 @@ class PairRDDFunctions[K: ClassManifest, V: ClassManifest](
* partitioning of the resulting key-value pair RDD by passing a Partitioner.
*/
def
groupByKey
(
partitioner
:
Partitioner
)
:
RDD
[(
K
,
Seq
[
V
])]
=
{
// groupByKey shouldn't use map side combine because map side combine does not
// reduce the amount of data shuffled and requires all map side data be inserted
// into a hash table, leading to more objects in the old gen.
def
createCombiner
(
v
:
V
)
=
ArrayBuffer
(
v
)
def
mergeValue
(
buf
:
ArrayBuffer
[
V
],
v
:
V
)
=
buf
+=
v
def
mergeCombiners
(
b1
:
ArrayBuffer
[
V
],
b2
:
ArrayBuffer
[
V
])
=
b1
++=
b2
val
bufs
=
combineByKey
[
ArrayBuffer
[
V
]](
createCombiner
_
,
mergeValue
_
,
mergeCombiners
_
,
partitioner
)
createCombiner
_
,
mergeValue
_
,
null
,
partitioner
,
mapSideCombine
=
false
)
bufs
.
asInstanceOf
[
RDD
[(
K
,
Seq
[
V
])]]
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment