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
6d28dde3
Commit
6d28dde3
authored
12 years ago
by
root
Browse files
Options
Downloads
Patches
Plain Diff
Rename our toIterator method into asIterator to prevent confusion with the
Scala collection one, which often *copies* a collection.
parent
a642051a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/src/main/scala/spark/Serializer.scala
+2
-2
2 additions, 2 deletions
core/src/main/scala/spark/Serializer.scala
core/src/main/scala/spark/storage/BlockManager.scala
+2
-3
2 additions, 3 deletions
core/src/main/scala/spark/storage/BlockManager.scala
with
4 additions
and
5 deletions
core/src/main/scala/spark/Serializer.scala
+
2
−
2
View file @
6d28dde3
...
...
@@ -43,7 +43,7 @@ trait SerializerInstance {
def
deserializeMany
(
buffer
:
ByteBuffer
)
:
Iterator
[
Any
]
=
{
// Default implementation uses deserializeStream
buffer
.
rewind
()
deserializeStream
(
new
ByteBufferInputStream
(
buffer
)).
to
Iterator
deserializeStream
(
new
ByteBufferInputStream
(
buffer
)).
as
Iterator
}
}
...
...
@@ -74,7 +74,7 @@ trait DeserializationStream {
* Read the elements of this stream through an iterator. This can only be called once, as
* reading each element will consume data from the input source.
*/
def
to
Iterator
:
Iterator
[
Any
]
=
new
Iterator
[
Any
]
{
def
as
Iterator
:
Iterator
[
Any
]
=
new
Iterator
[
Any
]
{
var
gotNext
=
false
var
finished
=
false
var
nextValue
:
Any
=
null
...
...
This diff is collapsed.
Click to expand it.
core/src/main/scala/spark/storage/BlockManager.scala
+
2
−
3
View file @
6d28dde3
...
...
@@ -614,10 +614,9 @@ class BlockManager(val master: BlockManagerMaster, val serializer: Serializer, m
}
def
dataDeserialize
(
bytes
:
ByteBuffer
)
:
Iterator
[
Any
]
=
{
/*serializer.newInstance().deserializeMany(bytes)*/
val
ser
=
serializer
.
newInstance
()
bytes
.
rewind
()
return
ser
.
deserializeStream
(
new
ByteBufferInputStream
(
bytes
)).
toIterator
val
ser
=
serializer
.
newInstance
()
return
ser
.
deserializeStream
(
new
ByteBufferInputStream
(
bytes
)).
asIterator
}
def
stop
()
{
...
...
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