use of org.apache.thrift.protocol.TCompactProtocol in project jena by apache.
the class ThriftConverter method getInputProtocol.
private static TProtocol getInputProtocol() {
TProtocol protocol = inputProtocols.get();
if (protocol != null)
return protocol;
protocol = new TCompactProtocol(getInputTransport());
inputProtocols.set(protocol);
return protocol;
}
use of org.apache.thrift.protocol.TCompactProtocol in project jena by apache.
the class ThriftConverter method getOutputProtocol.
private static TProtocol getOutputProtocol() {
TProtocol protocol = outputProtocols.get();
if (protocol != null)
return protocol;
protocol = new TCompactProtocol(getOutputTransport());
outputProtocols.set(protocol);
return protocol;
}
use of org.apache.thrift.protocol.TCompactProtocol in project carbondata by apache.
the class CarbonUtil method read.
/**
* Below method will be used to convert the byte array value to thrift object for
* data chunk
*
* @param data thrift byte array
* @param creator type of thrift
* @return thrift object
* @throws IOException any problem while converting the object
*/
private static TBase read(byte[] data, TBaseCreator creator, int offset, int length) throws IOException {
ByteArrayInputStream stream = new ByteArrayInputStream(data, offset, length);
TProtocol binaryIn = new TCompactProtocol(new TIOStreamTransport(stream));
TBase t = creator.create();
try {
t.read(binaryIn);
} catch (TException e) {
throw new IOException(e);
} finally {
CarbonUtil.closeStreams(stream);
}
return t;
}
use of org.apache.thrift.protocol.TCompactProtocol in project carbondata by apache.
the class ThriftReader method open.
/**
* Opens the fileName for reading.
*/
public void open() throws IOException {
FileFactory.FileType fileType = FileFactory.getFileType(fileName);
dataInputStream = FileFactory.getDataInputStream(fileName, fileType, bufferSize);
binaryIn = new TCompactProtocol(new TIOStreamTransport(dataInputStream));
}
use of org.apache.thrift.protocol.TCompactProtocol in project accumulo by apache.
the class TraceFormatter method getRemoteSpan.
public static RemoteSpan getRemoteSpan(Entry<Key, Value> entry) {
TMemoryInputTransport transport = new TMemoryInputTransport(entry.getValue().get());
TCompactProtocol protocol = new TCompactProtocol(transport);
RemoteSpan span = new RemoteSpan();
try {
span.read(protocol);
} catch (TException ex) {
throw new RuntimeException(ex);
}
return span;
}
Aggregations