Search in sources :

Example 1 with TSimpleJSONProtocol

use of org.apache.thrift.protocol.TSimpleJSONProtocol in project hive by apache.

the class HBaseReadWrite method dumpThriftObject.

private String dumpThriftObject(TBase obj) throws TException, UnsupportedEncodingException {
    TMemoryBuffer buf = new TMemoryBuffer(1000);
    TProtocol protocol = new TSimpleJSONProtocol(buf);
    obj.write(protocol);
    return buf.toString("UTF-8");
}
Also used : TSimpleJSONProtocol(org.apache.thrift.protocol.TSimpleJSONProtocol) TMemoryBuffer(org.apache.thrift.transport.TMemoryBuffer) TProtocol(org.apache.thrift.protocol.TProtocol)

Aggregations

TProtocol (org.apache.thrift.protocol.TProtocol)1 TSimpleJSONProtocol (org.apache.thrift.protocol.TSimpleJSONProtocol)1 TMemoryBuffer (org.apache.thrift.transport.TMemoryBuffer)1