Skip to content

Commit

Permalink
[Spotless] Applying Google Code Format for core/src/main files #2 (op…
Browse files Browse the repository at this point in the history
…ensearch-project#1931)

* Applied spotless changes to `core/stc/main/.../expression` and more.

Signed-off-by: Mitchell Gale <[email protected]>

* Applied all spotless for PR 2 for GJF

Signed-off-by: Mitchell Gale <[email protected]>

* Apply spotless to fix custom fixes.

Signed-off-by: Mitchell Gale <[email protected]>

* Remove unused <br>

Signed-off-by: Mitchell Gale <[email protected]>

* ignoring core checkstyle failures.

Signed-off-by: Mitchell Gale <[email protected]>

* addressed PR comments.

Signed-off-by: Mitchell Gale <[email protected]>

* Addressing PR 2 comments.

Signed-off-by: Mitchell Gale <[email protected]>

* Ran spotless apply

Signed-off-by: Mitchell Gale <[email protected]>

---------

Signed-off-by: Mitchell Gale <[email protected]>
Signed-off-by: Mitchell Gale <[email protected]>
Signed-off-by: Mitchell Gale <[email protected]>
  • Loading branch information
MitchellGale committed Aug 14, 2023
1 parent 6d02ddd commit d6a7a27
Show file tree
Hide file tree
Showing 96 changed files with 3,533 additions and 2,887 deletions.
6 changes: 5 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ repositories {
spotless {
java {
target fileTree('.') {
include 'core/src/main/java/org/opensearch/sql/analysis/**/*.java',
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',
'core/src/main/java/org/opensearch/sql/analysis/**/*.java',
'core/src/test/java/org/opensearch/sql/data/**/*.java',
'core/src/test/java/org/opensearch/sql/datasource/**/*.java',
'core/src/test/java/org/opensearch/sql/ast/**/*.java'
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
34 changes: 13 additions & 21 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.
* Execute physical plan and call back response listener.<br>
* 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 d6a7a27

Please sign in to comment.