Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Zookeeper, mail # dev - Zookeeper code question


Copy link to this message
-
Zookeeper code question
Vishal Kathuria 2011-06-15, 20:30
Hi Folks,
I am looking at the code in CommitProcessor and I had a couple of questions.
1.       When a request is ready to be processed, it goes into the toProcess list. Then subsequently, it is taken out of that list and we call nextProcessor.processRequest(toProcess.get(i)). Why does this intermediate toProcess list exist? Why couldn't we call nextProcessor.processRequest(toProcess.get(i)) directly wherever toProcess.add(r) is called? I gave it some thought and couldn't figure out a correctness issue either way.

2.       There are a couple of data structures that are accessed by multiple threads but are not synchronized - they are LinkedList<Request> queuedWriteRequests, committedRequests. That looks like a bug. (or pls let me know if I am missing something).

Thanks!
Vishal