Skip to content

Commit

Permalink
Merge pull request #321 from Bit-Quill/dev/sl_GoogleJavaFormat2_p2
Browse files Browse the repository at this point in the history
[Spotless] Applying Google Code Format for core/src/main files #2
  • Loading branch information
MitchellGale authored Aug 3, 2023
2 parents d00dc4d + c9a1bce commit ad948b8
Show file tree
Hide file tree
Showing 97 changed files with 3,536 additions and 2,900 deletions.
13 changes: 8 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,13 @@ repositories {
// Spotless checks will be added as PRs are applied to resolve each style issue is approved.
spotless {
java {
// target fileTree('.') {
// include '**/*.java', 'src/*/java/**/*.java'
// exclude '**/build/**', '**/build-*/**'
// }
target fileTree('.') {
include 'core/src/main/java/org/opensearch/sql/monitor/**/*.java',
'core/src/main/java/org/opensearch/sql/expression/**/*.java',
'core/src/main/java/org/opensearch/sql/executor/**/*.java',
'core/src/main/java/org/opensearch/sql/exception/**/*.java'
exclude '**/build/**', '**/build-*/**'
}
// importOrder()
// licenseHeader("/*\n" +
// " * Copyright OpenSearch Contributors\n" +
Expand All @@ -95,7 +98,7 @@ spotless {
// removeUnusedImports()
// trimTrailingWhitespace()
// endWithNewline()
// googleJavaFormat('1.17.0').reflowLongStrings().groupArtifact('com.google.googlejavaformat:google-java-format')
googleJavaFormat('1.17.0').reflowLongStrings().groupArtifact('com.google.googlejavaformat:google-java-format')
}
}

Expand Down
3 changes: 3 additions & 0 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ repositories {
mavenCentral()
}

checkstyleTest.ignoreFailures = true
checkstyleMain.ignoreFailures = true

pitest {
targetClasses = ['org.opensearch.sql.*']
pitestVersion = '1.9.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
* SPDX-License-Identifier: Apache-2.0
*/


package org.opensearch.sql.exception;

/**
* Exception for Expression Evaluation.
*/
/** Exception for Expression Evaluation. */
public class ExpressionEvaluationException extends QueryEngineException {
public ExpressionEvaluationException(String message) {
super(message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
package org.opensearch.sql.exception;

/**
* This should be thrown on serialization of a PhysicalPlan tree if paging is finished.
* Processing of such exception should outcome of responding no cursor to the user.
* This should be thrown on serialization of a PhysicalPlan tree if paging is finished. Processing
* of such exception should outcome of responding no cursor to the user.
*/
public class NoCursorException extends RuntimeException {
}
public class NoCursorException extends RuntimeException {}
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
* SPDX-License-Identifier: Apache-2.0
*/


package org.opensearch.sql.exception;

/**
* Query analysis abstract exception.
*/
/** Query analysis abstract exception. */
public class QueryEngineException extends RuntimeException {

public QueryEngineException(String message) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
* SPDX-License-Identifier: Apache-2.0
*/


package org.opensearch.sql.exception;

/**
* Semantic Check Exception.
*/
/** Semantic Check Exception. */
public class SemanticCheckException extends QueryEngineException {
public SemanticCheckException(String message) {
super(message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,5 @@

package org.opensearch.sql.exception;

/**
* This should be thrown by V2 engine to support fallback scenario.
*/
public class UnsupportedCursorRequestException extends RuntimeException {
}
/** This should be thrown by V2 engine to support fallback scenario. */
public class UnsupportedCursorRequestException extends RuntimeException {}
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@
import lombok.Getter;
import org.opensearch.sql.storage.split.Split;

/**
* Execution context hold planning related information.
*/
/** Execution context hold planning related information. */
public class ExecutionContext {
@Getter
private final Optional<Split> split;
@Getter private final Optional<Split> split;

public ExecutionContext(Split split) {
this.split = Optional.of(split);
Expand Down
36 changes: 14 additions & 22 deletions core/src/main/java/org/opensearch/sql/executor/ExecutionEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: Apache-2.0
*/


package org.opensearch.sql.executor;

import java.util.List;
Expand All @@ -17,39 +16,33 @@
import org.opensearch.sql.executor.pagination.Cursor;
import org.opensearch.sql.planner.physical.PhysicalPlan;

/**
* Execution engine that encapsulates execution details.
*/
/** Execution engine that encapsulates execution details. */
public interface ExecutionEngine {

/**
* Execute physical plan and call back response listener.
* Todo. deprecated this interface after finalize {@link ExecutionContext}.
* Execute physical plan and call back response listener. Todo. deprecated this interface after
* finalize {@link ExecutionContext}.
*
* @param plan executable physical plan
* @param plan executable physical plan
* @param listener response listener
*/
void execute(PhysicalPlan plan, ResponseListener<QueryResponse> listener);

/**
* Execute physical plan with {@link ExecutionContext} and call back response listener.
*/
void execute(PhysicalPlan plan, ExecutionContext context,
ResponseListener<QueryResponse> listener);
/** Execute physical plan with {@link ExecutionContext} and call back response listener. */
void execute(
PhysicalPlan plan, ExecutionContext context, ResponseListener<QueryResponse> listener);

/**
* Explain physical plan and call back response listener. The reason why this has to
* be part of execution engine interface is that the physical plan probably needs to
* be executed to get more info for profiling, such as actual execution time, rows fetched etc.
* Explain physical plan and call back response listener. The reason why this has to be part of
* execution engine interface is that the physical plan probably needs to be executed to get more
* info for profiling, such as actual execution time, rows fetched etc.
*
* @param plan physical plan to explain
* @param plan physical plan to explain
* @param listener response listener
*/
void explain(PhysicalPlan plan, ResponseListener<ExplainResponse> listener);

/**
* Data class that encapsulates ExprValue.
*/
/** Data class that encapsulates ExprValue. */
@Data
class QueryResponse {
private final Schema schema;
Expand All @@ -70,8 +63,8 @@ public static class Column {
}

/**
* Data class that encapsulates explain result. This can help decouple core engine
* from concrete explain response format.
* Data class that encapsulates explain result. This can help decouple core engine from concrete
* explain response format.
*/
@Data
class ExplainResponse {
Expand All @@ -86,5 +79,4 @@ class ExplainResponseNode {
private Map<String, Object> description;
private List<ExplainResponseNode> children;
}

}
Loading

0 comments on commit ad948b8

Please sign in to comment.