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
44c8fb08
Commit
44c8fb08
authored
14 years ago
by
Mosharaf Chowdhury
Browse files
Options
Downloads
Patches
Plain Diff
Fixed closing order of of some of the i/o streams. Bugs remain.
parent
f8599410
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
src/scala/spark/TrackedCustomParallelLocalFileShuffle.scala
+22
-14
22 additions, 14 deletions
src/scala/spark/TrackedCustomParallelLocalFileShuffle.scala
with
22 additions
and
14 deletions
src/scala/spark/TrackedCustomParallelLocalFileShuffle.scala
+
22
−
14
View file @
44c8fb08
...
...
@@ -507,8 +507,8 @@ extends Shuffle[K, V, C] with Logging {
logInfo
(
"sendLeavingNotification had a "
+
e
)
}
}
finally
{
oosTracker
.
close
()
oisTracker
.
close
()
oosTracker
.
close
()
clientSocketToTracker
.
close
()
}
}
...
...
@@ -541,36 +541,40 @@ trait ShuffleTrackerStrategy {
class
BalanceConnectionsShuffleTrackerStrategy
extends
ShuffleTrackerStrategy
with
Logging
{
var
outputLocs
:
Array
[
SplitInfo
]
=
null
var
numConnectionsPerLoc
:
Array
[
Int
]
=
null
var
curConnectionsPerLoc
:
Array
[
Int
]
=
null
var
totalConnectionsPerLoc
:
Array
[
Int
]
=
null
def
initialize
(
outputLocs_
:
Array
[
SplitInfo
])
:
Unit
=
{
outputLocs
=
outputLocs_
// Now initialize other data structures
numConnectionsPerLoc
=
Array
.
tabulate
(
outputLocs
.
size
)(
_
=>
0
)
curConnectionsPerLoc
=
Array
.
tabulate
(
outputLocs
.
size
)(
_
=>
0
)
totalConnectionsPerLoc
=
Array
.
tabulate
(
outputLocs
.
size
)(
_
=>
0
)
}
def
selectSplitAndAddReducer
(
reducerSplitInfo
:
SplitInfo
)
:
Int
=
synchronized
{
var
minConnections
=
Int
.
MaxValue
var
splitIndex
=
-
1
for
(
i
<-
0
until
num
ConnectionsPerLoc
.
size
)
{
for
(
i
<-
0
until
cur
ConnectionsPerLoc
.
size
)
{
// TODO: Use of MaxRxConnections instead of MaxTxConnections is
// intentional here. MaxTxConnections is per machine whereas
// MaxRxConnections is per mapper/reducer. Will have to find a better way.
if
(
num
ConnectionsPerLoc
(
i
)
<
TrackedCustomParallelLocalFileShuffle
.
MaxRxConnections
&&
num
ConnectionsPerLoc
(
i
)
<
minConnections
&&
if
(
cur
ConnectionsPerLoc
(
i
)
<
TrackedCustomParallelLocalFileShuffle
.
MaxRxConnections
&&
total
ConnectionsPerLoc
(
i
)
<
minConnections
&&
!
reducerSplitInfo
.
hasSplitsBitVector
.
get
(
i
))
{
minConnections
=
num
ConnectionsPerLoc
(
i
)
minConnections
=
total
ConnectionsPerLoc
(
i
)
splitIndex
=
i
}
}
if
(
splitIndex
!=
-
1
)
{
numConnectionsPerLoc
(
splitIndex
)
=
numConnectionsPerLoc
(
splitIndex
)
+
1
curConnectionsPerLoc
(
splitIndex
)
=
curConnectionsPerLoc
(
splitIndex
)
+
1
totalConnectionsPerLoc
(
splitIndex
)
=
totalConnectionsPerLoc
(
splitIndex
)
+
1
num
ConnectionsPerLoc
.
foreach
{
i
=>
total
ConnectionsPerLoc
.
foreach
{
i
=>
print
(
""
+
i
+
" "
)
}
println
(
""
)
...
...
@@ -581,16 +585,20 @@ extends ShuffleTrackerStrategy with Logging {
def
deleteReducerFrom
(
reducerSplitInfo
:
SplitInfo
,
serverSplitIndex
:
Int
)
:
Unit
=
synchronized
{
assert
(
numConnectionsPerLoc
(
serverSplitIndex
)
>
0
)
// Decrease number of active connections
num
ConnectionsPerLoc
(
serverSplitIndex
)
=
num
ConnectionsPerLoc
(
serverSplitIndex
)
-
1
cur
ConnectionsPerLoc
(
serverSplitIndex
)
=
cur
ConnectionsPerLoc
(
serverSplitIndex
)
-
1
num
ConnectionsPerLoc
.
foreach
{
i
=>
total
ConnectionsPerLoc
.
foreach
{
i
=>
print
(
""
+
i
+
" "
)
}
println
(
""
)
// TODO: Remove this once the bug is fixed
if
(
curConnectionsPerLoc
(
serverSplitIndex
)
<
0
)
{
curConnectionsPerLoc
(
serverSplitIndex
)
=
0
}
}
}
...
...
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