mxm commented on code in PR #23383: URL: https://github.com/apache/flink/pull/23383#discussion_r1321673233
########## flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/rest/header/util/SQLGatewayUrlPrefixDecorator.java: ########## @@ -0,0 +1,61 @@ +/* + * 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.header.util; + +import org.apache.flink.client.program.rest.UrlPrefixDecorator; +import org.apache.flink.runtime.rest.messages.MessageHeaders; +import org.apache.flink.runtime.rest.messages.MessageParameters; +import org.apache.flink.runtime.rest.messages.RequestBody; +import org.apache.flink.runtime.rest.messages.ResponseBody; +import org.apache.flink.runtime.rest.versioning.RestAPIVersion; +import org.apache.flink.table.gateway.rest.util.SqlGatewayRestAPIVersion; + +import java.util.Arrays; +import java.util.Collection; +import java.util.stream.Collectors; + +/** + * This class decorates the URL of the original message headers by adding a prefix. The purpose of + * this decorator is to provide a consistent URL prefix for all the REST API endpoints while + * preserving the behavior of the original message headers. + * + * @param <R> the type of the request body + * @param <P> the type of the response body + * @param <M> the type of the message parameters + */ +public class SQLGatewayUrlPrefixDecorator< + R extends RequestBody, P extends ResponseBody, M extends MessageParameters> + extends UrlPrefixDecorator { Review Comment: Why is `SQLGatewayUrlPrefixDecorator` required? There is already UrlPrefixDecorator which this class is using as a super class. I don't understand why we need a new class. We can simply use UrlPrefixDecorator . ########## flink-clients/src/main/java/org/apache/flink/client/program/rest/MonitoringApiMessageHeaders.java: ########## @@ -0,0 +1,51 @@ +/* + * 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.client.program.rest; + +import org.apache.flink.runtime.rest.messages.MessageHeaders; +import org.apache.flink.runtime.rest.messages.MessageParameters; +import org.apache.flink.runtime.rest.messages.RequestBody; +import org.apache.flink.runtime.rest.messages.ResponseBody; +import org.apache.flink.runtime.rest.versioning.RestAPIVersion; +import org.apache.flink.runtime.rest.versioning.RuntimeRestAPIVersion; + +import java.util.Arrays; +import java.util.Collection; +import java.util.stream.Collectors; + +/** + * This class links {@link RequestBody}s to {@link ResponseBody}s types and contains meta-data + * required for their http headers in runtime module. + * + * <p>Implementations must be state-less. + * + * @param <R> request message type + * @param <P> response message type + * @param <M> message parameters type + */ +public interface MonitoringApiMessageHeaders< Review Comment: Why is this class required? -- 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]
