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

Switch to Threaded View
Zookeeper >> mail # dev >> Extracting Zab from Zookeeper and Request class

Copy link to this message
Re: Extracting Zab from Zookeeper and Request class
you will not use those fields in the atomic broadcast. you can look at
Leader.propose() and see that only the request.hdr and request.txn get
sent through the atomic broadcast.

when you separate zab from zookeeper and then integrate back in, you
should end up with something like this in

    protected void setupRequestProcessors() {
        RequestProcessor finalProcessor = new FinalRequestProcessor(this);
        RequestProcessor toBeAppliedProcessor = new
                finalProcessor, getLeader().toBeApplied);
        zabProcessor = new ZabProcessor(toBeAppliedProcessor);
        firstProcessor = new PrepRequestProcessor(this, zablProcessor);

where ZabProcessor is a new request processor you write that uses the
Zab implementation.

On Sun, Apr 17, 2011 at 7:07 PM, André Oriani
> Hi Folks,
> As I mentioned in an early post , I am working on a personal project to
> extract Zab (zab <https://github.com/aoriani/zab>) from ZooKeeper for my MS
> project. I am doing that by bring one class from Zookeeper to my code at
> time. I am not planning to have clients , so the only proposer are the
> servers in the quorum.
> Now that I have finish bringing the leader election (almost , still need to
> bring NEWLEADER proposal) , I am starting with I think is the hard part:
> Leader, Leaner  e Processor classes. They are harder because I need to
> change code  dealing with Zookeeper requests to work in a abcast/adeliver
> fashion.
> Well, stopping the chitchatting, my question is : the class Request has the
> fields cxn, sessionId,cxid and TnxHeader has also clientId.  I did a grep on
> the code and little operation is done over those fields. Most of the time
> they are copied from a data structure to another. My guess is that they are
> used by the quorum members to identify if committed proposal belongs to one
> of its clients. Since my code is not going to deal with clients, can I
> remove those fields? Or do they play some role in the atomic broadcast
> protocol that I haven`t realized yet ?
> Thanks,
> André