Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
Zookeeper >> mail # dev >> Zookeeper code question


Copy link to this message
-
Zookeeper code question
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

NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB