You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by mj...@apache.org on 2019/05/30 23:46:55 UTC

[kafka] branch trunk updated: MINOR:Replace duplicated code with common function in utils (#6819)

This is an automated email from the ASF dual-hosted git repository.

mjsax pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 5795675  MINOR:Replace duplicated code with common function in utils (#6819)
5795675 is described below

commit 579567559915e750d305d51a10d9c6797b6eb2aa
Author: Lifei Chen <li...@allseeingsecurity.com>
AuthorDate: Fri May 31 07:46:41 2019 +0800

    MINOR:Replace duplicated code with common function in utils (#6819)
    
    Reviewers: Ivan Yurchenko <iv...@aiven.io>, Matthias J. Sax <ma...@confluent.io>
---
 .../src/main/java/org/apache/kafka/common/utils/SystemTime.java    | 7 +------
 .../kafka/streams/processor/internals/InternalTopicManager.java    | 7 +------
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/clients/src/main/java/org/apache/kafka/common/utils/SystemTime.java b/clients/src/main/java/org/apache/kafka/common/utils/SystemTime.java
index 9ef096f..31919a2 100644
--- a/clients/src/main/java/org/apache/kafka/common/utils/SystemTime.java
+++ b/clients/src/main/java/org/apache/kafka/common/utils/SystemTime.java
@@ -38,12 +38,7 @@ public class SystemTime implements Time {
 
     @Override
     public void sleep(long ms) {
-        try {
-            Thread.sleep(ms);
-        } catch (InterruptedException e) {
-            // just wake up early
-            Thread.currentThread().interrupt();
-        }
+        Utils.sleep(ms);
     }
 
     @Override
diff --git a/streams/src/main/java/org/apache/kafka/streams/processor/internals/InternalTopicManager.java b/streams/src/main/java/org/apache/kafka/streams/processor/internals/InternalTopicManager.java
index f9fe042..3cb06f6 100644
--- a/streams/src/main/java/org/apache/kafka/streams/processor/internals/InternalTopicManager.java
+++ b/streams/src/main/java/org/apache/kafka/streams/processor/internals/InternalTopicManager.java
@@ -155,12 +155,7 @@ public class InternalTopicManager {
             if (!topicsNotReady.isEmpty()) {
                 log.info("Topics {} can not be made ready with {} retries left", topicsNotReady, retries);
 
-                try {
-                    Thread.sleep(retryBackOffMs);
-                } catch (final InterruptedException e) {
-                    // this is okay, we just wake up early
-                    Thread.currentThread().interrupt();
-                }
+                Utils.sleep(retryBackOffMs);
 
                 remainingRetries--;
             }