How apache/thrift works
Apache Thrift is a language-independent RPC stack. Its main workflow takes a Thrift IDL through parsing and code generation to language-specific client and server code, which uses transports, protocols, and processors to make remote calls. The graph also preserves the runtime abstractions and language implementations described by the README. Most runtime links are documented at the architectural level; sampled source excerpts are limited, so component-level runtime wiring is not asserted beyond that documentation.
Main entry points: lib Language Libraries · main.cc Compiler CLI · parse.cc IDL Parser · t_generator_registry.h Generator Registry
Components 21
Compiler
- Thrift IDL
- Compiler CLI
compiler/cpp/src/thrift/main.cc - IDL Parser
compiler/cpp/src/thrift/parse/parse.cc - Program Model
compiler/cpp/src/thrift/parse/t_program.h - Generator Registry
compiler/cpp/src/thrift/generate/t_generator_registry.h - Language Generators
compiler/cpp/src/thrift/generate
Generated Bindings
- Generated Code
RPC Runtime
- RPC Client
- Serialization Protocol
- Data Transport
- RPC Server
- Application Processor
- Service Handler
Language Libraries
- Language Libraries
lib - C++ Runtime
lib/cpp/src/thrift - Go Runtime
lib/go/thrift - Java Runtime
lib/java/src/main/java/org/apache/thrift - .NET Runtime
lib/netstd/Thrift - C GLib Runtime
lib/c_glib/src/thrift/c_glib
Other components
- IDL Author
- Remote Peer
Connections 27
- IDL Author → Thrift IDL: defines services
README.md - Thrift IDL → Compiler CLI: compile input
README.md - Compiler CLI → IDL Parser: parses IDL
- IDL Parser → Program Model: builds model
- Compiler CLI → Generator Registry: selects generator
- Generator Registry → Language Generators: dispatches to
compiler/cpp/src/thrift/generate/t_generator.h - Language Generators → Generated Code: generates bindings
README.md - Generated Code → RPC Client: implements calls
README.md - RPC Client → Serialization Protocol: serializes calls
README.md - Serialization Protocol → Data Transport: encodes data
README.md - Data Transport → Remote Peer: sends data
README.md - Remote Peer → RPC Server: initiates request
README.md - RPC Server → Data Transport: receives data
README.md - RPC Server → Application Processor: dispatches request
README.md - Application Processor → Serialization Protocol: decodes request
README.md - Application Processor → Service Handler: invokes service
README.md - Service Handler → Application Processor: returns result
README.md - Language Libraries → C++ Runtime: includes
README.md - Language Libraries → Go Runtime: includes
README.md - Language Libraries → Java Runtime: includes
README.md - Language Libraries → .NET Runtime: includes
README.md - Language Libraries → C GLib Runtime: includes
README.md - C++ Runtime → RPC Client: provides runtime
README.md - Go Runtime → RPC Client: provides runtime
README.md - Java Runtime → RPC Client: provides runtime
README.md - .NET Runtime → RPC Client: provides runtime
README.md - C GLib Runtime → RPC Client: provides runtime
README.md