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.gzcd thrift-0.11.0install, compile:
./configuremakesudo make install
thrift -versionorthriftto 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