> On April 7, 2015, 10:17 p.m., Guozhang Wang wrote: > > core/src/main/scala/kafka/server/DelayedOperation.scala, lines 178-188 > > <https://reviews.apache.org/r/31568/diff/3/?file=912738#file912738line178> > > > > What is the usage of watchCreated here? It seems only gets intialized > > as false and if the function is not returned in line 182, it will always > > execute line 188. So would that be equal to just moving line 188 to after > > line 190?
It is used to increment estimatedTotalOperations only once per operation that actually create a watcher. After watchCreated is set to true, the subsequent iterations won't increment estimatedTotalOperations. > On April 7, 2015, 10:17 p.m., Guozhang Wang wrote: > > core/src/main/scala/kafka/utils/timer/TimingWheel.scala, line 101 > > <https://reviews.apache.org/r/31568/diff/3/?file=912743#file912743line101> > > > > We already check (overflowWheel == null) inside the function, hence it > > can be removed here. This is an optimization to avoid synchronizations over and over. Once overflowWheel is created it is reduced to a single null compare (no method call, no synchronization), which is the cheapest. - Yasuhiro ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31568/#review79257 ----------------------------------------------------------- On April 7, 2015, 9:59 p.m., Yasuhiro Matsuda wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/31568/ > ----------------------------------------------------------- > > (Updated April 7, 2015, 9:59 p.m.) > > > Review request for kafka. > > > Bugs: KAFKA-1989 > https://issues.apache.org/jira/browse/KAFKA-1989 > > > Repository: kafka > > > Description > ------- > > new purgatory implementation > > > Diffs > ----- > > core/src/main/scala/kafka/server/DelayedOperation.scala > e317676b4dd5bb5ad9770930e694cd7282d5b6d5 > core/src/main/scala/kafka/server/ReplicaManager.scala > b06f00bc10acb90083714edb5815306d1f646ddc > core/src/main/scala/kafka/utils/timer/Timer.scala PRE-CREATION > core/src/main/scala/kafka/utils/timer/TimerTask.scala PRE-CREATION > core/src/main/scala/kafka/utils/timer/TimerTaskList.scala PRE-CREATION > core/src/main/scala/kafka/utils/timer/TimingWheel.scala PRE-CREATION > core/src/test/scala/unit/kafka/server/DelayedOperationTest.scala > 7a37617395b9e4226853913b8989f42e7301de7c > core/src/test/scala/unit/kafka/utils/timer/TimerTaskListTest.scala > PRE-CREATION > core/src/test/scala/unit/kafka/utils/timer/TimerTest.scala PRE-CREATION > > Diff: https://reviews.apache.org/r/31568/diff/ > > > Testing > ------- > > > Thanks, > > Yasuhiro Matsuda > >