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
5618af68
Commit
5618af68
authored
11 years ago
by
Prashant Sharma
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' into wip-scala-2.10
parents
1bc83ca7
743a31a7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/src/main/scala/org/apache/spark/broadcast/HttpBroadcast.scala
+8
-2
8 additions, 2 deletions
...main/scala/org/apache/spark/broadcast/HttpBroadcast.scala
with
8 additions
and
2 deletions
core/src/main/scala/org/apache/spark/broadcast/HttpBroadcast.scala
+
8
−
2
View file @
5618af68
...
@@ -19,6 +19,7 @@ package org.apache.spark.broadcast
...
@@ -19,6 +19,7 @@ package org.apache.spark.broadcast
import
java.io.
{
File
,
FileOutputStream
,
ObjectInputStream
,
OutputStream
}
import
java.io.
{
File
,
FileOutputStream
,
ObjectInputStream
,
OutputStream
}
import
java.net.URL
import
java.net.URL
import
java.util.concurrent.TimeUnit
import
it.unimi.dsi.fastutil.io.FastBufferedInputStream
import
it.unimi.dsi.fastutil.io.FastBufferedInputStream
import
it.unimi.dsi.fastutil.io.FastBufferedOutputStream
import
it.unimi.dsi.fastutil.io.FastBufferedOutputStream
...
@@ -83,6 +84,8 @@ private object HttpBroadcast extends Logging {
...
@@ -83,6 +84,8 @@ private object HttpBroadcast extends Logging {
private
val
files
=
new
TimeStampedHashSet
[
String
]
private
val
files
=
new
TimeStampedHashSet
[
String
]
private
val
cleaner
=
new
MetadataCleaner
(
MetadataCleanerType
.
HTTP_BROADCAST
,
cleanup
)
private
val
cleaner
=
new
MetadataCleaner
(
MetadataCleanerType
.
HTTP_BROADCAST
,
cleanup
)
private
val
httpReadTimeout
=
TimeUnit
.
MILLISECONDS
.
convert
(
5
,
TimeUnit
.
MINUTES
).
toInt
private
lazy
val
compressionCodec
=
CompressionCodec
.
createCodec
()
private
lazy
val
compressionCodec
=
CompressionCodec
.
createCodec
()
def
initialize
(
isDriver
:
Boolean
)
{
def
initialize
(
isDriver
:
Boolean
)
{
...
@@ -138,10 +141,13 @@ private object HttpBroadcast extends Logging {
...
@@ -138,10 +141,13 @@ private object HttpBroadcast extends Logging {
def
read
[
T
](
id
:
Long
)
:
T
=
{
def
read
[
T
](
id
:
Long
)
:
T
=
{
val
url
=
serverUri
+
"/"
+
BroadcastBlockId
(
id
).
name
val
url
=
serverUri
+
"/"
+
BroadcastBlockId
(
id
).
name
val
in
=
{
val
in
=
{
val
httpConnection
=
new
URL
(
url
).
openConnection
()
httpConnection
.
setReadTimeout
(
httpReadTimeout
)
val
inputStream
=
httpConnection
.
getInputStream
()
if
(
compress
)
{
if
(
compress
)
{
compressionCodec
.
compressedInputStream
(
new
URL
(
url
).
open
Stream
()
)
compressionCodec
.
compressedInputStream
(
input
Stream
)
}
else
{
}
else
{
new
FastBufferedInputStream
(
new
URL
(
url
).
open
Stream
()
,
bufferSize
)
new
FastBufferedInputStream
(
input
Stream
,
bufferSize
)
}
}
}
}
val
ser
=
SparkEnv
.
get
.
serializer
.
newInstance
()
val
ser
=
SparkEnv
.
get
.
serializer
.
newInstance
()
...
...
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