aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root@ip-10-8-51-66.ec2.internal>2012-09-21 06:02:55 +0000
committerroot <root@ip-10-8-51-66.ec2.internal>2012-09-21 06:02:55 +0000
commit6d28dde37041a7794e4da17bb92ca387e693a96a (patch)
tree54dc4e318b08ea6bb23caa08b1a6636ad9bdc6d3
parenta642051ade11d10d7ab26a44bdf7acc743fefc97 (diff)
downloadspark-6d28dde37041a7794e4da17bb92ca387e693a96a.tar.gz
spark-6d28dde37041a7794e4da17bb92ca387e693a96a.tar.bz2
spark-6d28dde37041a7794e4da17bb92ca387e693a96a.zip
Rename our toIterator method into asIterator to prevent confusion with the
Scala collection one, which often *copies* a collection.
-rw-r--r--core/src/main/scala/spark/Serializer.scala4
-rw-r--r--core/src/main/scala/spark/storage/BlockManager.scala5
2 files changed, 4 insertions, 5 deletions
diff --git a/core/src/main/scala/spark/Serializer.scala b/core/src/main/scala/spark/Serializer.scala
index 61a70beaf1..5f26bd2a7b 100644
--- a/core/src/main/scala/spark/Serializer.scala
+++ b/core/src/main/scala/spark/Serializer.scala
@@ -43,7 +43,7 @@ trait SerializerInstance {
def deserializeMany(buffer: ByteBuffer): Iterator[Any] = {
// Default implementation uses deserializeStream
buffer.rewind()
- deserializeStream(new ByteBufferInputStream(buffer)).toIterator
+ deserializeStream(new ByteBufferInputStream(buffer)).asIterator
}
}
@@ -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 toIterator: Iterator[Any] = new Iterator[Any] {
+ def asIterator: Iterator[Any] = new Iterator[Any] {
var gotNext = false
var finished = false
var nextValue: Any = null
diff --git a/core/src/main/scala/spark/storage/BlockManager.scala b/core/src/main/scala/spark/storage/BlockManager.scala
index 3a51f6bd96..550c937ac4 100644
--- a/core/src/main/scala/spark/storage/BlockManager.scala
+++ b/core/src/main/scala/spark/storage/BlockManager.scala
@@ -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() {