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
6e6b5204
Commit
6e6b5204
authored
12 years ago
by
Matei Zaharia
Browse files
Options
Downloads
Patches
Plain Diff
Create an empty directory when checkpointing a 0-partition RDD (fixes a
test failure on Hadoop 2.0)
parent
eef9ea19
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/src/main/scala/spark/RDDCheckpointData.scala
+11
-4
11 additions, 4 deletions
core/src/main/scala/spark/RDDCheckpointData.scala
with
11 additions
and
4 deletions
core/src/main/scala/spark/RDDCheckpointData.scala
+
11
−
4
View file @
6e6b5204
package
spark
import
org.apache.hadoop.fs.Path
import
org.apache.hadoop.conf.Configuration
import
rdd.
{
CheckpointRDD
,
CoalescedRDD
}
import
scheduler.
{
ResultTask
,
ShuffleMapTask
}
...
...
@@ -62,14 +63,20 @@ private[spark] class RDDCheckpointData[T: ClassManifest](rdd: RDD[T])
}
}
// Create the output path for the checkpoint
val
path
=
new
Path
(
rdd
.
context
.
checkpointDir
.
get
,
"rdd-"
+
rdd
.
id
)
val
fs
=
path
.
getFileSystem
(
new
Configuration
())
if
(!
fs
.
mkdirs
(
path
))
{
throw
new
SparkException
(
"Failed to create checkpoint path "
+
path
)
}
// Save to file, and reload it as an RDD
val
path
=
new
Path
(
rdd
.
context
.
checkpointDir
.
get
,
"rdd-"
+
rdd
.
id
).
toString
rdd
.
context
.
runJob
(
rdd
,
CheckpointRDD
.
writeToFile
(
path
)
_
)
val
newRDD
=
new
CheckpointRDD
[
T
](
rdd
.
context
,
path
)
rdd
.
context
.
runJob
(
rdd
,
CheckpointRDD
.
writeToFile
(
path
.
toString
)
_
)
val
newRDD
=
new
CheckpointRDD
[
T
](
rdd
.
context
,
path
.
toString
)
// Change the dependencies and partitions of the RDD
RDDCheckpointData
.
synchronized
{
cpFile
=
Some
(
path
)
cpFile
=
Some
(
path
.
toString
)
cpRDD
=
Some
(
newRDD
)
rdd
.
markCheckpointed
(
newRDD
)
// Update the RDD's dependencies and partitions
cpState
=
Checkpointed
...
...
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