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
577c8cc8
Commit
577c8cc8
authored
11 years ago
by
Tathagata Das
Browse files
Options
Downloads
Patches
Plain Diff
Removed unncessary options from WindowedDStream.
parent
3579647c
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
streaming/src/main/scala/org/apache/spark/streaming/dstream/WindowedDStream.scala
+3
-5
3 additions, 5 deletions
.../org/apache/spark/streaming/dstream/WindowedDStream.scala
with
3 additions
and
5 deletions
streaming/src/main/scala/org/apache/spark/streaming/dstream/WindowedDStream.scala
+
3
−
5
View file @
577c8cc8
...
@@ -39,8 +39,6 @@ class WindowedDStream[T: ClassTag](
...
@@ -39,8 +39,6 @@ class WindowedDStream[T: ClassTag](
throw
new
Exception
(
"The slide duration of WindowedDStream ("
+
_slideDuration
+
") "
+
throw
new
Exception
(
"The slide duration of WindowedDStream ("
+
_slideDuration
+
") "
+
"must be multiple of the slide duration of parent DStream ("
+
parent
.
slideDuration
+
")"
)
"must be multiple of the slide duration of parent DStream ("
+
parent
.
slideDuration
+
")"
)
val
useNewUnion
=
System
.
getProperty
(
"spark.streaming.useNewUnion"
,
"true"
).
toBoolean
parent
.
persist
(
StorageLevel
.
MEMORY_ONLY_SER
)
parent
.
persist
(
StorageLevel
.
MEMORY_ONLY_SER
)
def
windowDuration
:
Duration
=
_windowDuration
def
windowDuration
:
Duration
=
_windowDuration
...
@@ -54,11 +52,11 @@ class WindowedDStream[T: ClassTag](
...
@@ -54,11 +52,11 @@ class WindowedDStream[T: ClassTag](
override
def
compute
(
validTime
:
Time
)
:
Option
[
RDD
[
T
]]
=
{
override
def
compute
(
validTime
:
Time
)
:
Option
[
RDD
[
T
]]
=
{
val
currentWindow
=
new
Interval
(
validTime
-
windowDuration
+
parent
.
slideDuration
,
validTime
)
val
currentWindow
=
new
Interval
(
validTime
-
windowDuration
+
parent
.
slideDuration
,
validTime
)
val
rddsInWindow
=
parent
.
slice
(
currentWindow
)
val
rddsInWindow
=
parent
.
slice
(
currentWindow
)
val
windowRDD
=
if
(
useNewUnion
&&
rddsInWindow
.
flatMap
(
_
.
partitioner
).
distinct
.
length
==
1
)
{
val
windowRDD
=
if
(
rddsInWindow
.
flatMap
(
_
.
partitioner
).
distinct
.
length
==
1
)
{
log
Info
(
"Using partition aware union
"
)
log
Debug
(
"Using partition aware union
for windowing at "
+
validTime
)
new
PartitionerAwareUnionRDD
(
ssc
.
sc
,
rddsInWindow
)
new
PartitionerAwareUnionRDD
(
ssc
.
sc
,
rddsInWindow
)
}
else
{
}
else
{
log
Info
(
"Using normal union
"
)
log
Debug
(
"Using normal union
for windowing at "
+
validTime
)
new
UnionRDD
(
ssc
.
sc
,
rddsInWindow
)
new
UnionRDD
(
ssc
.
sc
,
rddsInWindow
)
}
}
Some
(
windowRDD
)
Some
(
windowRDD
)
...
...
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