From 6792253b7c0264d345e00873d8fabb2838f0f6ec Mon Sep 17 00:00:00 2001 From: Weijie Guo Date: Thu, 23 May 2024 15:38:46 +0800 Subject: [PATCH] [FLINK-35429][sqlgateway] Do not introduce new method in SqlGatewayEndpointFactory#Context --- .../gateway/api/endpoint/SqlGatewayEndpointFactory.java | 8 -------- .../api/endpoint/SqlGatewayEndpointFactoryUtils.java | 5 ----- .../table/gateway/rest/SqlGatewayRestEndpointFactory.java | 2 +- .../rest/util/SqlGatewayRestEndpointTestUtils.java | 2 +- 4 files changed, 2 insertions(+), 15 deletions(-) diff --git a/flink-table/flink-sql-gateway-api/src/main/java/org/apache/flink/table/gateway/api/endpoint/SqlGatewayEndpointFactory.java b/flink-table/flink-sql-gateway-api/src/main/java/org/apache/flink/table/gateway/api/endpoint/SqlGatewayEndpointFactory.java index f83dc4a90e512..03d7c1e44dddc 100644 --- a/flink-table/flink-sql-gateway-api/src/main/java/org/apache/flink/table/gateway/api/endpoint/SqlGatewayEndpointFactory.java +++ b/flink-table/flink-sql-gateway-api/src/main/java/org/apache/flink/table/gateway/api/endpoint/SqlGatewayEndpointFactory.java @@ -50,14 +50,6 @@ interface Context { /** Gives read-only access to the configuration of the current session. */ ReadableConfig getFlinkConfiguration(); - /** - * Get a map contains all flink configurations. - * - * @return The copy of flink configurations in the form of map, modifying this map will not - * influence the original configuration object. - */ - Map getFlinkConfigurationOptions(); - /** * Returns the options with which the endpoint is created. All options that are prefixed * with the endpoint identifier are included in the map. diff --git a/flink-table/flink-sql-gateway-api/src/main/java/org/apache/flink/table/gateway/api/endpoint/SqlGatewayEndpointFactoryUtils.java b/flink-table/flink-sql-gateway-api/src/main/java/org/apache/flink/table/gateway/api/endpoint/SqlGatewayEndpointFactoryUtils.java index 3063cf89b3c17..7ba59f609e069 100644 --- a/flink-table/flink-sql-gateway-api/src/main/java/org/apache/flink/table/gateway/api/endpoint/SqlGatewayEndpointFactoryUtils.java +++ b/flink-table/flink-sql-gateway-api/src/main/java/org/apache/flink/table/gateway/api/endpoint/SqlGatewayEndpointFactoryUtils.java @@ -141,11 +141,6 @@ public ReadableConfig getFlinkConfiguration() { return flinkConfiguration; } - @Override - public Map getFlinkConfigurationOptions() { - return flinkConfiguration.toMap(); - } - @Override public Map getEndpointOptions() { return endpointConfig; diff --git a/flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/rest/SqlGatewayRestEndpointFactory.java b/flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/rest/SqlGatewayRestEndpointFactory.java index de2622b80c0f2..697b10196bafd 100644 --- a/flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/rest/SqlGatewayRestEndpointFactory.java +++ b/flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/rest/SqlGatewayRestEndpointFactory.java @@ -49,7 +49,7 @@ public SqlGatewayEndpoint createSqlGatewayEndpoint(Context context) { endpointFactoryHelper.validate(); Configuration config = rebuildRestEndpointOptions( - context.getEndpointOptions(), context.getFlinkConfigurationOptions()); + context.getEndpointOptions(), context.getFlinkConfiguration().toMap()); try { return new SqlGatewayRestEndpoint(config, context.getSqlGatewayService()); } catch (Exception e) { diff --git a/flink-table/flink-sql-gateway/src/test/java/org/apache/flink/table/gateway/rest/util/SqlGatewayRestEndpointTestUtils.java b/flink-table/flink-sql-gateway/src/test/java/org/apache/flink/table/gateway/rest/util/SqlGatewayRestEndpointTestUtils.java index 2d246aeee5796..9b26cd79abc19 100644 --- a/flink-table/flink-sql-gateway/src/test/java/org/apache/flink/table/gateway/rest/util/SqlGatewayRestEndpointTestUtils.java +++ b/flink-table/flink-sql-gateway/src/test/java/org/apache/flink/table/gateway/rest/util/SqlGatewayRestEndpointTestUtils.java @@ -41,7 +41,7 @@ public static Configuration getBaseConfig(Configuration flinkConf) { null, flinkConf, getEndpointConfig(flinkConf, IDENTIFIER)); return rebuildRestEndpointOptions( - context.getEndpointOptions(), context.getFlinkConfigurationOptions()); + context.getEndpointOptions(), context.getFlinkConfiguration().toMap()); } /** Create the configuration generated from config.yaml. */