Thrift binary protocol

From Just Solve the File Format Problem
(Difference between revisions)
Jump to: navigation, search
(Created page with "{{FormatInfo |formattype=electronic |subcat=Serialization |released=2007 }} Apache Thrift, a serialization/RPC system with much more emphasis on RPC than serialization, ca...")
 
m (Added Category:Apache)
Line 19: Line 19:
 
<references />
 
<references />
  
 +
[[Category:Apache]]
 
[[Category:Facebook]]
 
[[Category:Facebook]]

Revision as of 05:24, 20 May 2019

File Format
Name Thrift binary protocol
Ontology
Released 2007

Apache Thrift, a serialization/RPC system with much more emphasis on RPC than serialization, calls its serialization formats "protocols"; the oldest Thrift-specific protocol is the "binary" protocol, while the newer one is the "compact" protocol.[1]

Identification

In the new[2] ("strict") header type, binary protocol files start with a one-byte message type, a zero byte, and then the version indicator 0x01 0x00 0x00 0x08.[3]. (This version indicator has been steady since at least as far back as 2011.) This is followed by an encoded string (a 32-bit length and series of bytes) and a 32-bit sequence ID.[4]

In the old[2] (non-"strict") header type, the message begins with the encoded string of the message name, followed by the type byte, followed by a 32-bit sequence ID.[5]

Links

References

  1. https://thrift.apache.org/docs/concepts#protocol
  2. 2.0 2.1 Commit 589859984f43af1ed0f9ee45ce8374a0d1640813
  3. Thrift source → /lib/java/src/org/apache/thrift/protocol/TBinaryProtocol.java → definition of VERSION_MASK and VERSION_1, and of writeMessageBegin(). https://stackoverflow.com/questions/8402479/error-while-compiling-thrift-server indicates that the version/size integer is presumably stored little-endian.
  4. Thrift source → /lib/java/src/org/apache/thrift/protocol/TBinaryProtocol.java → readMessageBegin(); /lib/java/src/org/apache/thrift/protocol/TMessage.java
  5. Thrift source → /lib/java/src/org/apache/thrift/protocol/TBinaryProtocol.java → readMessageBegin()
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox