flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [flink] KurtYoung commented on a change in pull request #8294: [FLINK-12348][table-planner-blink]Use TableConfig in api module to replace TableConfig in blink-planner module.
Date Tue, 07 May 2019 03:43:53 GMT
KurtYoung commented on a change in pull request #8294: [FLINK-12348][table-planner-blink]Use
TableConfig in api module to replace TableConfig in blink-planner module.
URL: https://github.com/apache/flink/pull/8294#discussion_r281447680
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/api/PlannerConfigImpl.java
 ##########
 @@ -0,0 +1,81 @@
+/*
+ * 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.flink.table.api;
+
+import org.apache.flink.configuration.Configuration;
+import org.apache.flink.configuration.GlobalConfiguration;
+import org.apache.flink.table.calcite.CalciteConfig;
+import org.apache.flink.table.calcite.CalciteConfig$;
+import org.apache.flink.util.Preconditions;
+
+/**
+ * The {@link PlannerConfigImpl} holds parameters to configure the behavior of Blink planner.
+ */
+public class PlannerConfigImpl implements PlannerConfig {
+
+	/**
+	 * Defines the configuration of Calcite for Blink planner.
+	 */
+	private CalciteConfig calciteConfig = CalciteConfig$.MODULE$.DEFAULT();
+
+	/**
+	 * Defines planner defined configuration for Blink planner.
+	 */
+	private Configuration conf = GlobalConfiguration.loadConfiguration();
+
+	/**
+	 * Returns planner defined configuration for Blink planner.
+	 */
+	public Configuration getConf() {
+		return conf;
+	}
+
+	/**
+	 * Sets planner defined configuration for Blink planner.
+	 */
+	public void setConf(Configuration conf) {
+		this.conf = GlobalConfiguration.loadConfiguration();
+		this.conf.addAll(conf);
+	}
+
+	/**
+	 * Returns the configuration of Calcite for Blink planner.
+	 */
+	public CalciteConfig getCalciteConfig() {
+		return calciteConfig;
+	}
+
+	public void setCalciteConfig(CalciteConfig calciteConfig) {
+		this.calciteConfig = Preconditions.checkNotNull(calciteConfig);
+	}
+
+	public static PlannerConfigImpl getDefault() {
+		return new PlannerConfigImpl();
 
 Review comment:
   I'm not sure if this is useful, and not sure what's the purpose of this API. Do you want
to letting everyone reuse the same default instance? Or it's just another way to construct
this class? 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message