[ 
https://issues.apache.org/jira/browse/KAFKA-16879?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

jiandu updated KAFKA-16879:
---------------------------
    Description: 
Currently, the {{SystemTime}} class, which provides system time-related 
functionalities such as getting the current timestamp 、sleep、and await can be 
instantiated multiple times.

Howerver,  system time is unique,In an application, the time obtained in 
different places should be consistent,  But now the time obtained by using the 
Java System class to interact with the underlying layer is the same。

So I suggest changing it to a singleton mode, reflect the uniqueness of system 
time in design

 

[https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/utils/SystemTime.java|https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/utils/SystemTime.java]

  was:
Currently, the {{SystemTime}} class, which provides system time-related 
functionalities such as getting the current timestamp 、sleep、and await can be 
instantiated multiple times.

Howerver,  system time is unique,In an application, the time obtained in 
different places should be consistent,  But now the time obtained by using the 
Java System class to interact with the underlying layer is the same。

So I suggest changing it to a singleton mode, reflect the uniqueness of system 
time in design

 


> SystemTime should use singleton mode
> ------------------------------------
>
>                 Key: KAFKA-16879
>                 URL: https://issues.apache.org/jira/browse/KAFKA-16879
>             Project: Kafka
>          Issue Type: Improvement
>            Reporter: jiandu
>            Priority: Minor
>
> Currently, the {{SystemTime}} class, which provides system time-related 
> functionalities such as getting the current timestamp 、sleep、and await can be 
> instantiated multiple times.
> Howerver,  system time is unique,In an application, the time obtained in 
> different places should be consistent,  But now the time obtained by using 
> the Java System class to interact with the underlying layer is the same。
> So I suggest changing it to a singleton mode, reflect the uniqueness of 
> system time in design
>  
> [https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/utils/SystemTime.java|https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/utils/SystemTime.java]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to