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
7449ecfb
Commit
7449ecfb
authored
13 years ago
by
Matei Zaharia
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of github.com:mesos/spark
parents
100e8007
72d2489b
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/KryoSerializer.scala
+10
-0
10 additions, 0 deletions
core/src/main/scala/spark/KryoSerializer.scala
with
10 additions
and
0 deletions
core/src/main/scala/spark/KryoSerializer.scala
+
10
−
0
View file @
7449ecfb
...
...
@@ -180,6 +180,16 @@ class KryoSerializer extends Serializer with Logging {
kryo
.
register
(
mutable
.
HashMap
().
getClass
,
new
ScalaMapSerializer
(
mutable
.
HashMap
()
++
_
))
// TODO: add support for immutable maps too; this is more annoying because there are many
// subclasses of immutable.Map for small maps (with <= 4 entries)
val
map1
=
Map
[
Any
,
Any
](
1
->
1
)
val
map2
=
Map
[
Any
,
Any
](
1
->
1
,
2
->
2
)
val
map3
=
Map
[
Any
,
Any
](
1
->
1
,
2
->
2
,
3
->
3
)
val
map4
=
Map
[
Any
,
Any
](
1
->
1
,
2
->
2
,
3
->
3
,
4
->
4
)
val
map5
=
Map
[
Any
,
Any
](
1
->
1
,
2
->
2
,
3
->
3
,
4
->
4
,
5
->
5
)
kryo
.
register
(
map1
.
getClass
,
new
ScalaMapSerializer
(
mutable
.
HashMap
()
++
_
toMap
))
kryo
.
register
(
map2
.
getClass
,
new
ScalaMapSerializer
(
mutable
.
HashMap
()
++
_
toMap
))
kryo
.
register
(
map3
.
getClass
,
new
ScalaMapSerializer
(
mutable
.
HashMap
()
++
_
toMap
))
kryo
.
register
(
map4
.
getClass
,
new
ScalaMapSerializer
(
mutable
.
HashMap
()
++
_
toMap
))
kryo
.
register
(
map5
.
getClass
,
new
ScalaMapSerializer
(
mutable
.
HashMap
()
++
_
toMap
))
// Allow the user to register their own classes by setting spark.kryo.registrator
val
regCls
=
System
.
getProperty
(
"spark.kryo.registrator"
)
...
...
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