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
273fb5cc
Commit
273fb5cc
authored
12 years ago
by
Charles Reiss
Browse files
Options
Downloads
Patches
Plain Diff
Throw FetchFailedException for cached missing locs
parent
cb867e9f
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/MapOutputTracker.scala
+26
-10
26 additions, 10 deletions
core/src/main/scala/spark/MapOutputTracker.scala
with
26 additions
and
10 deletions
core/src/main/scala/spark/MapOutputTracker.scala
+
26
−
10
View file @
273fb5cc
...
...
@@ -139,8 +139,8 @@ private[spark] class MapOutputTracker(actorSystem: ActorSystem, isMaster: Boolea
case
e
:
InterruptedException
=>
}
}
return
m
apStatuses
.
get
(
shuffleId
).
map
(
status
=>
(
status
.
address
,
MapOutputTracker
.
decompressSize
(
status
.
compressedSizes
(
reduc
eId
))
))
return
MapOutputTracker
.
convertM
apStatuses
(
shuffleId
,
reduceId
,
mapStatuses
.
get
(
shuffl
eId
))
}
else
{
fetching
+=
shuffleId
}
...
...
@@ -156,21 +156,15 @@ private[spark] class MapOutputTracker(actorSystem: ActorSystem, isMaster: Boolea
fetchedStatuses
=
deserializeStatuses
(
fetchedBytes
)
logInfo
(
"Got the output locations"
)
mapStatuses
.
put
(
shuffleId
,
fetchedStatuses
)
if
(
fetchedStatuses
.
contains
(
null
))
{
throw
new
FetchFailedException
(
null
,
shuffleId
,
-
1
,
reduceId
,
new
Exception
(
"Missing an output location for shuffle "
+
shuffleId
))
}
}
finally
{
fetching
.
synchronized
{
fetching
-=
shuffleId
fetching
.
notifyAll
()
}
}
return
fetchedStatuses
.
map
(
s
=>
(
s
.
address
,
MapOutputTracker
.
decompressSize
(
s
.
compressedSizes
(
reduceId
))))
return
MapOutputTracker
.
convertMapStatuses
(
shuffleId
,
reduceId
,
fetchedStatuses
)
}
else
{
return
statuses
.
map
(
s
=>
(
s
.
address
,
MapOutputTracker
.
decompressSize
(
s
.
compressedSizes
(
reduceId
))))
return
MapOutputTracker
.
convertMapStatuses
(
shuffleId
,
reduceId
,
statuses
)
}
}
...
...
@@ -258,6 +252,28 @@ private[spark] class MapOutputTracker(actorSystem: ActorSystem, isMaster: Boolea
private
[
spark
]
object
MapOutputTracker
{
private
val
LOG_BASE
=
1.1
// Convert an array of MapStatuses to locations and sizes for a given reduce ID. If
// any of the statuses is null (indicating a missing location due to a failed mapper),
// throw a FetchFailedException.
def
convertMapStatuses
(
shuffleId
:
Int
,
reduceId
:
Int
,
statuses
:
Array
[
MapStatus
])
:
Array
[(
BlockManagerId
,
Long
)]
=
{
if
(
statuses
==
null
)
{
throw
new
FetchFailedException
(
null
,
shuffleId
,
-
1
,
reduceId
,
new
Exception
(
"Missing all output locations for shuffle "
+
shuffleId
))
}
statuses
.
map
{
status
=>
if
(
status
==
null
)
{
throw
new
FetchFailedException
(
null
,
shuffleId
,
-
1
,
reduceId
,
new
Exception
(
"Missing an output location for shuffle "
+
shuffleId
))
}
else
{
(
status
.
address
,
decompressSize
(
status
.
compressedSizes
(
reduceId
)))
}
}
}
/**
* Compress a size in bytes to 8 bits for efficient reporting of map output sizes.
* We do this by encoding the log base 1.1 of the size as an integer, which can support
...
...
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