thrift protocol and test code