售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Learning Apache Thrift
Table of Contents
Learning Apache Thrift
Credits
About the Author
About the Reviewer
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Introducing Apache Thrift
Distributed systems and their services
Service-oriented architecture
Distributed systems
Maintainability
Scalability
Testability
An introduction to Apache Thrift
Supported programming languages
Data types
Transports
Protocols
Versioning
Security
Interface description language
Apache Thrift and others
Custom protocols
XML-RPC and JSON-RPC
SOAP and WSDL
RESTful APIs
CORBA
Apache Avro
Protocol Buffers
When to choose Apache Thrift
Summary
2. Installing and Running Apache Thrift
Installing Apache Thrift on Linux
Installation requirements
Installing dependencies
Installing dependencies on CentOS
Installing dependencies on Debian and Ubuntu
Installing Apache Thrift
Installing Apache Thrift on Mac OS X
Installing Apache Thrift
Installing Apache Thrift on Windows
Testing the installation
Summary
3. Running Your First Apache Thrift Service and Client
Creating necessary project files
Creating a local copy of the Apache Thrift libraries
Defining our first service and generating files
The service code in PHP
The client code in Python
Running the code
What really happened?
Analyzing the code
The service description – IDL
The server script – PHP
The client script – Python
Summary
4. Understanding How Apache Thrift Works
Prepare your tools
Apache Thrift's architecture
Going about using the tool
Designing the services
Preparing the interface description
Generating service and client libraries
Implementing services and clients
Running server and clients
The network stack
Transport
Protocol
Processor
Server and client
Example
Apache Thrift's type system
Basic types
Special types
Structs
Unions
Containers
list
set
map
Usage of containers
Enums
Exceptions
Services
IDL syntax
Comments
Document
Headers
Thrift include
C++ include
Namespace
Definitions
const
typedef
Summary
5. Generating and Running Code in Different Languages
PHP
Generating the code
Examining the code
Transports
Protocols
Servers
Implementing and running the service
Implementing and running the client
Java
Generating the code
Examining the code
Transports
Protocols
Servers
Implementing and running the service
Implementing and running the client
Python
Generating the code
Examining the code
Transports
Protocols
Servers
Building the libraries
Implementing and running the service
Implementing and running the client
JavaScript
Generating the code
Examining the code
Transport, protocol, and servers
Implementing and running the client
Ruby
Generating the code
Examining the code
Transports
Protocols
Servers
Implementing and running the service
Implementing and running the client
C++
Generating the code
Examining the code
Transports
Protocols
Servers
Implementing and running the service
Implementing and running the client
Summary
6. Handling Errors in Apache Thrift
What are the type of errors that can occur?
Syntax errors
Runtime errors
Logic errors
What are exceptions and how to handle them?
Handling exceptions in Apache Thrift
An example code
Implementing the divide method
Running the application without error handling
Adding error handling to the server
Adding error handling to the client
Advanced error handling
Summary
7. An Example Client-Server Application
Our example application
Planning out your work
Getting a general idea of the example application
A technical overview of the application
get_distance
find_occurences
save_to_log
The server
Clients
Preparing the Apache Thrift document
The basic toolbox – base.thrift
The MyToolbox service – mytoolbox.thrift
Compiling the IDL files
Implementing the server
Imports
Displaying errors on the console (logger)
Implementing service methods
Creating the server
Running the server
Implementing and running clients
Creating a client in PHP
Creating a client in Ruby
Further testing and other exercises
Summary
8. Advanced Usage of Apache Thrift
Apache Thrift in production
Code version control systems
Code deployment
Apache Thrift versioning
Apache Thrift performance
Comparing Java servers
Comparing C++ servers
Service multiplexing
Security issues
General security tips
Transport Layer Security/Secure Sockets Layer
Generating keystores
Using keystores in the Java code
Real-world examples of the usage of Apache Thrift
FBThrift in Facebook
Apache Thrift in Evernote
Apache Thrift in Twitter
Apache Thrift in other companies
Summary
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜