You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "s7monk (via GitHub)" <gi...@apache.org> on 2024/02/05 17:37:34 UTC
[PR] [Feature] Introduce executor factory provider [incubator-paimon-webui]
s7monk opened a new pull request, #188:
URL: https://github.com/apache/incubator-paimon-webui/pull/188
<!-- Please specify the module before the PR name: [core] ... or [flink] ... -->
### Purpose
close: https://github.com/apache/incubator-paimon-webui/issues/187
Introduce the executor factory provider to create the corresponding ExecutorFactory. If the task type is a Spark task, create a SparkExecutorFactory. If the task type is a Flink SQL Gateway type,then FlinkSqlGatewayExecutorFactory is created, etc.
### Tests
- ExecutorFactoryProviderTest#testGetExecutorFactory
### API and Format
```
/** ExecutorFactoryProvider is responsible for providing the appropriate ExecutorFactory. */
public class ExecutorFactoryProvider {
private final ExecuteConfig executeConfig;
public ExecutorFactoryProvider(ExecuteConfig executeConfig) {
this.executeConfig = executeConfig;
}
public ExecutorFactory getExecutorFactory(TaskType type) {
switch (type) {
// Currently only supports Flink SQL Gateway.
case SPARK:
throw new UnsupportedOperationException("Spark task are not currently supported.");
case FLINK_SQL_GATEWAY:
return new FlinkSqlGatewayExecutorFactory(executeConfig.getSessionEntity());
default:
throw new IllegalArgumentException("Unsupported task type: " + type);
}
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce executor factory provider [paimon-webui]
Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on code in PR #188:
URL: https://github.com/apache/paimon-webui/pull/188#discussion_r1557490776
##########
paimon-web-gateway/src/main/java/org/apache/paimon/web/gateway/enums/EngineType.java:
##########
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.web.gateway.enums;
+
+/** The {@code EngineType} enum defines the types of engines that can be supported. */
+public enum EngineType {
+ SPARK("SPARK"),
Review Comment:
```suggestion
SPARK,
```
##########
paimon-web-gateway/src/main/java/org/apache/paimon/web/gateway/enums/EngineType.java:
##########
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.web.gateway.enums;
+
+/** The {@code EngineType} enum defines the types of engines that can be supported. */
+public enum EngineType {
+ SPARK("SPARK"),
+ FLINK("FLINK");
Review Comment:
Ditto.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce executor factory provider [paimon-webui]
Posted by "s7monk (via GitHub)" <gi...@apache.org>.
s7monk commented on code in PR #188:
URL: https://github.com/apache/paimon-webui/pull/188#discussion_r1547985989
##########
paimon-web-gateway/src/main/java/org/apache/paimon/web/gateway/config/ExecuteConfig.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.web.gateway.config;
+
+import org.apache.paimon.web.engine.flink.sql.gateway.model.SessionEntity;
+
+import lombok.Builder;
+import lombok.Getter;
+
+import java.util.Map;
+
+/** Configuration for execution context. */
+@Builder
+@Getter
+public class ExecuteConfig {
+
+ private boolean isStreaming;
Review Comment:
Yes, we can support streaming and batch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce executor factory provider [paimon-webui]
Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on code in PR #188:
URL: https://github.com/apache/paimon-webui/pull/188#discussion_r1556819676
##########
paimon-web-gateway/src/main/java/org/apache/paimon/web/gateway/provider/ExecutorFactoryProvider.java:
##########
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.web.gateway.provider;
+
+import org.apache.paimon.web.engine.flink.common.executor.ExecutorFactory;
+import org.apache.paimon.web.engine.flink.sql.gateway.executor.FlinkSqlGatewayExecutorFactory;
+import org.apache.paimon.web.gateway.config.ExecutionConfig;
+import org.apache.paimon.web.gateway.enums.TaskType;
+
+/** ExecutorFactoryProvider is responsible for providing the appropriate ExecutorFactory. */
+public class ExecutorFactoryProvider {
+
+ private final ExecutionConfig executeConfig;
+
+ public ExecutorFactoryProvider(ExecutionConfig executeConfig) {
+ this.executeConfig = executeConfig;
+ }
+
+ public ExecutorFactory getExecutorFactory(TaskType type) {
+ switch (type) {
+ // Currently only supports Flink SQL Gateway.
+ case SPARK:
+ throw new UnsupportedOperationException("Spark task are not currently supported.");
+ case FLINK:
+ return new FlinkSqlGatewayExecutorFactory(executeConfig.getSessionEntity());
Review Comment:
Why does this only use `sessionEntity`?
##########
paimon-web-gateway/src/main/java/org/apache/paimon/web/gateway/enums/TaskType.java:
##########
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.web.gateway.enums;
+
+/** The {@code TaskType} enum defines the types of tasks that can be executed. */
+public enum TaskType {
Review Comment:
@s7monk, the enum could rename to `EngineType`.
##########
paimon-web-gateway/src/main/java/org/apache/paimon/web/gateway/provider/ExecutorFactoryProvider.java:
##########
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.web.gateway.provider;
+
+import org.apache.paimon.web.engine.flink.common.executor.ExecutorFactory;
+import org.apache.paimon.web.engine.flink.sql.gateway.executor.FlinkSqlGatewayExecutorFactory;
+import org.apache.paimon.web.gateway.config.ExecutionConfig;
+import org.apache.paimon.web.gateway.enums.TaskType;
+
+/** ExecutorFactoryProvider is responsible for providing the appropriate ExecutorFactory. */
+public class ExecutorFactoryProvider {
+
+ private final ExecutionConfig executeConfig;
+
+ public ExecutorFactoryProvider(ExecutionConfig executeConfig) {
+ this.executeConfig = executeConfig;
+ }
+
+ public ExecutorFactory getExecutorFactory(TaskType type) {
+ switch (type) {
+ // Currently only supports Flink SQL Gateway.
Review Comment:
Remove this comment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce executor factory provider [paimon-webui]
Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on PR #188:
URL: https://github.com/apache/paimon-webui/pull/188#issuecomment-2044094704
@s7monk, the enum has been changed, therefore please update the description of the pull request.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce executor factory provider [paimon-webui]
Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas merged PR #188:
URL: https://github.com/apache/paimon-webui/pull/188
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce executor factory provider [paimon-webui]
Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on code in PR #188:
URL: https://github.com/apache/paimon-webui/pull/188#discussion_r1557639447
##########
paimon-web-gateway/src/test/java/org/apache/paimon/web/gateway/provider/ExecutorFactoryProviderTest.java:
##########
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.web.gateway.provider;
+
+import org.apache.paimon.web.engine.flink.sql.gateway.executor.FlinkSqlGatewayExecutorFactory;
+import org.apache.paimon.web.engine.flink.sql.gateway.model.SessionEntity;
+import org.apache.paimon.web.gateway.config.ExecutionConfig;
+import org.apache.paimon.web.gateway.enums.EngineType;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertSame;
+
+/** Test for {@link ExecutorFactoryProvider}. */
+public class ExecutorFactoryProviderTest {
+
+ @Test
+ public void testGetExecutorFactory() {
+ ExecutionConfig config =
+ ExecutionConfig.builder().sessionEntity(SessionEntity.builder().build()).build();
+ EngineType engineType = EngineType.fromValue("FLINK");
Review Comment:
Add other engine type test case.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce executor factory provider [paimon-webui]
Posted by "s7monk (via GitHub)" <gi...@apache.org>.
s7monk commented on code in PR #188:
URL: https://github.com/apache/paimon-webui/pull/188#discussion_r1547989848
##########
paimon-web-gateway/src/main/java/org/apache/paimon/web/gateway/enums/TaskType.java:
##########
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.web.gateway.enums;
+
+/** The {@code TaskType} enum defines the types of tasks that can be executed. */
+public enum TaskType {
Review Comment:
If other calculation engines are supported, what I want is to define enumeration judgment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce executor factory provider [paimon-webui]
Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on code in PR #188:
URL: https://github.com/apache/paimon-webui/pull/188#discussion_r1557638683
##########
paimon-web-gateway/src/main/java/org/apache/paimon/web/gateway/provider/ExecutorFactoryProvider.java:
##########
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.web.gateway.provider;
+
+import org.apache.paimon.web.engine.flink.common.executor.ExecutorFactory;
+import org.apache.paimon.web.engine.flink.sql.gateway.executor.FlinkSqlGatewayExecutorFactory;
+import org.apache.paimon.web.gateway.config.ExecutionConfig;
+import org.apache.paimon.web.gateway.enums.EngineType;
+
+/** ExecutorFactoryProvider is responsible for providing the appropriate ExecutorFactory. */
+public class ExecutorFactoryProvider {
+
+ private final ExecutionConfig executionConfig;
+
+ public ExecutorFactoryProvider(ExecutionConfig executionConfig) {
+ this.executionConfig = executionConfig;
+ }
+
+ public ExecutorFactory getExecutorFactory(EngineType type) {
+ switch (type) {
+ case SPARK:
Review Comment:
Remove this branch in this pull request, which could use `default` branch instead.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce executor factory provider [paimon-webui]
Posted by "s7monk (via GitHub)" <gi...@apache.org>.
s7monk commented on code in PR #188:
URL: https://github.com/apache/paimon-webui/pull/188#discussion_r1556833587
##########
paimon-web-gateway/src/main/java/org/apache/paimon/web/gateway/provider/ExecutorFactoryProvider.java:
##########
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.web.gateway.provider;
+
+import org.apache.paimon.web.engine.flink.common.executor.ExecutorFactory;
+import org.apache.paimon.web.engine.flink.sql.gateway.executor.FlinkSqlGatewayExecutorFactory;
+import org.apache.paimon.web.gateway.config.ExecutionConfig;
+import org.apache.paimon.web.gateway.enums.TaskType;
+
+/** ExecutorFactoryProvider is responsible for providing the appropriate ExecutorFactory. */
+public class ExecutorFactoryProvider {
+
+ private final ExecutionConfig executeConfig;
+
+ public ExecutorFactoryProvider(ExecutionConfig executeConfig) {
+ this.executeConfig = executeConfig;
+ }
+
+ public ExecutorFactory getExecutorFactory(TaskType type) {
+ switch (type) {
+ // Currently only supports Flink SQL Gateway.
+ case SPARK:
+ throw new UnsupportedOperationException("Spark task are not currently supported.");
+ case FLINK:
+ return new FlinkSqlGatewayExecutorFactory(executeConfig.getSessionEntity());
Review Comment:
This class only uses sessionEntity here. It is currently only based on Flnk SQL Gateway. Other properties of ExecutionConfig are used in the server module.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce executor factory provider [incubator-paimon-webui]
Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on code in PR #188:
URL: https://github.com/apache/incubator-paimon-webui/pull/188#discussion_r1480946750
##########
paimon-web-gateway/src/main/java/org/apache/paimon/web/gateway/config/ExecuteConfig.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.web.gateway.config;
+
+import org.apache.paimon.web.engine.flink.sql.gateway.model.SessionEntity;
+
+import lombok.Builder;
+import lombok.Getter;
+
+import java.util.Map;
+
+/** Configuration for execution context. */
+@Builder
+@Getter
+public class ExecuteConfig {
+
+ private boolean isStreaming;
Review Comment:
Could the execution config be used both streaming and batch?
##########
paimon-web-gateway/src/main/java/org/apache/paimon/web/gateway/config/ExecuteConfig.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.web.gateway.config;
+
+import org.apache.paimon.web.engine.flink.sql.gateway.model.SessionEntity;
+
+import lombok.Builder;
+import lombok.Getter;
+
+import java.util.Map;
+
+/** Configuration for execution context. */
Review Comment:
Is `ExecutionConfig` related with execution context?
##########
paimon-web-gateway/src/main/java/org/apache/paimon/web/gateway/provider/ExecutorFactoryProvider.java:
##########
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.web.gateway.provider;
+
+import org.apache.paimon.web.engine.flink.common.executor.ExecutorFactory;
+import org.apache.paimon.web.engine.flink.sql.gateway.executor.FlinkSqlGatewayExecutorFactory;
+import org.apache.paimon.web.gateway.config.ExecuteConfig;
+import org.apache.paimon.web.gateway.enums.TaskType;
+
+/** ExecutorFactoryProvider is responsible for providing the appropriate ExecutorFactory. */
+public class ExecutorFactoryProvider {
+
+ private final ExecuteConfig executeConfig;
+
+ public ExecutorFactoryProvider(ExecuteConfig executeConfig) {
+ this.executeConfig = executeConfig;
+ }
+
+ public ExecutorFactory getExecutorFactory(TaskType type) {
+ switch (type) {
+ // Currently only supports Flink SQL Gateway.
Review Comment:
Why does this introduce the provider of the `ExecutorFactory`? IMO, you wrap the executor too much and do not need to introduce provider for `ExecutorFactory`.
##########
paimon-web-gateway/src/main/java/org/apache/paimon/web/gateway/enums/TaskType.java:
##########
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.web.gateway.enums;
+
+/** The {@code TaskType} enum defines the types of tasks that can be executed. */
+public enum TaskType {
Review Comment:
IMO, the enum of task type is designed for the engine, not the implementation.
##########
paimon-web-gateway/src/main/java/org/apache/paimon/web/gateway/config/ExecuteConfig.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.web.gateway.config;
+
+import org.apache.paimon.web.engine.flink.sql.gateway.model.SessionEntity;
+
+import lombok.Builder;
+import lombok.Getter;
+
+import java.util.Map;
+
+/** Configuration for execution context. */
+@Builder
+@Getter
+public class ExecuteConfig {
Review Comment:
```suggestion
public class ExecutionConfig {
```
##########
paimon-web-gateway/src/main/java/org/apache/paimon/web/gateway/config/ExecuteConfig.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.web.gateway.config;
+
+import org.apache.paimon.web.engine.flink.sql.gateway.model.SessionEntity;
+
+import lombok.Builder;
+import lombok.Getter;
+
+import java.util.Map;
+
+/** Configuration for execution context. */
+@Builder
+@Getter
+public class ExecuteConfig {
+
+ private boolean isStreaming;
+
+ private SessionEntity sessionEntity;
+
+ private Map<String, String> config;
Review Comment:
```suggestion
private Map<String, String> configs;
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce executor factory provider [paimon-webui]
Posted by "s7monk (via GitHub)" <gi...@apache.org>.
s7monk commented on code in PR #188:
URL: https://github.com/apache/paimon-webui/pull/188#discussion_r1547982188
##########
paimon-web-gateway/src/main/java/org/apache/paimon/web/gateway/config/ExecuteConfig.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.web.gateway.config;
+
+import org.apache.paimon.web.engine.flink.sql.gateway.model.SessionEntity;
+
+import lombok.Builder;
+import lombok.Getter;
+
+import java.util.Map;
+
+/** Configuration for execution context. */
Review Comment:
yes.
##########
paimon-web-gateway/src/main/java/org/apache/paimon/web/gateway/config/ExecuteConfig.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.web.gateway.config;
+
+import org.apache.paimon.web.engine.flink.sql.gateway.model.SessionEntity;
+
+import lombok.Builder;
+import lombok.Getter;
+
+import java.util.Map;
+
+/** Configuration for execution context. */
+@Builder
+@Getter
+public class ExecuteConfig {
Review Comment:
done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce executor factory provider [paimon-webui]
Posted by "s7monk (via GitHub)" <gi...@apache.org>.
s7monk commented on code in PR #188:
URL: https://github.com/apache/paimon-webui/pull/188#discussion_r1548001050
##########
paimon-web-gateway/src/main/java/org/apache/paimon/web/gateway/provider/ExecutorFactoryProvider.java:
##########
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.web.gateway.provider;
+
+import org.apache.paimon.web.engine.flink.common.executor.ExecutorFactory;
+import org.apache.paimon.web.engine.flink.sql.gateway.executor.FlinkSqlGatewayExecutorFactory;
+import org.apache.paimon.web.gateway.config.ExecuteConfig;
+import org.apache.paimon.web.gateway.enums.TaskType;
+
+/** ExecutorFactoryProvider is responsible for providing the appropriate ExecutorFactory. */
+public class ExecutorFactoryProvider {
+
+ private final ExecuteConfig executeConfig;
+
+ public ExecutorFactoryProvider(ExecuteConfig executeConfig) {
+ this.executeConfig = executeConfig;
+ }
+
+ public ExecutorFactory getExecutorFactory(TaskType type) {
+ switch (type) {
+ // Currently only supports Flink SQL Gateway.
Review Comment:
If we consider supporting multiple engines, the provider of ExecutorFactory is introduced here to provide that there is no need to create a corresponding factory in the controller of the server module.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce executor factory provider [paimon-webui]
Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on code in PR #188:
URL: https://github.com/apache/paimon-webui/pull/188#discussion_r1558777935
##########
paimon-web-gateway/src/main/java/org/apache/paimon/web/gateway/enums/EngineType.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.web.gateway.enums;
+
+/** The {@code EngineType} enum defines the types of engines that can be supported. */
+public enum EngineType {
+ SPARK,
+ FLINK;
+
+ public static EngineType fromValue(String value) {
Review Comment:
```suggestion
public static EngineType fromName(String name) {
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org