[Gluster-devel] Writing a new xlator is made a bit easier now
    Poornima Gurusiddaiah 
    pgurusid at redhat.com
       
    Thu Dec 24 06:02:15 UTC 2015
    
    
  
Hi All, 
Here is a patch http://review.gluster.org/#/c/13061/ that creates the initial template for any new xlator that you wish to write. 
How to use: 
$ python ./generate_xlator.py <XLATOR_DIRECTORY> <XLATOR_NAME> <FOP_SUFFIX> 
Eg: python ./generate_xlator.py /home/u1/glusterfs/xlators/features compression cmpr
This command will create the following files with some initial contents like copyright, fops definition, header definition etc. : 
* /home/u1/glusterfs/xlators/features/compression/Makefile.am 
* /home/u1/glusterfs/xlators/features/compression/src/Makefile.am 
* /home/u1/glusterfs/xlators/features/compression/src/compression.c 
* /home/u1/glusterfs/xlators/features/compression/src/compression.h 
* /home/u1/glusterfs/xlators/features/compression/src/compression-mem-types.h 
* /home/u1/glusterfs/xlators/features/compression/src/compression-messages.h 
By default all the fops and other functions are generated, if you do not need to implement certain functions, delete those functions from the the file `config.py`. 
One can customize the fop definition by changing CBK_TEMPLATE/FOP_TEMPLATE in generate_xlator.py.
This is an addition to Jeff's http://review.gluster.org/#/c/9411/
Reviews are welcome.
Merry Christmas:)
Regards,
Poornima
    
    
More information about the Gluster-devel
mailing list