WIP: Fast transaction encode & decode

Current transaction use a bufferlist tbl to encode all actions and their data, so if object appears many times, it will be encoded many times. And when FileStore do this transaction, it must decode all actions and data from the tbl.

This path follows BP: osd: update_Transaction_encoding, 

The transaction use two maps to keep all colls and objects appeared in the transaction, and each coll and object only need to be encoded once. On the other hand, FileStore don't need to decode actions, colls and objects anymore.
Yes, I want to simplify the alignment calculations.

When the data_bl is at the front, I can just use largest_data_off_in_tbl
without any additional calculation.

On 6 December 2014 at 02:54, Sage Weil <notifications@github.com> wrote:

> In src/os/ObjectStore.h:
>
> > +        ::encode(ops, bl);
> > +        ::encode(pad_unused_bytes, bl);
> > +        ::encode(largest_data_len, bl);
> > +        ::encode(largest_data_off, bl);
> > +        ::encode(largest_data_off_in_tbl, bl);
> > +        ::encode(tbl, bl);
> > +        ::encode(tolerate_collection_add_enoent, bl);
> > +        ENCODE_FINISH(bl);
> > +      } else {
> > +        //layout: data_bl + op_bl + coll_index + object_index + data
> > +        ENCODE_START(8, 5, bl);
> > +        ::encode(data_bl, bl);
> > +        ::encode(op_bl, bl);
> > +        ::encode(coll_index, bl);
> > +        ::encode(object_index, bl);
> > +        data.encode(bl);
>
> not that important, but i would put data at the front. unless you are
> trying to simplify alignment calculations or something?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/ceph/ceph/pull/2991/files#r21391269>.
>



-- 
Dong Yuan
Email:yuandong1222@gmail.com