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
7fa6978a
Commit
7fa6978a
authored
11 years ago
by
Mridul Muralidharan
Browse files
Options
Downloads
Patches
Plain Diff
Allow CheckpointWriter pending tasks to finish
parent
00c7a376
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
streaming/src/main/scala/spark/streaming/Checkpoint.scala
+7
-6
7 additions, 6 deletions
streaming/src/main/scala/spark/streaming/Checkpoint.scala
streaming/src/main/scala/spark/streaming/DStreamGraph.scala
+1
-1
1 addition, 1 deletion
streaming/src/main/scala/spark/streaming/DStreamGraph.scala
with
8 additions
and
7 deletions
streaming/src/main/scala/spark/streaming/Checkpoint.scala
+
7
−
6
View file @
7fa6978a
...
...
@@ -42,7 +42,7 @@ class CheckpointWriter(checkpointDir: String) extends Logging {
private
val
writeFile
=
new
Path
(
file
.
getParent
,
file
.
getName
+
".next"
)
private
val
bakFile
=
new
Path
(
file
.
getParent
,
file
.
getName
+
".bk"
)
@volatile
private
var
stopped
=
false
private
var
stopped
=
false
val
conf
=
new
Configuration
()
var
fs
=
file
.
getFileSystem
(
conf
)
...
...
@@ -57,10 +57,6 @@ class CheckpointWriter(checkpointDir: String) extends Logging {
var
attempts
=
0
val
startTime
=
System
.
currentTimeMillis
()
while
(
attempts
<
maxAttempts
)
{
if
(
stopped
)
{
logInfo
(
"Already stopped, ignore checkpoint attempt for "
+
file
)
return
}
attempts
+=
1
try
{
logDebug
(
"Saving checkpoint for time "
+
checkpointTime
+
" to file '"
+
file
+
"'"
)
...
...
@@ -99,8 +95,13 @@ class CheckpointWriter(checkpointDir: String) extends Logging {
}
def
stop
()
{
stopped
=
true
synchronized
{
if
(
stopped
)
return
;
stopped
=
true
}
executor
.
shutdown
()
val
terminated
=
executor
.
awaitTermination
(
10
,
java
.
util
.
concurrent
.
TimeUnit
.
SECONDS
)
logInfo
(
"CheckpointWriter executor terminated ? "
+
terminated
)
}
}
...
...
This diff is collapsed.
Click to expand it.
streaming/src/main/scala/spark/streaming/DStreamGraph.scala
+
1
−
1
View file @
7fa6978a
...
...
@@ -54,8 +54,8 @@ final private[streaming] class DStreamGraph extends Serializable with Logging {
throw
new
Exception
(
"Batch duration already set as "
+
batchDuration
+
". cannot set it again."
)
}
batchDuration
=
duration
}
batchDuration
=
duration
}
def
remember
(
duration
:
Duration
)
{
...
...
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