Skip to content
Snippets Groups Projects
Commit 6d28dde3 authored by root's avatar root
Browse files

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
...@@ -43,7 +43,7 @@ trait SerializerInstance { ...@@ -43,7 +43,7 @@ trait SerializerInstance {
def deserializeMany(buffer: ByteBuffer): Iterator[Any] = { def deserializeMany(buffer: ByteBuffer): Iterator[Any] = {
// Default implementation uses deserializeStream // Default implementation uses deserializeStream
buffer.rewind() buffer.rewind()
deserializeStream(new ByteBufferInputStream(buffer)).toIterator deserializeStream(new ByteBufferInputStream(buffer)).asIterator
} }
} }
...@@ -74,7 +74,7 @@ trait DeserializationStream { ...@@ -74,7 +74,7 @@ trait DeserializationStream {
* Read the elements of this stream through an iterator. This can only be called once, as * 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. * reading each element will consume data from the input source.
*/ */
def toIterator: Iterator[Any] = new Iterator[Any] { def asIterator: Iterator[Any] = new Iterator[Any] {
var gotNext = false var gotNext = false
var finished = false var finished = false
var nextValue: Any = null var nextValue: Any = null
......
...@@ -614,10 +614,9 @@ class BlockManager(val master: BlockManagerMaster, val serializer: Serializer, m ...@@ -614,10 +614,9 @@ class BlockManager(val master: BlockManagerMaster, val serializer: Serializer, m
} }
def dataDeserialize(bytes: ByteBuffer): Iterator[Any] = { def dataDeserialize(bytes: ByteBuffer): Iterator[Any] = {
/*serializer.newInstance().deserializeMany(bytes)*/
val ser = serializer.newInstance()
bytes.rewind() bytes.rewind()
return ser.deserializeStream(new ByteBufferInputStream(bytes)).toIterator val ser = serializer.newInstance()
return ser.deserializeStream(new ByteBufferInputStream(bytes)).asIterator
} }
def stop() { def stop() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment