diff options
author | Sean Owen <sowen@cloudera.com> | 2016-06-12 11:44:33 -0700 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2016-06-12 11:44:33 -0700 |
commit | f51dfe616b24b4234199c98ea857a586a93a889f (patch) | |
tree | 2803e1675f1948670ebc3f042789f4b401aa2b3e /sql/core | |
parent | 50248dcfff3ba79b73323f3a804c1e19a8be6097 (diff) | |
download | spark-f51dfe616b24b4234199c98ea857a586a93a889f.tar.gz spark-f51dfe616b24b4234199c98ea857a586a93a889f.tar.bz2 spark-f51dfe616b24b4234199c98ea857a586a93a889f.zip |
[SPARK-15086][CORE][STREAMING] Deprecate old Java accumulator API
## What changes were proposed in this pull request?
- Deprecate old Java accumulator API; should use Scala now
- Update Java tests and examples
- Don't bother testing old accumulator API in Java 8 (too)
- (fix a misspelling too)
## How was this patch tested?
Jenkins tests
Author: Sean Owen <sowen@cloudera.com>
Closes #13606 from srowen/SPARK-15086.
Diffstat (limited to 'sql/core')
-rw-r--r-- | sql/core/src/test/java/test/org/apache/spark/sql/JavaDatasetSuite.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/core/src/test/java/test/org/apache/spark/sql/JavaDatasetSuite.java b/sql/core/src/test/java/test/org/apache/spark/sql/JavaDatasetSuite.java index 37577accfd..a711811f41 100644 --- a/sql/core/src/test/java/test/org/apache/spark/sql/JavaDatasetSuite.java +++ b/sql/core/src/test/java/test/org/apache/spark/sql/JavaDatasetSuite.java @@ -32,7 +32,6 @@ import com.google.common.base.Objects; import org.junit.*; import org.junit.rules.ExpectedException; -import org.apache.spark.Accumulator; import org.apache.spark.api.java.JavaSparkContext; import org.apache.spark.api.java.function.*; import org.apache.spark.sql.*; @@ -40,6 +39,7 @@ import org.apache.spark.sql.catalyst.encoders.OuterScopes; import org.apache.spark.sql.catalyst.expressions.GenericRow; import org.apache.spark.sql.test.TestSparkSession; import org.apache.spark.sql.types.StructType; +import org.apache.spark.util.LongAccumulator; import static org.apache.spark.sql.functions.col; import static org.apache.spark.sql.functions.expr; import static org.apache.spark.sql.types.DataTypes.*; @@ -157,7 +157,7 @@ public class JavaDatasetSuite implements Serializable { @Test public void testForeach() { - final Accumulator<Integer> accum = jsc.accumulator(0); + final LongAccumulator accum = jsc.sc().longAccumulator(); List<String> data = Arrays.asList("a", "b", "c"); Dataset<String> ds = spark.createDataset(data, Encoders.STRING()); |