SummaryProgrammer's Guide to Apache Thrift provides comprehensive coverage of the Apache Thrift framework along with a developer's-eye view of modern distributed application architecture.
Foreword by Jens Geyer.
About the TechnologyThrift-based distributed software systems are built out of communicating components that use different languages, protocols, and message types. Sitting between them is Thrift, which handles data serialization, transport, and service implementation. Thrift supports many client and server environments and a host of languages ranging from PHP to JavaScript, and from C++ to Go.
About the BookProgrammer'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.
What's inside- Complete coverage of Thrift's IDL
- Building and serializing complex user-defined types
- Plug-in protocols, transports, and data compression
- Creating cross-language services with RPC and messaging systems
About the ReaderReaders should be comfortable with a language like Python, Java, or C++ and the basics of service-oriented or microservice architectures.
About the AuthorRandy Abernethy is an Apache Thrift Project Management Committee member and a partner at RX-M.
Table of ContentsPART 1 - APACHE THRIFT OVERVIEW- Introduction to Apache Thrift
- Apache Thrift architecture
- Building, testing, and debugging
PART 2 - PROGRAMMING APACHE THRIFT- Moving bytes with transports
- Serializing data with protocols
- Apache Thrift IDL
- User-defined types
- Implementing services
- Handling exceptions
- Servers
PART 3 - APACHE THRIFT LANGUAGES- Building clients and servers with C++
- Building clients and servers with Java
- Building C# clients and servers with . NET Core and Windows
- Building Node. js clients and servers
- Apache Thrift and JavaScript
- Scripting Apache Thrift
- Thrift in the enterprise
Inhaltsverzeichnis
PART 1 APACHE THRIFT OVERVIEWREAD IN LIVEBOOK1. INTRODUCTION TO APACHE THRIFT1.1. Polyglotism, the pleasure and the pain1.2. Application integration with Apache Thrift1.2.1. Type serialization1.2.2. Service implementation1.3. Building a simple service1.3.1. The Hello IDL1.3.2. The Hello server1.3.3. A Python client1.3.4. A C++ client1.3.5. A Java client1.4. The communications toolkit landscape1.4.1. SOAP1.4.2. REST1.4.3. Protocol Buffers1.4.4. Apache Avro1.4.5. Strengths of Apache Thrift1.4.6. Take away1.5. SummaryREAD IN LIVEBOOK2. APACHE THRIFT ARCHITECTURE2.1. Transports2.1.1. The Transport interface2.1.2. End point transports2.1.3. Layered transports2.1.4. Server transports2.2. Protocols2.3. Apache Thrift IDL2.3.1. User-defined types and serialization2.3.2. RPC services2.4. Servers2.5. Security2.6. SummaryREAD IN LIVEBOOK3. BUILDING, TESTING, AND DEBUGGING3.1. Installing the Apache Thrift IDL Compiler3.1.1. Platform installers3.1.2. VMs and containers3.1.3. Building from source3.2. The Apache Thrift source tree3.3. Apache Thrift tests3.4. Debugging RPC services3.4.1. Examining packets on the wire3.4.2. Unbuffered interfaces3.4.3. Interface misalignment3.4.4. I/O stack misalignment3.4.5. Instrumenting code3.4.6. Additional techniques3.5. SummaryPART 2 PROGRAMMING APACHE THRIFTREAD IN LIVEBOOK4. MOVING BYTES WITH TRANSPORTS4.1. End point transports ? part 1: memory & disk4.1.1. Programming with memory transports4.1.2. Programming with file transports4.2. The transport interface4.2.1. Basic transport operations4.3. End point transports ? Part 2: networks4.3.1. Network programming with TSocket4.4. Server transports4.4.1. Programming network servers with server transports4.4.2. The Server Transport interface4.5. Layered transports4.5.1. Message framing4.6. SummaryREAD IN LIVEBOOK5. SERIALIZING DATA WITH PROTOCOLS5.1. Basic serialization with the binary protocol5.1.1. Using the C++ TBinaryProtocol5.1.2. Using the Java TBinaryProtocol5.1.3. Using the Python TBinaryProtocol5.1.4. Takeaway5.2. The TProtocol interface5.2.1. Apache Thrift serialization5.2.2. C++ TProtocol5.2.3. Java TProtocol5.2.4. Python TProtocolBase5.3. Serializing objects5.3.1. Struct serialization5.3.2. Struct deserialization5.3.3. Struct evolution5.4. TCompactProtocol5.5. TJSONProtocol5.6. Selecting a protocol5.7. SummaryREAD IN LIVEBOOK6. APACHE THRIFT IDL6.1. Interfaces6.2. Apache Thrift IDL6.2.1. IDL file names6.2.2. Element names6.2.3. Keywords6.3. The IDL compiler6.3.1. Compilation phases and error messages6.3.2. Command line switches6.4. Comments and documentation6.5. Namespaces6.6. Built-in types6.6.1. Base types6.6.2. Container types6.6.3. Literals6.7. Constants6.7.1. C++ interface constant implementation6.7.2. Java interface constant implementation6.7.3. Python interface constant implementation