Skip to content
Snippets Groups Projects
Commit 1f27d94c authored by Ismael Juma's avatar Ismael Juma
Browse files

Use Array.iterator instead of Iterator.fromArray as the latter is deprecated.

parent 1993a8e5
No related branches found
No related tags found
No related merge requests found
...@@ -111,7 +111,7 @@ class CacheTracker(isMaster: Boolean, theCache: Cache) extends Logging { ...@@ -111,7 +111,7 @@ class CacheTracker(isMaster: Boolean, theCache: Cache) extends Logging {
if (cachedVal != null) { if (cachedVal != null) {
// Split is in cache, so just return its values // Split is in cache, so just return its values
logInfo("Found partition in cache!") logInfo("Found partition in cache!")
return Iterator.fromArray(cachedVal.asInstanceOf[Array[T]]) return cachedVal.asInstanceOf[Array[T]].iterator
} else { } else {
// Mark the split as loading (unless someone else marks it first) // Mark the split as loading (unless someone else marks it first)
loading.synchronized { loading.synchronized {
...@@ -119,7 +119,7 @@ class CacheTracker(isMaster: Boolean, theCache: Cache) extends Logging { ...@@ -119,7 +119,7 @@ class CacheTracker(isMaster: Boolean, theCache: Cache) extends Logging {
while (loading.contains(key)) { while (loading.contains(key)) {
try {loading.wait()} catch {case _ =>} try {loading.wait()} catch {case _ =>}
} }
return Iterator.fromArray(cache.get(key).asInstanceOf[Array[T]]) return cache.get(key).asInstanceOf[Array[T]].iterator
} else { } else {
loading.add(key) loading.add(key)
} }
...@@ -138,7 +138,7 @@ class CacheTracker(isMaster: Boolean, theCache: Cache) extends Logging { ...@@ -138,7 +138,7 @@ class CacheTracker(isMaster: Boolean, theCache: Cache) extends Logging {
loading.notifyAll() loading.notifyAll()
} }
future.apply() // Wait for the reply from the cache tracker future.apply() // Wait for the reply from the cache tracker
return Iterator.fromArray(array) return array.iterator
} }
} }
......
...@@ -178,7 +178,7 @@ class SplitRDD[T: ClassManifest](prev: RDD[T]) ...@@ -178,7 +178,7 @@ class SplitRDD[T: ClassManifest](prev: RDD[T])
extends RDD[Array[T]](prev.context) { extends RDD[Array[T]](prev.context) {
override def splits = prev.splits override def splits = prev.splits
override val dependencies = List(new OneToOneDependency(prev)) override val dependencies = List(new OneToOneDependency(prev))
override def compute(split: Split) = Iterator.fromArray(Array(prev.iterator(split).toArray)) override def compute(split: Split) = Array(prev.iterator(split).toArray).iterator
} }
......
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