Hello,
Congratulations to the folks behind kafka. Its has been a smooth ride
dealing with multi TB data when the same set up in JMS fell apart often.

Although I have been using kafka for more than a few days now, started
looking into the code base since yesterday and already have doubts at the
very beginning. Would need some inputs on why the implementation is done
the way it is.

Version : 0.8.1

THREADING RELATED
1. Why in the start up code synchronized? Who are the competing threads?
    a. startReporters func is synchronized
    b. KafkaScheduler startup is synchronized? There is also a volatile
variable declared when the whole synchronized block is itself guaranteeing
"happens before".
   c. Use of native new Thread syntax instead of relying on Executor service
   d. processor thread uses a couthdownlatch but main thread doesnt await
for processors to signal that startup is complete.


NIO RELATED
2.
   a. Acceptor, and each Processor thread have their own selector (since
they are extending from abstract class AbstractServerThread). Ideally a
single selector suffices multiplexing. Is there any reason why multiple
selectors are used?
   b. selector wake up calls by Processors in the read method (line 362
SocketServer.scala) are MISSED calls since there is no thread waiting on
the select at that point.

Looking forward to learning the code further!
Thanks in advance.

Regards,
Chitta

Reply via email to