concept file in category apache thrift

appears as: file, files, file, files, The file
Programmer's Guide to Apache Thrift

This is an excerpt from Manning's book Programmer's Guide to Apache Thrift.

Whether your application uses multiple platforms and languages or not, it’s likely that its operations span multiple processes over networks and time. At times these processes will need to communicate, either through a file on disk, through a buffer in memory, or across networks. Two central concerns are associated with inter-process communications:

thrift@RONAM ~
$ git clone http://github.com/apache/thrift
Cloning into 'thrift'...
remote: Counting objects: 41123, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 41123 (delta 0), reused 0 (delta 0), pack-reused 41119
Receiving objects: 100% (41123/41123), 11.65 MiB | 7.61 MiB/s, done.
Resolving deltas: 100% (28724/28724), done.
Checking connectivity... done.
Checking out files: 100% (1774/1774), done.

thrift@RONAM ~
$ cd thrift/contrib/vagrant/centos-6.5/

thrift@RONAM ~/thrift/contrib/vagrant/centos-6.5 (master)
$ vagrant up
...
==> default: Use "make install" to install the compiler and libraries.

Randy@RONAM ~/thrift/contrib/vagrant/centos-6.5 (master)
$ vagrant ssh
Last login: Sat Sep 27 23:39:13 2014

# /thrift/compiler/cpp/thrift --version
Thrift version 1.0.0-dev
# exit


!@%STYLE%@!
{"css":"{\"css\": \"font-weight: bold;\"}","target":"[[{\"line\":1,\"ch\":2},{\"line\":1,\"ch\":43}],[{\"line\":12,\"ch\":2},{\"line\":12,\"ch\":11}],[{\"line\":12,\"ch\":12},{\"line\":12,\"ch\":19}],[{\"line\":14,\"ch\":22},{\"line\":14,\"ch\":29}],[{\"line\":19,\"ch\":21},{\"line\":19,\"ch\":28}],[{\"line\":12,\"ch\":20},{\"line\":12,\"ch\":27}],[{\"line\":14,\"ch\":30},{\"line\":14,\"ch\":37}],[{\"line\":15,\"ch\":2},{\"line\":15,\"ch\":9}],[{\"line\":19,\"ch\":29},{\"line\":19,\"ch\":36}],[{\"line\":20,\"ch\":2},{\"line\":20,\"ch\":9}],[{\"line\":12,\"ch\":28},{\"line\":12,\"ch\":39}],[{\"line\":15,\"ch\":2},{\"line\":15,\"ch\":12}],[{\"line\":20,\"ch\":2},{\"line\":20,\"ch\":13}],[{\"line\":23,\"ch\":2},{\"line\":23,\"ch\":39}],[{\"line\":25,\"ch\":2},{\"line\":25,\"ch\":6}]]"}
!@%STYLE%@!

The focus of this IDL file is the definition of the TradeHistory service. The TradeHistory service has two functions, GetLastSale() and GetLastSaleList(). These two functions aren’t complete without the rest of the definitions in the file. For example, both functions use the trade struct that has several attributes, including a TimeStamp struct and a Market enumeration. Each of these user-defined elements must be defined before use.

  • IDL files can include other IDL files, allowing large interfaces to be organized across files.
  • Figure 13.5. Saving files in ASCII format