aloyszhang commented on code in PR #10366:
URL: https://github.com/apache/inlong/pull/10366#discussion_r1629333246


##########
inlong-audit/audit-sdk/src/main/java/org/apache/inlong/audit/util/RequestIdUtils.java:
##########
@@ -17,33 +17,22 @@
 
 package org.apache.inlong.audit.util;
 
-import java.net.InetSocketAddress;
+import java.util.concurrent.atomic.AtomicLong;
 
-public class SenderResult {
+public class RequestIdUtils {
 
-    public final InetSocketAddress addr;
-    public boolean result;
+    private static final Long MAX_REQUEST_ID = 1000000000L;
+    private static final AtomicLong requestIdSeq = new AtomicLong(0L);
 
     /**
-     * Constructor
-     *
-     * @param addr
-     * @param result
+     * Next request id
      */
-    public SenderResult(InetSocketAddress addr, boolean result) {
-        this.addr = addr;
-        this.result = result;
-    }
-
-    /**
-     * Constructor
-     *
-     * @param sendIp
-     * @param sendPort
-     * @param result
-     */
-    public SenderResult(String sendIp, int sendPort, boolean result) {
-        this.addr = new InetSocketAddress(sendIp, sendPort);
-        this.result = result;
+    public static Long nextRequestId() {

Review Comment:
   Race conditions may happen here.



-- 
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: commits-unsubscr...@inlong.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to