The vanilla Thrift Transporter and Listener factories deviate from other protocols in
the result of the netty pipeline: most other protocols expect to receive a framed Buf
while vanilla thrift produces an Array[Byte]. This has two related motivations. First, the
end result needed by the thrift implementations is an Array[Byte], which is relatively
trivial to deal with and is a JVM native type so it's unnecessary to go through a Buf.
By avoiding an indirection through Buf we can avoid an unnecessary copy in the netty4
pipeline that would be required to ensure that the bytes were on the heap before
entering the Finagle transport types.
The vanilla Thrift
Transporter
andListener
factories deviate from other protocols in the result of the netty pipeline: most other protocols expect to receive a framedBuf
while vanilla thrift produces anArray[Byte]
. This has two related motivations. First, the end result needed by the thrift implementations is anArray[Byte]
, which is relatively trivial to deal with and is a JVM native type so it's unnecessary to go through aBuf
. By avoiding an indirection throughBuf
we can avoid an unnecessary copy in the netty4 pipeline that would be required to ensure that the bytes were on the heap before entering the Finagle transport types.