chia7712 commented on code in PR #16266:
URL: https://github.com/apache/kafka/pull/16266#discussion_r1635760706


##########
clients/src/main/java/org/apache/kafka/common/utils/Time.java:
##########
@@ -30,7 +30,40 @@
  */
 public interface Time {
 
-    Time SYSTEM = new SystemTime();
+    //  A time implementation that uses the system clock and sleep call.
+    //  Use inline implementation to ensure that only one Time#SYSTEM exists 
in a program
+    Time SYSTEM = new Time() {
+        @Override
+        public long milliseconds() {
+            return System.currentTimeMillis();
+        }
+
+        @Override
+        public long nanoseconds() {
+            return System.nanoTime();
+        }
+
+        @Override
+        public void sleep(long ms) {
+            Utils.sleep(ms);
+        }
+
+        @Override
+        public void waitObject(Object obj, Supplier<Boolean> condition, long 
deadlineMs) throws InterruptedException {

Review Comment:
   I open https://issues.apache.org/jira/browse/KAFKA-16937 for it. We can have 
more discussion there



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