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
92d2a9a1
Commit
92d2a9a1
authored
14 years ago
by
Mosharaf Chowdhury
Browse files
Options
Downloads
Patches
Plain Diff
Removed unncessary stuff from HttpParallelLocalFileShuffle
parent
4ab268ee
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
conf/java-opts
+1
-1
1 addition, 1 deletion
conf/java-opts
src/scala/spark/HttpParallelLocalFileShuffle.scala
+18
-35
18 additions, 35 deletions
src/scala/spark/HttpParallelLocalFileShuffle.scala
with
19 additions
and
36 deletions
conf/java-opts
+
1
−
1
View file @
92d2a9a1
-Dspark.shuffle.class=spark.HttpParallelLocalFileShuffle -Dspark.blockedLocalFileShuffle.maxRxConnections=2 -Dspark.blockedLocalFileShuffle.blockSize=256 -Dspark.blockedLocalFileShuffle.minKnockInterval=50 -Dspark.parallelLocalFileShuffle.maxRxConnections=2 -Dspark.parallelLocalFileShuffle.maxTxConnections=2 -Dspark.parallelLocalFileShuffle.minKnockInterval=
100
0 -Dspark.parallelLocalFileShuffle.maxKnockInterval=
5
000
-Dspark.shuffle.class=spark.HttpParallelLocalFileShuffle -Dspark.blockedLocalFileShuffle.maxRxConnections=2 -Dspark.blockedLocalFileShuffle.blockSize=256 -Dspark.blockedLocalFileShuffle.minKnockInterval=50 -Dspark.parallelLocalFileShuffle.maxRxConnections=2 -Dspark.parallelLocalFileShuffle.maxTxConnections=2 -Dspark.parallelLocalFileShuffle.minKnockInterval=
5
0 -Dspark.parallelLocalFileShuffle.maxKnockInterval=
2
000
This diff is collapsed.
Click to expand it.
src/scala/spark/HttpParallelLocalFileShuffle.scala
+
18
−
35
View file @
92d2a9a1
...
...
@@ -73,14 +73,6 @@ extends Shuffle[K, V, C] with Logging {
val
writeTime
=
System
.
currentTimeMillis
-
writeStartTime
logInfo
(
"Writing "
+
file
+
" of size "
+
file
.
length
+
" bytes took "
+
writeTime
+
" millis."
)
// Write the SPLITSIZE file
val
splitSizeFile
=
HttpParallelLocalFileShuffle
.
getSplitSizeOutputFile
(
shuffleId
,
myIndex
,
i
)
val
splitSizeOut
=
new
ObjectOutputStream
(
new
FileOutputStream
(
splitSizeFile
))
splitSizeOut
.
writeObject
(
file
.
length
.
toInt
)
splitSizeOut
.
close
()
out
.
close
()
}
...
...
@@ -218,31 +210,28 @@ extends Shuffle[K, V, C] with Logging {
override
def
run
:
Unit
=
{
try
{
// First read the SPLITSIZE file
var
requestedFileLen
=
-
1
// Open connection
val
urlString
=
"%s/shuffle/%d/%d/%d"
.
format
(
serverUri
,
shuffleId
,
inputId
,
myId
)
val
url
=
new
URL
(
urlString
)
val
httpConnection
=
url
.
openConnection
().
asInstanceOf
[
HttpURLConnection
]
var
url
=
"%s/shuffle/%d/%d/SPLITSIZE-%d"
.
format
(
serverUri
,
shuffleId
,
inputId
,
myId
)
val
inputStream
=
new
ObjectInputStream
(
new
URL
(
url
).
openStream
())
try
{
requestedFileLen
=
inputStream
.
readObject
().
asInstanceOf
[
Int
]
}
catch
{
case
e
:
EOFException
=>
{}
}
inputStream
.
close
()
url
=
"%s/shuffle/%d/%d/%d"
.
format
(
serverUri
,
shuffleId
,
inputId
,
myId
)
// Connect to the server
httpConnection
.
connect
()
// Receive file length
var
requestedFileLen
=
httpConnection
.
getContentLength
val
readStartTime
=
System
.
currentTimeMillis
logInfo
(
"BEGIN READ: "
+
url
)
logInfo
(
"BEGIN READ: "
+
url
String
)
// Receive data in an Array[Byte]
var
recvByteArray
=
new
Array
[
Byte
](
requestedFileLen
)
var
alreadyRead
=
0
var
bytesRead
=
0
val
isSource
=
new
URL
(
url
).
open
Stream
()
val
isSource
=
httpConnection
.
getInput
Stream
()
while
(
alreadyRead
!=
requestedFileLen
)
{
bytesRead
=
isSource
.
read
(
recvByteArray
,
alreadyRead
,
requestedFileLen
-
alreadyRead
)
...
...
@@ -251,6 +240,9 @@ extends Shuffle[K, V, C] with Logging {
}
}
// Disconnect
httpConnection
.
disconnect
()
// Make it available to the consumer
try
{
receivedData
.
put
((
splitIndex
,
recvByteArray
))
...
...
@@ -264,9 +256,9 @@ extends Shuffle[K, V, C] with Logging {
receptionSucceeded
=
true
logInfo
(
"END READ: "
+
url
)
logInfo
(
"END READ: "
+
url
String
)
val
readTime
=
System
.
currentTimeMillis
-
readStartTime
logInfo
(
"Reading "
+
url
+
" took "
+
readTime
+
" millis."
)
logInfo
(
"Reading "
+
url
String
+
" took "
+
readTime
+
" millis."
)
}
catch
{
// EOFException is expected to happen because sender can break
// connection due to timeout
...
...
@@ -380,15 +372,6 @@ object HttpParallelLocalFileShuffle extends Logging {
return
file
}
def
getSplitSizeOutputFile
(
shuffleId
:
Long
,
inputId
:
Int
,
outputId
:
Int
)
:
File
=
{
initializeIfNeeded
()
val
dir
=
new
File
(
shuffleDir
,
shuffleId
+
"/"
+
inputId
)
dir
.
mkdirs
()
val
file
=
new
File
(
dir
,
"SPLITSIZE-"
+
outputId
)
return
file
}
def
getServerUri
()
:
String
=
{
initializeIfNeeded
()
serverUri
...
...
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