wForget commented on code in PR #7628:
URL: https://github.com/apache/kyuubi/pull/7628#discussion_r3775700649


##########
externals/kyuubi-flink-sql-engine/src/main/java/org/apache/flink/client/deployment/application/executors/EmbeddedExecutorFactory.java:
##########
@@ -20,30 +20,100 @@
 import static org.apache.flink.util.Preconditions.checkNotNull;
 import static org.apache.flink.util.Preconditions.checkState;
 
+import java.time.Duration;
 import java.util.Collection;
 import java.util.concurrent.ConcurrentLinkedQueue;
 import org.apache.flink.annotation.Internal;
 import org.apache.flink.api.common.JobID;
-import org.apache.flink.api.common.time.Time;
 import org.apache.flink.client.cli.ClientOptions;
 import org.apache.flink.client.deployment.application.EmbeddedJobClient;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.configuration.DeploymentOptions;
+import org.apache.flink.core.execution.JobClient;
 import org.apache.flink.core.execution.PipelineExecutor;
 import org.apache.flink.core.execution.PipelineExecutorFactory;
 import org.apache.flink.runtime.dispatcher.DispatcherGateway;
 import org.apache.flink.util.concurrent.ScheduledExecutor;
+import org.apache.kyuubi.util.reflect.DynClasses;
+import org.apache.kyuubi.util.reflect.DynConstructors;
+import org.apache.kyuubi.util.reflect.DynMethods;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /** Copied from Apache Flink to exposed the DispatcherGateway for Kyuubi 
statements. */
 @Internal
 public class EmbeddedExecutorFactory implements PipelineExecutorFactory {
 
+  /** FLINK-14068 (2.0.0) removed {@code Time} in favor of {@link Duration}. */
+  private static final Class<?> LEGACY_TIME_CLASS =
+      
DynClasses.builder().impl("org.apache.flink.api.common.time.Time").orNull().build();
+
+  private static final boolean IS_FLINK_1 = LEGACY_TIME_CLASS != null;

Review Comment:
   Why not use `FlinkEngineUtils.FLINK_RUNTIME_VERSION` to determine the flink 
version?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to