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
d35c5a51
Commit
d35c5a51
authored
12 years ago
by
Nick Pentreath
Browse files
Options
Downloads
Patches
Plain Diff
Adding test for non-default persistence level
parent
1e981d8b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bagel/src/test/scala/bagel/BagelSuite.scala
+18
-0
18 additions, 0 deletions
bagel/src/test/scala/bagel/BagelSuite.scala
with
18 additions
and
0 deletions
bagel/src/test/scala/bagel/BagelSuite.scala
+
18
−
0
View file @
d35c5a51
...
@@ -7,6 +7,7 @@ import org.scalatest.time.SpanSugar._
...
@@ -7,6 +7,7 @@ import org.scalatest.time.SpanSugar._
import
scala.collection.mutable.ArrayBuffer
import
scala.collection.mutable.ArrayBuffer
import
spark._
import
spark._
import
storage.StorageLevel
class
TestVertex
(
val
active
:
Boolean
,
val
age
:
Int
)
extends
Vertex
with
Serializable
class
TestVertex
(
val
active
:
Boolean
,
val
age
:
Int
)
extends
Vertex
with
Serializable
class
TestMessage
(
val
targetId
:
String
)
extends
Message
[
String
]
with
Serializable
class
TestMessage
(
val
targetId
:
String
)
extends
Message
[
String
]
with
Serializable
...
@@ -79,4 +80,21 @@ class BagelSuite extends FunSuite with Assertions with BeforeAndAfter with Timeo
...
@@ -79,4 +80,21 @@ class BagelSuite extends FunSuite with Assertions with BeforeAndAfter with Timeo
}
}
}
}
}
}
test
(
"using non-default persistence level"
)
{
failAfter
(
10
seconds
)
{
sc
=
new
SparkContext
(
"local"
,
"test"
)
val
verts
=
sc
.
parallelize
((
1
to
4
).
map
(
id
=>
(
id
.
toString
,
new
TestVertex
(
true
,
0
))))
val
msgs
=
sc
.
parallelize
(
Array
[(
String
,
TestMessage
)]())
val
numSupersteps
=
50
val
result
=
Bagel
.
run
(
sc
,
verts
,
msgs
,
sc
.
defaultParallelism
,
StorageLevel
.
DISK_ONLY
)
{
(
self
:
TestVertex
,
msgs
:
Option
[
Array
[
TestMessage
]],
superstep
:
Int
)
=>
(
new
TestVertex
(
superstep
<
numSupersteps
-
1
,
self
.
age
+
1
),
Array
[
TestMessage
]())
}
for
((
id
,
vert
)
<-
result
.
collect
)
{
assert
(
vert
.
age
===
numSupersteps
)
}
}
}
}
}
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