WencongLiu commented on code in PR #20236: URL: https://github.com/apache/flink/pull/20236#discussion_r931892257
########## flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/rest/util/SqlGatewayRestOptions.java: ########## @@ -0,0 +1,83 @@ +/* + * 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.gateway.rest.util; + +import org.apache.flink.annotation.PublicEvolving; +import org.apache.flink.configuration.ConfigOption; +import org.apache.flink.configuration.DelegatingConfiguration; +import org.apache.flink.configuration.description.Description; + +import static org.apache.flink.configuration.ConfigOptions.key; +import static org.apache.flink.configuration.description.TextElement.text; + +/** Options to configure {@link org.apache.flink.table.gateway.rest.SqlGatewayRestEndpoint}. */ +@PublicEvolving +public class SqlGatewayRestOptions { + + /** The key name of port option. */ + private static final String REST_PORT_KEY = "rest.port"; + + /** + * The prefix for all sql gateway options, which will be used in {@link DelegatingConfiguration} + * during the initialization of sql gateway server. + */ + public static final String GATEWAY_ENDPOINT_PREFIX = "sql-gateway.endpoint."; + + /** The address that should be used by clients to connect to the sql gateway server. */ + public static final ConfigOption<String> ADDRESS = + key("rest.address") + .stringType() + .noDefaultValue() + .withDescription( + "The address that should be used by clients to connect to the sql gateway server."); + + /** The address that the sql gateway server binds itself to. */ + public static final ConfigOption<String> BIND_ADDRESS = + key("rest.bind-address") + .stringType() + .defaultValue("0.0.0.0") + .withFallbackKeys(SqlGatewayRestOptions.ADDRESS.key()) + .withDescription("The address that the sql gateway server binds itself."); + + /** The port range that the sql gateway server could bind itself to. */ + public static final ConfigOption<String> BIND_PORT = + key("rest.bind-port") + .stringType() + .defaultValue("8083") Review Comment: The default value of PORT is 8083 currently, which will adapt to the previous version of SQL gateway and reduce the user migration cost. -- 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]
