Dec 28, 2009

Using Facebook Thrift

While I am looking for a general RPC solution, Thrift comes to my eyes. It is now an Apache project although developed at Facebook. Thrift is very similar to Google's protocol buffer, which was open sourced and hosted on Google Code. For me, Thrift seems support more languages and deployed with a whole set of surrounding support, including thread manager and server/client stubs. More interestingly, Thrift supports exception, that is, exceptions thrown by remote methods can be caught by client code. (I do not remember that Google protocol buffer support this ....)

However, Thrift does not yet have an official tutorial, so, here is a very brief one. (I would resort to an official one once it is published.)
  1. Download Thrift from http://incubator.apache.org/thrift
  2. Unpack the .tar.gz file to create /tmp/thrift-0.2.0
  3. Configure, build and install
    ./configure --prefix=~/wyi/thrift-0.2.0 CXXFLAGS='-g -O2'
    make
    make install
  4. Generate source code from tutorial.thrift
    cd tutorial
    ~wyi/thrift/bin/thrift -r --gen cpp tutorial
    Note that the -r flag indicates generating also include files. The result source code will be placed into a sub-directory named gen-cpp.
  5. Compile example C++ server and client programs in tutorial/cpp
    cd cpp
    make
    Note that you might want to change the Makefile to tell the lib and include directories where Thrift was installed.

5 comments:

pavankanna said...

I esteem your undertakings since it passes on the message of what you are endeavoring to state. It's an exceptional aptitude to make even the person who doesn't consider the subject could prepared to grasp the subject. Your web diaries are legitimate and moreover excessively portrayed. I might want to examine a regularly expanding number of captivating articles from your blog. Keep Sharing
Big Data Hadoop online training in Hyderabad, Noida
Online Hadoop training in Bangalore, Chennai, Pune

Unknown said...

I esteem your undertakings since it passes on the message of what you are endeavoring to state. It's an exceptional aptitude to make even the person who doesn't consider the subject could prepared to grasp the subject. Your web diaries are legitimate and moreover excessively portrayed. I might want to examine a regularly expanding number of captivating articles from your blog. Keep Sharing
Tableau online training in India
Tableau online training in Hyderabad, Noida

sindokht said...

فوم شوینده صورت برای پاک کردن صورت از آلودگی ها و جلوگیری از جوش زدن مناسب است.

vcube said...

This post is so interactive and informative. keep update more information...
devops training institutes in hyderabad

kosmik said...

This post is so interactive and informative. Thanks for sharing this post.
devops-training-in-hyderabad