----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/33731/#review82911 -----------------------------------------------------------
I'm guessing the answer is yes, but is it too much of a performance hit to replace the purgatory's Pool with just a HashMap guarded by a striped lock? It seems like it would simplify purgatory synchronization logic in that we wouldn't have to worry about working with the Pool's synchronization logic and we could get rid of the Watchers operations list synchronization. A basic version of striped locks: https://gist.github.com/onurkaraman/e8afb91154ec4a832234 - Onur Karaman On May 6, 2015, 11:31 p.m., Guozhang Wang wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/33731/ > ----------------------------------------------------------- > > (Updated May 6, 2015, 11:31 p.m.) > > > Review request for kafka. > > > Bugs: KAFKA-2160 > https://issues.apache.org/jira/browse/KAFKA-2160 > > > Repository: kafka > > > Description > ------- > > Add a per-key lock in Pool which is used for non-primitive > UpdateAndMaybeRemove function > > > Diffs > ----- > > core/src/main/scala/kafka/consumer/ZookeeperConsumerConnector.scala > aa8d9404a3e78a365df06404b79d0d8f694b4bd6 > core/src/main/scala/kafka/server/DelayedOperation.scala > 2ed9b467c2865e5717d7f6fd933cd09a5c5b22c0 > core/src/main/scala/kafka/server/DelayedProduce.scala > 05078b24ef28f2f4e099afa943e43f1d00359fda > core/src/main/scala/kafka/utils/Pool.scala > 9ddcde797341ddd961923cafca16472d84417b5a > core/src/main/scala/kafka/utils/timer/Timer.scala > b8cde820a770a4e894804f1c268b24b529940650 > core/src/test/scala/unit/kafka/log/LogConfigTest.scala > f3546adee490891e0d8d0214bef00b1dd7f42227 > core/src/test/scala/unit/kafka/server/DelayedOperationTest.scala > f3ab3f4ff8eb1aa6b2ab87ba75f72eceb6649620 > > Diff: https://reviews.apache.org/r/33731/diff/ > > > Testing > ------- > > > Thanks, > > Guozhang Wang > >