You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Rhett.Wang (Jira)" <ji...@apache.org> on 2020/06/07 23:35:00 UTC

[jira] [Created] (KAFKA-10117) TimingWheel addOverflowWheel

Rhett.Wang created KAFKA-10117:
----------------------------------

             Summary: TimingWheel  addOverflowWheel
                 Key: KAFKA-10117
                 URL: https://issues.apache.org/jira/browse/KAFKA-10117
             Project: Kafka
          Issue Type: Wish
          Components: tools
    Affects Versions: 2.4.0
            Reporter: Rhett.Wang


The code for kafka's TimingWheel,   I think the method addOverflowWheel is not good.  so I  write this code.  Please check it.


class TimingWheel{
 public String test="ok";
 TimingWheel(){
 
 }
 //new instance
 TimingWheel instace = EnumInstance.INSTANCE.getInstace();
}
public enum EnumInstance {
 INSTANCE;
 private TimingWheel instance;
 EnumInstance(){
 instance= new TimingWheel();
 }
 public TimingWheel getInstace(){
 return instance;
 }
}
class Test{

 public static void main(String[] args) {
 TimingWheel first = new TimingWheel();
 
 // advanceClock
 String test = first.instace.test;
 }
}

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)