shangxinli commented on code in PR #18127:
URL: https://github.com/apache/hudi/pull/18127#discussion_r2892436559
##########
hudi-flink-datasource/hudi-flink/pom.xml:
##########
@@ -324,6 +324,24 @@
<artifactId>joda-time</artifactId>
<version>2.5</version>
</dependency>
+
+ <!-- Jackson -->
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ </dependency>
+
+ <!-- OkHttp -->
+ <dependency>
+ <groupId>com.squareup.okhttp3</groupId>
+ <artifactId>okhttp</artifactId>
+ <version>4.9.3</version>
Review Comment:
Good point. Removed the OkHttp dependency entirely. Replaced with Java 11's
built-in java.net.http.HttpClient which has zero transitive dependencies and no
risk of classpath conflicts.
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/muttley/FlinkHudiMuttleyClient.java:
##########
@@ -0,0 +1,283 @@
+/*
+ * 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.hudi.sink.muttley;
+
+import org.apache.hudi.common.util.Option;
+import org.apache.hudi.common.util.ValidationUtils;
+
+import okhttp3.Interceptor;
+import okhttp3.MediaType;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.RequestBody;
+import okhttp3.Response;
+import okhttp3.ResponseBody;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.time.Duration;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+public abstract class FlinkHudiMuttleyClient {
+
+ private static final Logger LOG =
LoggerFactory.getLogger(FlinkHudiMuttleyClient.class);
+
+ public static final String URL = "http://localhost:%d/%s";
+ public static final int DEFAULT_PORT = 5436;
+ public static final String RPC_CALLER = "Rpc-caller";
+ public static final String RPC_SERVICE = "Rpc-service";
+ public static final String RPC_ROUTING_ZONE = "Rpc-Routing-Zone";
+ public static final String RPC_ROUTING_DELEGATE = "Rpc-Routing-Delegate";
+ public static final String XDC_ROUTING_DELEGATE = "crosszone";
+ public static final String RPC_ENCODING_KEY = "Rpc-Encoding";
+ public static final String RPC_PROCEDURE_KEY = "Rpc-Procedure";
+ public static final String RPC_ENCODING_DEFAULT = "json";
+ private static final MediaType JSON = MediaType.parse("application/json;
charset=utf-8");
+ private static final int MAX_RETRIES = 3; // max retries (additional calls
not counting first call) if failing
+
+ private final String callerService;
+ private final int port;
+ private final OkHttpClient client;
Review Comment:
Agreed. Replaced OkHttp with Java 11's built-in java.net.http.HttpClient. No
external HTTP dependency needed anymore — eliminates the conflict risk from
OkHttp + okio + kotlin-stdlib transitive deps.
--
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]