Programmer’s Guide to Apache Thrift

Book Description

Programmer’s Guide to Apache Thrift provides comprehensive coverage of distributed application communication using the Thrift framework. Packed with code examples and useful insight, this book presents best practices for multi-language distributed development. You’ll take a guided tour through transports, protocols, IDL, and servers as you explore programs in C++, Java, and Python. You’ll also learn how to work with platforms ranging from browser-based clients to enterprise servers.

Table of Contents

  1. Copyright
  2. Brief Table of Contents
  3. Table of Contents
  4. Foreword
  5. Preface
  6. Acknowledgments
  7. About this book
  8. About the author
  9. About the cover illustration
  10. Part 1. Apache Thrift overview
    1. Chapter 1. Introduction to Apache Thrift
      1. 1.1. Polyglotism, the pleasure and the pain
      2. 1.2. Application integration with Apache Thrift
      3. 1.3. Building a simple service
      4. 1.4. The communications toolkit landscape
      5. Summary
    2. Chapter 2. Apache Thrift architecture
      1. 2.1. Transports
      2. 2.2. Protocols
      3. 2.3. Apache Thrift IDL
      4. 2.4. Servers
      5. 2.5. Security
      6. Summary
    3. Chapter 3. Building, testing, and debugging
      1. 3.1. Installing the Apache Thrift IDL compiler
      2. 3.2. The Apache Thrift source tree
      3. 3.3. Apache Thrift tests
      4. 3.4. Debugging RPC services
      5. Summary
  11. Part 2. Programming Apache Thrift
    1. Chapter 4. Moving bytes with transports
      1. 4.1. Endpoint transports, part 1: Memory & disk
      2. 4.2. The transport interface
      3. 4.3. Endpoint transports, part 2: Networks
      4. 4.4. Server transports
      5. 4.5. Layered transports
    2. Chapter 5. Serializing data with protocols
      1. 5.1. Basic serialization with the binary protocol
      2. 5.2. The TProtocol interface
      3. 5.3. Serializing objects
      4. 5.4. TCompactProtocol
      5. 5.5. TJSONProtocol
      6. 5.6. Selecting a protocol
      7. Summary
    3. Chapter 6. Apache Thrift IDL
      1. 6.1. Interfaces
      2. 6.2. Apache Thrift IDL
      3. 6.3. The IDL compiler
      4. 6.4. Comments and documentation
      5. 6.5. Namespaces
      6. 6.6. Built-in types
      7. 6.7. Constants
      8. 6.8. Typedefs
      9. 6.9. Enum
      10. 6.10. Structures, unions, exceptions, and argument-lists
      11. 6.11. Services
      12. 6.12. Including external files
      13. 6.13. Annotations
      14. Summary
    4. Chapter 7. User-defined types
      1. 7.1. A simple user-defined type example
      2. 7.2. Type design
      3. 7.3. Serializing objects to disk
      4. 7.4. Under the type serialization hood
      5. 7.5. Type evolution
      6. 7.6. Using Zlib compression
      7. Summary
    5. Chapter 8. Implementing services
      1. 8.1. Declaring IDL services
      2. 8.2. Building a simple service
      3. 8.3. Service interface evolution
      4. 8.4. RPC services in depth
      5. Summary
    6. Chapter 9. Handling exceptions
      1. 9.1. Apache Thrift exceptions
      2. 9.2. TTransportException
      3. 9.3. TProtocolException
      4. 9.4. TApplicationException
      5. 9.5. User-defined exceptions
      6. Summary
    7. Chapter 10. Servers
      1. 10.1. Building a simple server from scratch
      2. 10.2. Using multithreaded servers
      3. 10.3. Server concurrency models
      4. 10.4. Using factories
      5. 10.5. Server interfaces and event processing
      6. 10.6. Servers and services
      7. Summary
  12. Part 3. Apache Thrift languages
    1. Chapter 11. Building clients and servers with C++
      1. 11.1. Setting up Apache Thrift for C++ development
      2. 11.2. A simple client and server
      3. 11.3. C++ transports, protocols, and servers
      4. 11.4. The C++ TNonBlockingServer
      5. Summary
    2. Chapter 12. Building clients and servers with Java
      1. 12.1. Setting up Apache Thrift for Java development
      2. 12.2. A simple client and server
      3. 12.3. Using Apache Thrift in other JVM languages
      4. 12.4. Java transports, protocols, and servers
      5. 12.5. Asynchronous Java RPC
      6. Summary
    3. Chapter 13. Building C# clients and servers with .NET Core and Windows
      1. 13.1. Setting up Apache Thrift on Windows
      2. 13.2. A simple client and server
      3. 13.3. C# transports, protocols, and servers
      4. 13.4. Long polling with named pipes
      5. Summary
    4. Chapter 14. Building Node.js clients and servers
      1. 14.1. A simple client and server
      2. 14.2. Q
      3. 14.3. Node.js servers
      4. 14.4. Multiplexed services
      5. 14.5. Apache Thrift IDL and Node.js
      6. Summary
    5. Chapter 15. Apache Thrift and JavaScript
      1. 15.1. Apache Thrift JavaScript quick start
      2. 15.2. A simple client and server
      3. 15.3. Asynchronous browser client calls
      4. 15.4. RPC error handling
      5. 15.5. Browser RPC and jQuery
      6. 15.6. Apache Thrift and web security
      7. 15.7. Using the WebSocket transport
      8. Summary
    6. Chapter 16. Scripting Apache Thrift
      1. 16.1. Apache Thrift and Ruby
      2. 16.2. Apache Thrift and PHP
      3. 16.3. Apache Thrift and Perl
      4. 16.4. Apache Thrift Perl clients
      5. 16.5. Apache Thrift Perl servers
      6. 16.6. Apache Thrift and Python
      7. Summary
    7. Chapter 17. Thrift in the enterprise
      1. 17.1. Polyglot systems
      2. 17.2. Service tooling and considerations
      3. 17.3. Messaging
      4. 17.4. Best practices
      5. Summary
  13. Index
  14. List of Figures
  15. List of Tables
  16. List of Listings

Product Information

  • Title: Programmer’s Guide to Apache Thrift
  • Author(s): William Abernethy
  • Release date: May 2019
  • Publisher(s): Manning Publications
  • ISBN: 9781617296161