Repository: spark
Updated Branches:
refs/heads/master 52fa45d62 -> 673a80d22
[MINOR][BUILD] Fix Java CheckStyle Error
## What changes were proposed in this pull request?
As Spark 2.0.1 will be released soon (mentioned in the spark dev mailing list),
besides the critical bugs, it's better to fix the code style errors before the
release.
Before:
```
./dev/lint-java
Checkstyle checks failed at following occurrences:
[ERROR]
src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java:[525]
(sizes) LineLength: Line is longer than 100 characters (found 119).
[ERROR]
src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCount.java:[64]
(sizes) LineLength: Line is longer than 100 characters (found 103).
```
After:
```
./dev/lint-java
Using `mvn` from path: /usr/local/bin/mvn
Checkstyle checks passed.
```
## How was this patch tested?
Manual.
Author: Weiqing Yang
Closes #14768 from Sherry302/fixjavastyle.
Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/673a80d2
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/673a80d2
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/673a80d2
Branch: refs/heads/master
Commit: 673a80d2230602c9e6573a23e35fb0f6b832bfca
Parents: 52fa45d
Author: Weiqing Yang
Authored: Wed Aug 24 10:12:44 2016 +0100
Committer: Sean Owen
Committed: Wed Aug 24 10:12:44 2016 +0100
--
.../collection/unsafe/sort/UnsafeExternalSorter.java | 3 ++-
.../sql/streaming/JavaStructuredNetworkWordCount.java| 11 ++-
2 files changed, 8 insertions(+), 6 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/spark/blob/673a80d2/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java
--
diff --git
a/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java
b/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java
index ccf7664..196e67d 100644
---
a/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java
+++
b/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java
@@ -522,7 +522,8 @@ public final class UnsafeExternalSorter extends
MemoryConsumer {
// is accessing the current record. We free this page in that
caller's next loadNext()
// call.
for (MemoryBlock page : allocatedPages) {
-if (!loaded || page.pageNumber !=
((UnsafeInMemorySorter.SortedIterator)upstream).getCurrentPageNumber()) {
+if (!loaded || page.pageNumber !=
+
((UnsafeInMemorySorter.SortedIterator)upstream).getCurrentPageNumber()) {
released += page.size();
freePage(page);
} else {
http://git-wip-us.apache.org/repos/asf/spark/blob/673a80d2/examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCount.java
--
diff --git
a/examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCount.java
b/examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCount.java
index c913ee0..5f342e1 100644
---
a/examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCount.java
+++
b/examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCount.java
@@ -61,11 +61,12 @@ public final class JavaStructuredNetworkWordCount {
.load();
// Split the lines into words
-Dataset words = lines.as(Encoders.STRING()).flatMap(new
FlatMapFunction() {
- @Override
- public Iterator call(String x) {
-return Arrays.asList(x.split(" ")).iterator();
- }
+Dataset words = lines.as(Encoders.STRING())
+ .flatMap(new FlatMapFunction() {
+@Override
+public Iterator call(String x) {
+ return Arrays.asList(x.split(" ")).iterator();
+}
}, Encoders.STRING());
// Generate running word count
-
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org