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
f1face1e
Commit
f1face1e
authored
12 years ago
by
Imran Rashid
Committed by
Matei Zaharia
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
rename addToAccum to addAccumulator
parent
2d666b9d
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
core/src/main/scala/spark/Accumulators.scala
+3
-3
3 additions, 3 deletions
core/src/main/scala/spark/Accumulators.scala
core/src/test/scala/spark/AccumulatorSuite.scala
+1
-1
1 addition, 1 deletion
core/src/test/scala/spark/AccumulatorSuite.scala
with
4 additions
and
4 deletions
core/src/main/scala/spark/Accumulators.scala
+
3
−
3
View file @
f1face1e
...
...
@@ -21,7 +21,7 @@ class Accumulable[T,R] (
* add more data to this accumulator / accumulable
* @param term
*/
def
+=
(
term
:
R
)
{
value_
=
param
.
add
To
Accum
(
value_
,
term
)
}
def
+=
(
term
:
R
)
{
value_
=
param
.
addAccum
ulator
(
value_
,
term
)
}
/**
* merge two accumulable objects together
...
...
@@ -57,7 +57,7 @@ class Accumulator[T](
* @tparam T
*/
trait
AccumulatorParam
[
T
]
extends
AccumulableParam
[
T
,
T
]
{
def
add
To
Accum
(
t1
:
T
,
t2
:
T
)
:
T
=
{
def
addAccum
ulator
(
t1
:
T
,
t2
:
T
)
:
T
=
{
addInPlace
(
t1
,
t2
)
}
}
...
...
@@ -80,7 +80,7 @@ trait AccumulableParam[T,R] extends Serializable {
* @param t2 the data to be added to the accumulator
* @return the new value of the accumulator
*/
def
add
To
Accum
(
t1
:
T
,
t2
:
R
)
:
T
def
addAccum
ulator
(
t1
:
T
,
t2
:
R
)
:
T
/**
* merge two accumulated values together
...
...
This diff is collapsed.
Click to expand it.
core/src/test/scala/spark/AccumulatorSuite.scala
+
1
−
1
View file @
f1face1e
...
...
@@ -53,7 +53,7 @@ class AccumulatorSuite extends FunSuite with ShouldMatchers {
t1
++=
t2
t1
}
def
add
To
Accum
(
t1
:
mutable.Set
[
Any
],
t2
:
Any
)
:
mutable.Set
[
Any
]
=
{
def
addAccum
ulator
(
t1
:
mutable.Set
[
Any
],
t2
:
Any
)
:
mutable.Set
[
Any
]
=
{
t1
+=
t2
t1
}
...
...
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