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
1f27d94c
Commit
1f27d94c
authored
13 years ago
by
Ismael Juma
Browse files
Options
Downloads
Patches
Plain Diff
Use Array.iterator instead of Iterator.fromArray as the latter is deprecated.
parent
1993a8e5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/src/main/scala/spark/CacheTracker.scala
+3
-3
3 additions, 3 deletions
core/src/main/scala/spark/CacheTracker.scala
core/src/main/scala/spark/RDD.scala
+1
-1
1 addition, 1 deletion
core/src/main/scala/spark/RDD.scala
with
4 additions
and
4 deletions
core/src/main/scala/spark/CacheTracker.scala
+
3
−
3
View file @
1f27d94c
...
@@ -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
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
core/src/main/scala/spark/RDD.scala
+
1
−
1
View file @
1f27d94c
...
@@ -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
}
}
...
...
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