Documented below:
Go to Apache website. Depending on where you are, use this site or Tsinghua mirror
Decompress:
tar -xvf thrift-0.11.0.tar.gz
cd thrift-0.11.0
install, compile:
./configure
make
sudo make install
thrift -version
orthrift
to ensure successful installation.
writing a thrift file
To generate the source from a thrift file run1
thrift --gen <language> <Thrift filename>
e.g. vim demo.thrift
:
1 | # namespace LAN PACKAGE_NAME |
thrift --gen java demo.thrift
; or thrift --gen py demo.thrift