Skip to content

Commit ad948b8

Browse files
authored
Merge pull request #321 from Bit-Quill/dev/sl_GoogleJavaFormat2_p2
[Spotless] Applying Google Code Format for core/src/main files #2
2 parents d00dc4d + c9a1bce commit ad948b8

File tree

97 files changed

+3536
-2900
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+3536
-2900
lines changed

build.gradle

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,13 @@ repositories {
8383
// Spotless checks will be added as PRs are applied to resolve each style issue is approved.
8484
spotless {
8585
java {
86-
// target fileTree('.') {
87-
// include '**/*.java', 'src/*/java/**/*.java'
88-
// exclude '**/build/**', '**/build-*/**'
89-
// }
86+
target fileTree('.') {
87+
include 'core/src/main/java/org/opensearch/sql/monitor/**/*.java',
88+
'core/src/main/java/org/opensearch/sql/expression/**/*.java',
89+
'core/src/main/java/org/opensearch/sql/executor/**/*.java',
90+
'core/src/main/java/org/opensearch/sql/exception/**/*.java'
91+
exclude '**/build/**', '**/build-*/**'
92+
}
9093
// importOrder()
9194
// licenseHeader("/*\n" +
9295
// " * Copyright OpenSearch Contributors\n" +
@@ -95,7 +98,7 @@ spotless {
9598
// removeUnusedImports()
9699
// trimTrailingWhitespace()
97100
// endWithNewline()
98-
// googleJavaFormat('1.17.0').reflowLongStrings().groupArtifact('com.google.googlejavaformat:google-java-format')
101+
googleJavaFormat('1.17.0').reflowLongStrings().groupArtifact('com.google.googlejavaformat:google-java-format')
99102
}
100103
}
101104

core/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ repositories {
3434
mavenCentral()
3535
}
3636

37+
checkstyleTest.ignoreFailures = true
38+
checkstyleMain.ignoreFailures = true
39+
3740
pitest {
3841
targetClasses = ['org.opensearch.sql.*']
3942
pitestVersion = '1.9.0'

core/src/main/java/org/opensearch/sql/exception/ExpressionEvaluationException.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
76
package org.opensearch.sql.exception;
87

9-
/**
10-
* Exception for Expression Evaluation.
11-
*/
8+
/** Exception for Expression Evaluation. */
129
public class ExpressionEvaluationException extends QueryEngineException {
1310
public ExpressionEvaluationException(String message) {
1411
super(message);

core/src/main/java/org/opensearch/sql/exception/NoCursorException.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
package org.opensearch.sql.exception;
77

88
/**
9-
* This should be thrown on serialization of a PhysicalPlan tree if paging is finished.
10-
* Processing of such exception should outcome of responding no cursor to the user.
9+
* This should be thrown on serialization of a PhysicalPlan tree if paging is finished. Processing
10+
* of such exception should outcome of responding no cursor to the user.
1111
*/
12-
public class NoCursorException extends RuntimeException {
13-
}
12+
public class NoCursorException extends RuntimeException {}

core/src/main/java/org/opensearch/sql/exception/QueryEngineException.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
76
package org.opensearch.sql.exception;
87

9-
/**
10-
* Query analysis abstract exception.
11-
*/
8+
/** Query analysis abstract exception. */
129
public class QueryEngineException extends RuntimeException {
1310

1411
public QueryEngineException(String message) {

core/src/main/java/org/opensearch/sql/exception/SemanticCheckException.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
76
package org.opensearch.sql.exception;
87

9-
/**
10-
* Semantic Check Exception.
11-
*/
8+
/** Semantic Check Exception. */
129
public class SemanticCheckException extends QueryEngineException {
1310
public SemanticCheckException(String message) {
1411
super(message);

core/src/main/java/org/opensearch/sql/exception/UnsupportedCursorRequestException.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,5 @@
55

66
package org.opensearch.sql.exception;
77

8-
/**
9-
* This should be thrown by V2 engine to support fallback scenario.
10-
*/
11-
public class UnsupportedCursorRequestException extends RuntimeException {
12-
}
8+
/** This should be thrown by V2 engine to support fallback scenario. */
9+
public class UnsupportedCursorRequestException extends RuntimeException {}

core/src/main/java/org/opensearch/sql/executor/ExecutionContext.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@
99
import lombok.Getter;
1010
import org.opensearch.sql.storage.split.Split;
1111

12-
/**
13-
* Execution context hold planning related information.
14-
*/
12+
/** Execution context hold planning related information. */
1513
public class ExecutionContext {
16-
@Getter
17-
private final Optional<Split> split;
14+
@Getter private final Optional<Split> split;
1815

1916
public ExecutionContext(Split split) {
2017
this.split = Optional.of(split);

core/src/main/java/org/opensearch/sql/executor/ExecutionEngine.java

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
76
package org.opensearch.sql.executor;
87

98
import java.util.List;
@@ -17,39 +16,33 @@
1716
import org.opensearch.sql.executor.pagination.Cursor;
1817
import org.opensearch.sql.planner.physical.PhysicalPlan;
1918

20-
/**
21-
* Execution engine that encapsulates execution details.
22-
*/
19+
/** Execution engine that encapsulates execution details. */
2320
public interface ExecutionEngine {
2421

2522
/**
26-
* Execute physical plan and call back response listener.
27-
* Todo. deprecated this interface after finalize {@link ExecutionContext}.
23+
* Execute physical plan and call back response listener. Todo. deprecated this interface after
24+
* finalize {@link ExecutionContext}.
2825
*
29-
* @param plan executable physical plan
26+
* @param plan executable physical plan
3027
* @param listener response listener
3128
*/
3229
void execute(PhysicalPlan plan, ResponseListener<QueryResponse> listener);
3330

34-
/**
35-
* Execute physical plan with {@link ExecutionContext} and call back response listener.
36-
*/
37-
void execute(PhysicalPlan plan, ExecutionContext context,
38-
ResponseListener<QueryResponse> listener);
31+
/** Execute physical plan with {@link ExecutionContext} and call back response listener. */
32+
void execute(
33+
PhysicalPlan plan, ExecutionContext context, ResponseListener<QueryResponse> listener);
3934

4035
/**
41-
* Explain physical plan and call back response listener. The reason why this has to
42-
* be part of execution engine interface is that the physical plan probably needs to
43-
* be executed to get more info for profiling, such as actual execution time, rows fetched etc.
36+
* Explain physical plan and call back response listener. The reason why this has to be part of
37+
* execution engine interface is that the physical plan probably needs to be executed to get more
38+
* info for profiling, such as actual execution time, rows fetched etc.
4439
*
45-
* @param plan physical plan to explain
40+
* @param plan physical plan to explain
4641
* @param listener response listener
4742
*/
4843
void explain(PhysicalPlan plan, ResponseListener<ExplainResponse> listener);
4944

50-
/**
51-
* Data class that encapsulates ExprValue.
52-
*/
45+
/** Data class that encapsulates ExprValue. */
5346
@Data
5447
class QueryResponse {
5548
private final Schema schema;
@@ -70,8 +63,8 @@ public static class Column {
7063
}
7164

7265
/**
73-
* Data class that encapsulates explain result. This can help decouple core engine
74-
* from concrete explain response format.
66+
* Data class that encapsulates explain result. This can help decouple core engine from concrete
67+
* explain response format.
7568
*/
7669
@Data
7770
class ExplainResponse {
@@ -86,5 +79,4 @@ class ExplainResponseNode {
8679
private Map<String, Object> description;
8780
private List<ExplainResponseNode> children;
8881
}
89-
9082
}

0 commit comments

Comments
 (0)