You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "JingsongLi (via GitHub)" <gi...@apache.org> on 2023/04/04 15:01:03 UTC

[GitHub] [flink] JingsongLi commented on a diff in pull request #22118: [FLINK-31335][sql-gateway] When submit job to yarn, support kerberos

JingsongLi commented on code in PR #22118:
URL: https://github.com/apache/flink/pull/22118#discussion_r1157390215


##########
flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/SqlGateway.java:
##########
@@ -109,18 +113,21 @@ static void startSqlGateway(PrintStream stream, String[] args) {
         SignalHandler.register(LOG);
         JvmShutdownSafeguard.installAsShutdownHook(LOG);
 
+        Configuration dynamicConfiguration =
+                ConfigurationUtils.createConfiguration(cliOptions.getDynamicConfigs());
         DefaultContext defaultContext =
-                DefaultContext.load(
-                        ConfigurationUtils.createConfiguration(cliOptions.getDynamicConfigs()),
-                        Collections.emptyList(),
-                        true,
-                        true);
+                DefaultContext.load(dynamicConfiguration, Collections.emptyList(), true, true);
         SqlGateway gateway =
                 new SqlGateway(
                         defaultContext.getFlinkConfig(), SessionManager.create(defaultContext));
+
+        final Configuration flinkConfiguration = GlobalConfiguration.loadConfiguration();
+        flinkConfiguration.addAll(dynamicConfiguration);
+
         try {
             Runtime.getRuntime().addShutdownHook(new ShutdownThread(gateway));
-            gateway.start();
+            SecurityUtils.install(new SecurityConfiguration(flinkConfiguration));

Review Comment:
   Don't new flink conf, just use `defaultContext.getFlinkConfig()`.



##########
flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/SqlGateway.java:
##########
@@ -60,7 +63,7 @@ public SqlGateway(Configuration defaultConfig, SessionManager sessionManager) {
         this.latch = new CountDownLatch(1);
     }
 
-    public void start() throws Exception {
+    public int start() throws Exception {

Review Comment:
   don't change this, you can use a `Callable<Void>` and return null.



-- 
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@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org