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
21b271f5
Commit
21b271f5
authored
12 years ago
by
Reynold Xin
Browse files
Options
Downloads
Patches
Plain Diff
Suppress shuffle block updates when a slave node comes back.
parent
c10b2299
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
core/src/main/scala/spark/storage/BlockManager.scala
+14
-9
14 additions, 9 deletions
core/src/main/scala/spark/storage/BlockManager.scala
core/src/main/scala/spark/storage/BlockManagerMaster.scala
+3
-3
3 additions, 3 deletions
core/src/main/scala/spark/storage/BlockManagerMaster.scala
with
17 additions
and
12 deletions
core/src/main/scala/spark/storage/BlockManager.scala
+
14
−
9
View file @
21b271f5
...
@@ -47,7 +47,7 @@ private[spark] class BlockManagerId(var ip: String, var port: Int) extends Exter
...
@@ -47,7 +47,7 @@ private[spark] class BlockManagerId(var ip: String, var port: Int) extends Exter
}
}
}
}
private
[
spark
]
private
[
spark
]
case
class
BlockException
(
blockId
:
String
,
message
:
String
,
ex
:
Exception
=
null
)
case
class
BlockException
(
blockId
:
String
,
message
:
String
,
ex
:
Exception
=
null
)
extends
Exception
(
message
)
extends
Exception
(
message
)
...
@@ -200,31 +200,36 @@ class BlockManager(actorSystem: ActorSystem, val master: BlockManagerMaster,
...
@@ -200,31 +200,36 @@ class BlockManager(actorSystem: ActorSystem, val master: BlockManagerMaster,
}
}
/**
/**
* Actually send a BlockUpdate message. Returns the mater's re
p
sonse, which will be true if the
o
* Actually send a BlockUpdate message. Returns the mater's res
p
onse, which will be true if the
* block was successfully recorded and false if the slave needs to reregister.
* block was successfully recorded and false if the slave needs to re
-
register.
*/
*/
private
def
tryToReportBlockStatus
(
blockId
:
String
)
:
Boolean
=
{
private
def
tryToReportBlockStatus
(
blockId
:
String
)
:
Boolean
=
{
val
(
curLevel
,
inMemSize
,
onDiskSize
)
=
blockInfo
.
get
(
blockId
)
match
{
val
(
curLevel
,
inMemSize
,
onDiskSize
,
tellMaster
)
=
blockInfo
.
get
(
blockId
)
match
{
case
null
=>
case
null
=>
(
StorageLevel
.
NONE
,
0L
,
0L
)
(
StorageLevel
.
NONE
,
0L
,
0L
,
false
)
case
info
=>
case
info
=>
info
.
synchronized
{
info
.
synchronized
{
info
.
level
match
{
info
.
level
match
{
case
null
=>
case
null
=>
(
StorageLevel
.
NONE
,
0L
,
0L
)
(
StorageLevel
.
NONE
,
0L
,
0L
,
false
)
case
level
=>
case
level
=>
val
inMem
=
level
.
useMemory
&&
memoryStore
.
contains
(
blockId
)
val
inMem
=
level
.
useMemory
&&
memoryStore
.
contains
(
blockId
)
val
onDisk
=
level
.
useDisk
&&
diskStore
.
contains
(
blockId
)
val
onDisk
=
level
.
useDisk
&&
diskStore
.
contains
(
blockId
)
(
(
new
StorageLevel
(
onDisk
,
inMem
,
level
.
deserialized
,
level
.
replication
),
new
StorageLevel
(
onDisk
,
inMem
,
level
.
deserialized
,
level
.
replication
),
if
(
inMem
)
memoryStore
.
getSize
(
blockId
)
else
0L
,
if
(
inMem
)
memoryStore
.
getSize
(
blockId
)
else
0L
,
if
(
onDisk
)
diskStore
.
getSize
(
blockId
)
else
0L
if
(
onDisk
)
diskStore
.
getSize
(
blockId
)
else
0L
,
info
.
tellMaster
)
)
}
}
}
}
}
}
return
master
.
mustBlockUpdate
(
BlockUpdate
(
blockManagerId
,
blockId
,
curLevel
,
inMemSize
,
onDiskSize
))
if
(
tellMaster
)
{
master
.
mustBlockUpdate
(
BlockUpdate
(
blockManagerId
,
blockId
,
curLevel
,
inMemSize
,
onDiskSize
))
}
else
{
true
}
}
}
...
...
This diff is collapsed.
Click to expand it.
core/src/main/scala/spark/storage/BlockManagerMaster.scala
+
3
−
3
View file @
21b271f5
...
@@ -215,7 +215,7 @@ private[spark] class BlockManagerMasterActor(val isLocal: Boolean) extends Actor
...
@@ -215,7 +215,7 @@ private[spark] class BlockManagerMasterActor(val isLocal: Boolean) extends Actor
val
toRemove
=
new
HashSet
[
BlockManagerId
]
val
toRemove
=
new
HashSet
[
BlockManagerId
]
for
(
info
<-
blockManagerInfo
.
values
)
{
for
(
info
<-
blockManagerInfo
.
values
)
{
if
(
info
.
lastSeenMs
<
minSeenTime
)
{
if
(
info
.
lastSeenMs
<
minSeenTime
)
{
log
Info
(
"Removing BlockManager "
+
info
.
blockManagerId
+
" with no recent heart beats"
)
log
Warning
(
"Removing BlockManager "
+
info
.
blockManagerId
+
" with no recent heart beats"
)
toRemove
+=
info
.
blockManagerId
toRemove
+=
info
.
blockManagerId
}
}
}
}
...
@@ -279,7 +279,7 @@ private[spark] class BlockManagerMasterActor(val isLocal: Boolean) extends Actor
...
@@ -279,7 +279,7 @@ private[spark] class BlockManagerMasterActor(val isLocal: Boolean) extends Actor
case
ExpireDeadHosts
=>
case
ExpireDeadHosts
=>
expireDeadHosts
()
expireDeadHosts
()
case
HeartBeat
(
blockManagerId
)
=>
case
HeartBeat
(
blockManagerId
)
=>
heartBeat
(
blockManagerId
)
heartBeat
(
blockManagerId
)
case
other
=>
case
other
=>
...
@@ -538,7 +538,7 @@ private[spark] class BlockManagerMaster(actorSystem: ActorSystem, isMaster: Bool
...
@@ -538,7 +538,7 @@ private[spark] class BlockManagerMaster(actorSystem: ActorSystem, isMaster: Bool
val
answer
=
askMaster
(
msg
).
asInstanceOf
[
Boolean
]
val
answer
=
askMaster
(
msg
).
asInstanceOf
[
Boolean
]
return
Some
(
answer
)
return
Some
(
answer
)
}
catch
{
}
catch
{
case
e
:
Exception
=>
case
e
:
Exception
=>
logError
(
"Failed in syncHeartBeat"
,
e
)
logError
(
"Failed in syncHeartBeat"
,
e
)
return
None
return
None
}
}
...
...
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