danny0405 commented on code in PR #18127:
URL: https://github.com/apache/hudi/pull/18127#discussion_r2887433691


##########
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:
   The Java11 HttpClient and Apache HttpClient 5 are more recommended because 
the less risk of conflicts.



-- 
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]

Reply via email to