Skip to content

Commit

Permalink
spotless.
Browse files Browse the repository at this point in the history
  • Loading branch information
s7monk committed Dec 16, 2023
1 parent 49e8994 commit 4bacb20
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import org.apache.paimon.web.common.result.SubmissionResult;

/**
* The Executor interface provides methods to submit SQL statements for execution,
* fetch results, and stop jobs.
* The Executor interface provides methods to submit SQL statements for execution, fetch results,
* and stop jobs.
*/
public interface Executor {

Expand All @@ -46,23 +46,22 @@ public interface Executor {
SubmissionResult fetchResults(FetchResultParams params) throws Exception;

/**
* Stops the execution of a job with the given job ID. The method can accept
* additional options to customize the stopping behavior based on the
* underlying execution framework.
* Stops the execution of a job with the given job ID. The method can accept additional options
* to customize the stopping behavior based on the underlying execution framework.
*
* <p>For Flink, you can pass additional boolean flags:
*
* <ul>
* <li>{@code withSavepoint}: Set to {@code true} to create a savepoint before stopping.</li>
* <li>{@code withDrain}: Set to {@code true} to perform a drain before stopping.</li>
* <li>{@code withSavepoint}: Set to {@code true} to create a savepoint before stopping.
* <li>{@code withDrain}: Set to {@code true} to perform a drain before stopping.
* </ul>
* </p>
*
* <p>For Spark, no additional options are required, and any supplied options will be ignored.</p>
* <p>For Spark, no additional options are required, and any supplied options will be ignored.
*
* @param jobId The unique ID of the job to stop.
* @param options Optional parameters to customize the stop behavior. The first boolean
* is treated as {@code withSavepoint}, and the second boolean (if present)
* is treated as {@code withDrain}.
* @param options Optional parameters to customize the stop behavior. The first boolean is
* treated as {@code withSavepoint}, and the second boolean (if present) is treated as
* {@code withDrain}.
* @return {@code true} if the job was stopped successfully, {@code false} otherwise.
* @throws Exception if there is an error stopping the job.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@
public interface ExecutorFactory {

/**
* Creates and returns a new instance of an {@link Executor}.
* Implementations should provide specific details about the type
* of executor being created and any initialization details.
* Creates and returns a new instance of an {@link Executor}. Implementations should provide
* specific details about the type of executor being created and any initialization details.
*
* @return A new instance of {@link Executor}.
* @throws Exception if there is an error creating the executor instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ public class SubmissionResult implements Serializable {
private final List<Map<String, Object>> data;
private final boolean shouldFetchResult;

private SubmissionResult(String submitId, String jobId, String status, List<Map<String, Object>> data, boolean shouldFetchResult) {
private SubmissionResult(
String submitId,
String jobId,
String status,
List<Map<String, Object>> data,
boolean shouldFetchResult) {
this.submitId = submitId;
this.jobId = jobId;
this.status = status;
Expand Down Expand Up @@ -107,6 +112,6 @@ public Builder shouldFetchResult(boolean shouldFetchResult) {

public SubmissionResult build() {
return new SubmissionResult(submitId, jobId, status, data, shouldFetchResult);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ private SubmissionResult buildResult(TableResult tableResult) throws Exception {
return builder.build();
}

private void setResult(TableResult tableResult, SubmissionResult.Builder builder) throws Exception {
private void setResult(TableResult tableResult, SubmissionResult.Builder builder)
throws Exception {
Optional<JobClient> jobClient = tableResult.getJobClient();
if (jobClient.isPresent()) {
builder.jobId(jobClient.get().getJobID().toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

package org.apache.paimon.web.flink.sql.gateway.client;


import org.apache.flink.configuration.Configuration;
import org.apache.flink.runtime.rest.FileUpload;
import org.apache.flink.runtime.rest.RestClient;
Expand All @@ -33,9 +32,9 @@
import org.apache.flink.util.concurrent.Executors;

import java.io.IOException;
import java.util.function.Supplier;
import java.util.Collection;
import java.util.concurrent.CompletableFuture;
import java.util.function.Supplier;

/** SQL gateway rest client. */
public class SqlGateWayRestClient extends RestClient {
Expand All @@ -61,8 +60,7 @@ CompletableFuture<P> sendRequest(
Collection<FileUpload> fileUploads,
RestAPIVersion<? extends RestAPIVersion<?>> apiVersion) {
return throwExceptionHandler(
() ->
{
() -> {
try {
return super.sendRequest(
targetAddress,
Expand All @@ -85,8 +83,7 @@ CompletableFuture<P> sendRequest(
P extends ResponseBody>
CompletableFuture<P> sendRequest(M messageHeaders, U messageParameters, R request) {
return throwExceptionHandler(
() ->
{
() -> {
try {
return super.sendRequest(
targetAddress,
Expand All @@ -111,8 +108,7 @@ CompletableFuture<P> sendRequest(
R request,
Collection<FileUpload> fileUploads) {
return throwExceptionHandler(
() ->
{
() -> {
try {
return super.sendRequest(
targetAddress,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ public SubmissionResult executeSql(String multiStatement) throws SqlExecutionExc
return executeInsertStatements(insertStatements);
}

private SubmissionResult executeDqlStatement(String statement, FlinkSqlOperationType operationType)
throws SqlExecutionException {
private SubmissionResult executeDqlStatement(
String statement, FlinkSqlOperationType operationType) throws SqlExecutionException {
try {
String operationId = client.executeStatement(session.getSessionId(), statement, null);
FetchResultsResponseBody results =
Expand Down

0 comments on commit 4bacb20

Please sign in to comment.