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.

1 comment:

CIIT Noida said...

CIITN is located in Prime location in Noida having best connectivity via all modes of public transport. CIITN offer both weekend and weekdays courses to facilitate Hadoop aspirants. Among all Hadoop Training Institute in Noida , CIITN's Big Data and Hadoop Certification course is designed to prepare you to match all required knowledge for real time job assignment in the Big Data world with top level companies. CIITN puts more focus in project based training and facilitated with Hadoop 2.7 with Cloud Lab—a cloud-based Hadoop environment lab setup for hands-on experience.

CIITNOIDA is the good choice for Big Data Hadoop Training in NOIDA in the final year. I have also completed my summer training from here. It provides high quality Hadoop training with Live projects. The best thing about CIITNOIDA is its experienced trainers and updated course content. They even provide you placement guidance and have their own development cell. You can attend their free demo class and then decide.

Hadoop Training in Noida
Big Data Hadoop Training in Noida