Skip to content

Commit 0c6fd03

Browse files
dongjoon-hyunsrowen
authored andcommitted
[MINOR][BUILD] Fix Java linter errors
This PR fixes the minor Java linter errors like the following. ``` - public int read(char cbuf[], int off, int len) throws IOException { + public int read(char[] cbuf, int off, int len) throws IOException { ``` Manual. ``` $ build/mvn -T 4 -q -DskipTests -Pyarn -Phadoop-2.3 -Pkinesis-asl -Phive -Phive-thriftserver install $ dev/lint-java Using `mvn` from path: /usr/local/bin/mvn Checkstyle checks passed. ``` Author: Dongjoon Hyun <[email protected]> Closes #14017 from dongjoon-hyun/minor_build_java_linter_error. (cherry picked from commit 3000b4b) Signed-off-by: Sean Owen <[email protected]>
1 parent 0d0b416 commit 0c6fd03

File tree

5 files changed

+14
-12
lines changed

5 files changed

+14
-12
lines changed

core/src/main/java/org/apache/spark/shuffle/sort/ShuffleExternalSorter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,8 @@ public void insertRecord(Object recordBase, long recordOffset, int length, int p
376376
// for tests
377377
assert(inMemSorter != null);
378378
if (inMemSorter.numRecords() >= numElementsForSpillThreshold) {
379-
logger.info("Spilling data because number of spilledRecords crossed the threshold " + numElementsForSpillThreshold);
379+
logger.info("Spilling data because number of spilledRecords crossed the threshold " +
380+
numElementsForSpillThreshold);
380381
spill();
381382
}
382383

core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import org.slf4j.Logger;
2828
import org.slf4j.LoggerFactory;
2929

30-
import org.apache.spark.SparkEnv;
3130
import org.apache.spark.TaskContext;
3231
import org.apache.spark.executor.ShuffleWriteMetrics;
3332
import org.apache.spark.memory.MemoryConsumer;
@@ -99,8 +98,8 @@ public static UnsafeExternalSorter createWithExistingInMemorySorter(
9998
long numElementsForSpillThreshold,
10099
UnsafeInMemorySorter inMemorySorter) throws IOException {
101100
UnsafeExternalSorter sorter = new UnsafeExternalSorter(taskMemoryManager, blockManager,
102-
serializerManager, taskContext, recordComparator, prefixComparator, initialSize, numElementsForSpillThreshold,
103-
pageSizeBytes, inMemorySorter, false /* ignored */);
101+
serializerManager, taskContext, recordComparator, prefixComparator, initialSize,
102+
numElementsForSpillThreshold, pageSizeBytes, inMemorySorter, false /* ignored */);
104103
sorter.spill(Long.MAX_VALUE, sorter);
105104
// The external sorter will be used to insert records, in-memory sorter is not needed.
106105
sorter.inMemSorter = null;
@@ -119,8 +118,8 @@ public static UnsafeExternalSorter create(
119118
long numElementsForSpillThreshold,
120119
boolean canUseRadixSort) {
121120
return new UnsafeExternalSorter(taskMemoryManager, blockManager, serializerManager,
122-
taskContext, recordComparator, prefixComparator, initialSize, pageSizeBytes, numElementsForSpillThreshold, null,
123-
canUseRadixSort);
121+
taskContext, recordComparator, prefixComparator, initialSize, pageSizeBytes,
122+
numElementsForSpillThreshold, null, canUseRadixSort);
124123
}
125124

126125
private UnsafeExternalSorter(
@@ -386,7 +385,8 @@ public void insertRecord(Object recordBase, long recordOffset, int length, long
386385

387386
assert(inMemSorter != null);
388387
if (inMemSorter.numRecords() >= numElementsForSpillThreshold) {
389-
logger.info("Spilling data because number of spilledRecords crossed the threshold " + numElementsForSpillThreshold);
388+
logger.info("Spilling data because number of spilledRecords crossed the threshold " +
389+
numElementsForSpillThreshold);
390390
spill();
391391
}
392392

sql/catalyst/src/main/java/org/apache/spark/sql/execution/UnsafeExternalRowSorter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ public UnsafeExternalRowSorter(
7474
prefixComparator,
7575
/* initialSize */ 4096,
7676
pageSizeBytes,
77-
SparkEnv.get().conf().getLong("spark.shuffle.spill.numElementsForceSpillThreshold", UnsafeExternalSorter
78-
.DEFAULT_NUM_ELEMENTS_FOR_SPILL_THRESHOLD),
77+
SparkEnv.get().conf().getLong("spark.shuffle.spill.numElementsForceSpillThreshold",
78+
UnsafeExternalSorter.DEFAULT_NUM_ELEMENTS_FOR_SPILL_THRESHOLD),
7979
canUseRadixSort
8080
);
8181
}

sql/core/src/main/java/org/apache/spark/sql/execution/UnsafeFixedWidthAggregationMap.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,8 @@ public UnsafeKVExternalSorter destructAndCreateExternalSorter() throws IOExcepti
247247
SparkEnv.get().blockManager(),
248248
SparkEnv.get().serializerManager(),
249249
map.getPageSizeBytes(),
250-
SparkEnv.get().conf().getLong("spark.shuffle.spill.numElementsForceSpillThreshold", UnsafeExternalSorter
251-
.DEFAULT_NUM_ELEMENTS_FOR_SPILL_THRESHOLD),
250+
SparkEnv.get().conf().getLong("spark.shuffle.spill.numElementsForceSpillThreshold",
251+
UnsafeExternalSorter.DEFAULT_NUM_ELEMENTS_FOR_SPILL_THRESHOLD),
252252
map);
253253
}
254254
}

sql/core/src/main/java/org/apache/spark/sql/execution/UnsafeKVExternalSorter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ public UnsafeKVExternalSorter(
5656
SerializerManager serializerManager,
5757
long pageSizeBytes,
5858
long numElementsForSpillThreshold) throws IOException {
59-
this(keySchema, valueSchema, blockManager, serializerManager, pageSizeBytes, numElementsForSpillThreshold, null);
59+
this(keySchema, valueSchema, blockManager, serializerManager, pageSizeBytes,
60+
numElementsForSpillThreshold, null);
6061
}
6162

6263
public UnsafeKVExternalSorter(

0 commit comments

Comments
 (0)