public class ProtobufTranslationImpl extends Object implements ProtobufTranslation
ProtobufTranslationImpl that translates
protobuf requests to POJO requests.| Constructor and Description |
|---|
ProtobufTranslationImpl() |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.calcite.avatica.remote.ProtobufTranslationImpl.RequestTranslator |
getParserForRequest(String className)
Fetches the concrete message's Parser implementation.
|
static org.apache.calcite.avatica.remote.ProtobufTranslationImpl.ResponseTranslator |
getParserForResponse(String className)
Fetches the concrete message's Parser implementation.
|
Service.Request |
parseRequest(byte[] bytes)
Parses a serialized protocol buffer request into a
Service.Request. |
Service.Response |
parseResponse(byte[] bytes)
Parses a serialized protocol buffer response into a
Service.Response. |
byte[] |
serializeRequest(Service.Request request)
Serializes a
Service.Request as a protocol buffer. |
byte[] |
serializeResponse(Service.Response response)
Serializes a
Service.Response as a protocol buffer. |
public static org.apache.calcite.avatica.remote.ProtobufTranslationImpl.RequestTranslator getParserForRequest(String className)
className - The protocol buffer class nameIllegalArgumentException - If the argument is null or if a Parser for the given
class name is not found.public static org.apache.calcite.avatica.remote.ProtobufTranslationImpl.ResponseTranslator getParserForResponse(String className)
className - The protocol buffer class nameIllegalArgumentException - If the argument is null or if a Parser for the given
class name is not found.public byte[] serializeResponse(Service.Response response) throws IOException
ProtobufTranslationService.Response as a protocol buffer.serializeResponse in interface ProtobufTranslationresponse - The response to serializeIOException - If there are errors during serializationpublic byte[] serializeRequest(Service.Request request) throws IOException
ProtobufTranslationService.Request as a protocol buffer.serializeRequest in interface ProtobufTranslationrequest - The request to serializeIOException - If there are errors during serializationpublic Service.Request parseRequest(byte[] bytes) throws IOException
ProtobufTranslationService.Request.parseRequest in interface ProtobufTranslationbytes - Serialized protocol buffer request from clientIOException - If the protocol buffer cannot be deserializedpublic Service.Response parseResponse(byte[] bytes) throws IOException
ProtobufTranslationService.Response.parseResponse in interface ProtobufTranslationbytes - Serialized protocol buffer request from serverIOException - If the protocol buffer cannot be deserializedCopyright © 2012-2025 Apache Software Foundation. All Rights Reserved.