Who is using it?

… nice but i don’t get it 😀 (too complicated for me, i stay with php only, no c++ boost)

who is using it

[youtube=http://www.youtube.com/watch?v=tsW6vRVzdXQ]

====== THRIFT ======

Thrift is a lightweight remote procedure call framework for scalable cross-language services development. Thrift supports C++, PHP, Python, Perl, Java, Ruby, Erlang, and others. It’s quick, saves development time, and provides a division of labor of work on high-performance servers and applications.
Scribe (log server)
Scribe is a server for aggregating log data streamed in real-time from many other servers. It is a scalable framework useful for logging a wide array of data. It is built on top of Thrift.

===== DOWNLOAD =====

cd /var/www
wget https://dist.apache.org/repos/dist/release/thrift/0.9.0/thrift-0.9.0.tar.gz
wget https://git-wip-us.apache.org/repos/asf?p=thrift.git;a=blob_plain;f=tutorial/tutorial.thrift

Requirements
============

aptitude update
apt-get install libboost-dev libboost-test-dev libboost-program-options-dev libevent-dev automake libtool flex bison pkg-config g++ libssl-dev

apt-get -t lenny-backports install automake libboost-test-dev
apt-get install php5-dev php5-cli

See http://wiki.apache.org/thrift/ThriftRequirements for
an up-to-date list of build requirements.

Resources
=========

More information about Thrift can be obtained on the Thrift webpage at:

http://thrift.apache.org

Acknowledgments
===============

Thrift was inspired by pillar, a lightweight RPC tool written by Adam D’Angelo,
and also by Google’s protocol buffers.

Installation
============

If you are building from the first time out of the source repository, you will
need to generate the configure scripts. (This is not necessary if you
downloaded a tarball.) From the top directory, do:

/var/www/thrift/thrift-0.9.0/contrib/fb303/bootstrap.sh

./bootstrap.sh

Once the configure scripts are generated, thrift can be configured.
From the top directory, do:

./configure

thrift 0.9.0

Building C++ Library ......... : yes
Building C (GLib) Library .... : no
Building Java Library ........ : no
Building C# Library .......... : no
Building Python Library ...... : yes
Building Ruby Library ........ : no
Building Haskell Library ..... : no
Building Perl Library ........ : no
Building PHP Library ......... : yes
Building Erlang Library ...... : no
Building Go Library .......... : no
Building D Library ........... : no

C++ Library:
   Build TZlibTransport ...... : yes
   Build TNonblockingServer .. : yes
   Build TQTcpServer (Qt) .... : no

Python Library:
   Using Python .............. : /usr/bin/python

PHP Library:
   Using php-config .......... : /usr/bin/php-config

If something is missing that you think should be present,
please skim the output of configure to find the missing
component.  Details are present in config.log.

You may need to specify the location of the boost pres explicitly.
If you installed boost in /usr/local, you would run configure as follows:

./configure –with-boost=/usr/local

Note that by default the thrift C++ library is typically built with debugging
symbols included. If you want to customize these options you should use the
CXXFLAGS option in configure, as such:

./configure CXXFLAGS=’-g -O2′
./configure CFLAGS=’-g -O2′
./configure CPPFLAGS=’-DDEBUG_MY_FEATURE’

Run ./configure –help to see other configuration options

Please be aware that the Python library will ignore the –prefix option
and just install wherever Python’s distutils puts it (usually along
the lines of /usr/lib/pythonX.Y/site-packages/). If you need to control
where the Python modules are installed, set the PY_PREFIX variable.
(DESTDIR is respected for Python and C++.)

Make thrift:

make

From the top directory, become superuser and do:

make install

Note that some language packages must be installed manually using build tools
better suited to those languages (at the time of this writing, this applies
to Java, Ruby, PHP).

Look for the README pre in the lib// folder for more details on the
installation of each language library package.

======== Thrift Tutorial ========

… example pres that come with the package.

1) First things first, you’ll need to install the Thrift compiler and the
language libraries. Do that using the instructions in the top level
README pre.

2) Read tutorial.thrift to learn about the syntax of a Thrift pre

3) Compile the code for the language of your choice:

$ thrift
$ thrift -r –gen cpp tutorial.thrift

4) Take a look at the generated code.

5) Look in the language directories for sample client/server code.

6) That’s about it for now. This tutorial is intentionally brief. It should be
just enough to get you started and ready to build your own project.

liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!
admin