Skip to content

Commit 536df66

Browse files
committed
[MINOR][BUILD] Fix Java linter errors
1 parent ded6d27 commit 536df66

File tree

11 files changed

+24
-22
lines changed

11 files changed

+24
-22
lines changed

core/src/main/java/org/apache/spark/memory/MemoryConsumer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ private void throwOom(final MemoryBlock page, final long required) {
154154
taskMemoryManager.freePage(page, this);
155155
}
156156
taskMemoryManager.showMemoryUsage();
157-
throw new SparkOutOfMemoryError("Unable to acquire " + required + " bytes of memory, got " + got);
157+
throw new SparkOutOfMemoryError("Unable to acquire " + required + " bytes of memory, got " +
158+
got);
158159
}
159160
}

external/kinesis-asl/src/main/java/org/apache/spark/streaming/kinesis/KinesisInitialPositions.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@ public Date getTimestamp() {
6767

6868

6969
/**
70-
* Returns instance of [[KinesisInitialPosition]] based on the passed [[InitialPositionInStream]].
71-
* This method is used in KinesisUtils for translating the InitialPositionInStream
72-
* to InitialPosition. This function would be removed when we deprecate the KinesisUtils.
70+
* Returns instance of [[KinesisInitialPosition]] based on the passed
71+
* [[InitialPositionInStream]]. This method is used in KinesisUtils for translating the
72+
* InitialPositionInStream to InitialPosition. This function would be removed when we deprecate
73+
* the KinesisUtils.
7374
*
7475
* @return [[InitialPosition]]
7576
*/
@@ -83,9 +84,10 @@ public static KinesisInitialPosition fromKinesisInitialPosition(
8384
// InitialPositionInStream.AT_TIMESTAMP is not supported.
8485
// Use InitialPosition.atTimestamp(timestamp) instead.
8586
throw new UnsupportedOperationException(
86-
"Only InitialPositionInStream.LATEST and InitialPositionInStream.TRIM_HORIZON " +
87-
"supported in initialPositionInStream(). Please use the initialPosition() from " +
88-
"builder API in KinesisInputDStream for using InitialPositionInStream.AT_TIMESTAMP");
87+
"Only InitialPositionInStream.LATEST and InitialPositionInStream." +
88+
"TRIM_HORIZON supported in initialPositionInStream(). Please use " +
89+
"the initialPosition() from builder API in KinesisInputDStream for " +
90+
"using InitialPositionInStream.AT_TIMESTAMP");
8991
}
9092
}
9193
}

sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedColumnReader.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import org.apache.parquet.schema.PrimitiveType;
3232

3333
import org.apache.spark.sql.catalyst.util.DateTimeUtils;
34-
import org.apache.spark.sql.execution.vectorized.ColumnVector;
3534
import org.apache.spark.sql.execution.vectorized.WritableColumnVector;
3635
import org.apache.spark.sql.types.DataTypes;
3736
import org.apache.spark.sql.types.DecimalType;
@@ -96,7 +95,7 @@ public class VectorizedColumnReader {
9695
private final OriginalType originalType;
9796
// The timezone conversion to apply to int96 timestamps. Null if no conversion.
9897
private final TimeZone convertTz;
99-
private final static TimeZone UTC = DateTimeUtils.TimeZoneUTC();
98+
private static final TimeZone UTC = DateTimeUtils.TimeZoneUTC();
10099

101100
public VectorizedColumnReader(
102101
ColumnDescriptor descriptor,

sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedParquetRecordReader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ public class VectorizedParquetRecordReader extends SpecificParquetRecordReaderBa
7979
private boolean[] missingColumns;
8080

8181
/**
82-
* The timezone that timestamp INT96 values should be converted to. Null if no conversion. Here to workaround
83-
* incompatibilities between different engines when writing timestamp values.
82+
* The timezone that timestamp INT96 values should be converted to. Null if no conversion. Here to
83+
* workaround incompatibilities between different engines when writing timestamp values.
8484
*/
8585
private TimeZone convertTz = null;
8686

sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/ColumnarRow.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
* to be reused, callers should copy the data out if it needs to be stored.
2929
*/
3030
public final class ColumnarRow extends InternalRow {
31-
// The data for this row. E.g. the value of 3rd int field is `data.getChildColumn(3).getInt(rowId)`.
31+
// The data for this row.
32+
// E.g. the value of 3rd int field is `data.getChildColumn(3).getInt(rowId)`.
3233
private final ColumnVector data;
3334
private final int rowId;
3435
private final int numFields;

sql/core/src/main/java/org/apache/spark/sql/sources/v2/SessionConfigSupport.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919

2020
import org.apache.spark.annotation.InterfaceStability;
2121

22-
import java.util.List;
23-
import java.util.Map;
24-
2522
/**
2623
* A mix-in interface for {@link DataSourceV2}. Data sources can implement this interface to
2724
* propagate session configs with the specified key-prefix to all data source operations in this

sql/core/src/main/java/org/apache/spark/sql/sources/v2/streaming/ContinuousReadSupport.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,8 @@ public interface ContinuousReadSupport extends DataSourceV2 {
3939
* @param options the options for the returned data source reader, which is an immutable
4040
* case-insensitive string-to-string map.
4141
*/
42-
ContinuousReader createContinuousReader(Optional<StructType> schema, String checkpointLocation, DataSourceV2Options options);
42+
ContinuousReader createContinuousReader(
43+
Optional<StructType> schema,
44+
String checkpointLocation,
45+
DataSourceV2Options options);
4346
}

sql/core/src/main/java/org/apache/spark/sql/sources/v2/streaming/ContinuousWriteSupport.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ public interface ContinuousWriteSupport extends BaseStreamingSink {
3939
* Creates an optional {@link ContinuousWriter} to save the data to this data source. Data
4040
* sources can return None if there is no writing needed to be done.
4141
*
42-
* @param queryId A unique string for the writing query. It's possible that there are many writing
43-
* queries running at the same time, and the returned {@link DataSourceV2Writer}
44-
* can use this id to distinguish itself from others.
42+
* @param queryId A unique string for the writing query. It's possible that there are many
43+
* writing queries running at the same time, and the returned
44+
* {@link DataSourceV2Writer} can use this id to distinguish itself from others.
4545
* @param schema the schema of the data to be written.
4646
* @param mode the output mode which determines what successive epoch output means to this
4747
* sink, please refer to {@link OutputMode} for more details.

sql/core/src/main/java/org/apache/spark/sql/sources/v2/streaming/reader/Offset.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ public abstract class Offset extends org.apache.spark.sql.execution.streaming.Of
4242
@Override
4343
public boolean equals(Object obj) {
4444
if (obj instanceof org.apache.spark.sql.execution.streaming.Offset) {
45-
return this.json().equals(((org.apache.spark.sql.execution.streaming.Offset) obj).json());
45+
return this.json()
46+
.equals(((org.apache.spark.sql.execution.streaming.Offset) obj).json());
4647
} else {
4748
return false;
4849
}

sql/core/src/main/java/org/apache/spark/sql/sources/v2/streaming/reader/PartitionOffset.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,4 @@
2626
* These offsets must be serializable.
2727
*/
2828
public interface PartitionOffset extends Serializable {
29-
3029
}

0 commit comments

Comments
 (0)