Skip to content

Commit

Permalink
Applying Google Code Format to core/src/main/java/org/opensearch/sql/…
Browse files Browse the repository at this point in the history
…exception core/src/main/java/org/opensearch/sql/executor core/src/main/java/org/opensearch/sql/expression core/src/main/java/org/opensearch/sql/monitor

Signed-off-by: Mitchell Gale <[email protected]>
  • Loading branch information
MitchellGale committed Jul 27, 2023
1 parent 430d7a9 commit 991b045
Show file tree
Hide file tree
Showing 95 changed files with 3,177 additions and 2,971 deletions.
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 991b045

Please sign in to comment.