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
4f609f79
Commit
4f609f79
authored
11 years ago
by
Tathagata Das
Browse files
Options
Downloads
Patches
Plain Diff
Removed spark.hostPort and other setting from SparkConf before saving to checkpoint.
parent
d7ec73ac
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
streaming/src/main/scala/org/apache/spark/streaming/Checkpoint.scala
+6
-18
6 additions, 18 deletions
...rc/main/scala/org/apache/spark/streaming/Checkpoint.scala
with
6 additions
and
18 deletions
streaming/src/main/scala/org/apache/spark/streaming/Checkpoint.scala
+
6
−
18
View file @
4f609f79
...
@@ -43,6 +43,9 @@ class Checkpoint(@transient ssc: StreamingContext, val checkpointTime: Time)
...
@@ -43,6 +43,9 @@ class Checkpoint(@transient ssc: StreamingContext, val checkpointTime: Time)
val
pendingTimes
=
ssc
.
scheduler
.
getPendingTimes
()
val
pendingTimes
=
ssc
.
scheduler
.
getPendingTimes
()
val
delaySeconds
=
MetadataCleaner
.
getDelaySeconds
(
ssc
.
conf
)
val
delaySeconds
=
MetadataCleaner
.
getDelaySeconds
(
ssc
.
conf
)
val
sparkConf
=
ssc
.
conf
val
sparkConf
=
ssc
.
conf
// do not save these configurations
sparkConf
.
remove
(
"spark.hostPort"
).
remove
(
"spark.driver.host"
).
remove
(
"spark.driver.port"
)
def
validate
()
{
def
validate
()
{
assert
(
master
!=
null
,
"Checkpoint.master is null"
)
assert
(
master
!=
null
,
"Checkpoint.master is null"
)
...
@@ -73,11 +76,7 @@ object Checkpoint extends Logging {
...
@@ -73,11 +76,7 @@ object Checkpoint extends Logging {
def
sortFunc
(
path1
:
Path
,
path2
:
Path
)
:
Boolean
=
{
def
sortFunc
(
path1
:
Path
,
path2
:
Path
)
:
Boolean
=
{
val
(
time1
,
bk1
)
=
path1
.
getName
match
{
case
REGEX
(
x
,
y
)
=>
(
x
.
toLong
,
!
y
.
isEmpty
)
}
val
(
time1
,
bk1
)
=
path1
.
getName
match
{
case
REGEX
(
x
,
y
)
=>
(
x
.
toLong
,
!
y
.
isEmpty
)
}
val
(
time2
,
bk2
)
=
path2
.
getName
match
{
case
REGEX
(
x
,
y
)
=>
(
x
.
toLong
,
!
y
.
isEmpty
)
}
val
(
time2
,
bk2
)
=
path2
.
getName
match
{
case
REGEX
(
x
,
y
)
=>
(
x
.
toLong
,
!
y
.
isEmpty
)
}
logInfo
(
"Path 1: "
+
path1
+
" -> "
+
time1
+
", "
+
bk1
)
(
time1
<
time2
)
||
(
time1
==
time2
&&
bk1
)
logInfo
(
"Path 2: "
+
path2
+
" -> "
+
time2
+
", "
+
bk2
)
val
precede
=
(
time1
<
time2
)
||
(
time1
==
time2
&&
bk1
)
logInfo
(
precede
.
toString
)
precede
}
}
val
path
=
new
Path
(
checkpointDir
)
val
path
=
new
Path
(
checkpointDir
)
...
@@ -85,12 +84,8 @@ object Checkpoint extends Logging {
...
@@ -85,12 +84,8 @@ object Checkpoint extends Logging {
val
statuses
=
fs
.
listStatus
(
path
)
val
statuses
=
fs
.
listStatus
(
path
)
if
(
statuses
!=
null
)
{
if
(
statuses
!=
null
)
{
val
paths
=
statuses
.
map
(
_
.
getPath
)
val
paths
=
statuses
.
map
(
_
.
getPath
)
logInfo
(
"Paths = "
+
paths
.
map
(
_
.
getName
).
mkString
(
", "
))
val
filtered
=
paths
.
filter
(
p
=>
REGEX
.
findFirstIn
(
p
.
toString
).
nonEmpty
)
val
filtered
=
paths
.
filter
(
p
=>
REGEX
.
findFirstIn
(
p
.
toString
).
nonEmpty
)
logInfo
(
"Filtered paths = "
+
filtered
.
map
(
_
.
getName
).
mkString
(
", "
))
filtered
.
sortWith
(
sortFunc
)
val
sorted
=
filtered
.
sortWith
(
sortFunc
)
logInfo
(
"Sorted paths = "
+
sorted
.
map
(
_
.
getName
).
mkString
(
", "
))
sorted
}
else
{
}
else
{
logWarning
(
"Listing "
+
path
+
" returned null"
)
logWarning
(
"Listing "
+
path
+
" returned null"
)
Seq
.
empty
Seq
.
empty
...
@@ -112,16 +107,9 @@ class CheckpointWriter(jobGenerator: JobGenerator, conf: SparkConf, checkpointDi
...
@@ -112,16 +107,9 @@ class CheckpointWriter(jobGenerator: JobGenerator, conf: SparkConf, checkpointDi
val
MAX_ATTEMPTS
=
3
val
MAX_ATTEMPTS
=
3
val
executor
=
Executors
.
newFixedThreadPool
(
1
)
val
executor
=
Executors
.
newFixedThreadPool
(
1
)
val
compressionCodec
=
CompressionCodec
.
createCodec
(
conf
)
val
compressionCodec
=
CompressionCodec
.
createCodec
(
conf
)
// The file to which we actually write - and then "move" to file
// val writeFile = new Path(file.getParent, file.getName + ".next")
// The file to which existing checkpoint is backed up (i.e. "moved")
// val bakFile = new Path(file.getParent, file.getName + ".bk")
private
var
stopped
=
false
private
var
stopped
=
false
private
var
fs_
:
FileSystem
=
_
private
var
fs_
:
FileSystem
=
_
// Removed code which validates whether there is only one CheckpointWriter per path 'file' since
// I did not notice any errors - reintroduce it ?
class
CheckpointWriteHandler
(
checkpointTime
:
Time
,
bytes
:
Array
[
Byte
])
extends
Runnable
{
class
CheckpointWriteHandler
(
checkpointTime
:
Time
,
bytes
:
Array
[
Byte
])
extends
Runnable
{
def
run
()
{
def
run
()
{
var
attempts
=
0
var
attempts
=
0
...
@@ -189,7 +177,7 @@ class CheckpointWriter(jobGenerator: JobGenerator, conf: SparkConf, checkpointDi
...
@@ -189,7 +177,7 @@ class CheckpointWriter(jobGenerator: JobGenerator, conf: SparkConf, checkpointDi
bos
.
close
()
bos
.
close
()
try
{
try
{
executor
.
execute
(
new
CheckpointWriteHandler
(
checkpoint
.
checkpointTime
,
bos
.
toByteArray
))
executor
.
execute
(
new
CheckpointWriteHandler
(
checkpoint
.
checkpointTime
,
bos
.
toByteArray
))
log
Info
(
"Submitted checkpoint of time "
+
checkpoint
.
checkpointTime
+
" writer queue"
)
log
Debug
(
"Submitted checkpoint of time "
+
checkpoint
.
checkpointTime
+
" writer queue"
)
}
catch
{
}
catch
{
case
rej
:
RejectedExecutionException
=>
case
rej
:
RejectedExecutionException
=>
logError
(
"Could not submit checkpoint task to the thread pool executor"
,
rej
)
logError
(
"Could not submit checkpoint task to the thread pool executor"
,
rej
)
...
...
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