Class ProtobufService
- java.lang.Object
-
- org.apache.calcite.avatica.remote.AbstractService
-
- org.apache.calcite.avatica.remote.ProtobufService
-
- All Implemented Interfaces:
Service
- Direct Known Subclasses:
LocalProtobufService,MockProtobufService,RemoteProtobufService
public abstract class ProtobufService extends AbstractService
Service implementation that encodes requests and responses as protocol buffers.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.calcite.avatica.remote.AbstractService
AbstractService.SerializationType
-
Nested classes/interfaces inherited from interface org.apache.calcite.avatica.remote.Service
Service.Base, Service.CatalogsRequest, Service.CloseConnectionRequest, Service.CloseConnectionResponse, Service.CloseStatementRequest, Service.CloseStatementResponse, Service.ColumnsRequest, Service.CommitRequest, Service.CommitResponse, Service.ConnectionSyncRequest, Service.ConnectionSyncResponse, Service.CreateStatementRequest, Service.CreateStatementResponse, Service.DatabasePropertyRequest, Service.DatabasePropertyResponse, Service.ErrorResponse, Service.ExecuteBatchRequest, Service.ExecuteBatchResponse, Service.ExecuteRequest, Service.ExecuteResponse, Service.Factory, Service.FetchRequest, Service.FetchResponse, Service.OpenConnectionRequest, Service.OpenConnectionResponse, Service.PrepareAndExecuteBatchRequest, Service.PrepareAndExecuteRequest, Service.PrepareRequest, Service.PrepareResponse, Service.Request, Service.Response, Service.ResultSetResponse, Service.RollbackRequest, Service.RollbackResponse, Service.RpcMetadataResponse, Service.SchemasRequest, Service.SyncResultsRequest, Service.SyncResultsResponse, Service.TablesRequest, Service.TableTypesRequest, Service.TypeInfoRequest
-
-
Constructor Summary
Constructors Constructor Description ProtobufService()
-
Method Summary
-
Methods inherited from class org.apache.calcite.avatica.remote.AbstractService
finagle, finagle, finagle, finagle, finagle, finagle, setRpcMetadata
-
-
-
-
Method Detail
-
_apply
public abstract Service.Response _apply(Service.Request request)
Derived class should implement this method to transport requests and responses to and from the peer service.
-
getSerializationType
AbstractService.SerializationType getSerializationType()
- Specified by:
getSerializationTypein classAbstractService- Returns:
- The manner in which the data is serialized.
-
apply
public Service.ResultSetResponse apply(Service.CatalogsRequest request)
-
apply
public Service.ResultSetResponse apply(Service.SchemasRequest request)
-
apply
public Service.ResultSetResponse apply(Service.TablesRequest request)
-
apply
public Service.ResultSetResponse apply(Service.TableTypesRequest request)
-
apply
public Service.ResultSetResponse apply(Service.TypeInfoRequest request)
-
apply
public Service.ResultSetResponse apply(Service.ColumnsRequest request)
-
apply
public Service.PrepareResponse apply(Service.PrepareRequest request)
-
apply
public Service.ExecuteResponse apply(Service.PrepareAndExecuteRequest request)
-
apply
public Service.FetchResponse apply(Service.FetchRequest request)
-
apply
public Service.CreateStatementResponse apply(Service.CreateStatementRequest request)
-
apply
public Service.CloseStatementResponse apply(Service.CloseStatementRequest request)
-
apply
public Service.OpenConnectionResponse apply(Service.OpenConnectionRequest request)
-
apply
public Service.CloseConnectionResponse apply(Service.CloseConnectionRequest request)
-
apply
public Service.ConnectionSyncResponse apply(Service.ConnectionSyncRequest request)
-
apply
public Service.DatabasePropertyResponse apply(Service.DatabasePropertyRequest request)
-
apply
public Service.ExecuteResponse apply(Service.ExecuteRequest request)
-
apply
public Service.SyncResultsResponse apply(Service.SyncResultsRequest request)
-
apply
public Service.CommitResponse apply(Service.CommitRequest request)
-
apply
public Service.RollbackResponse apply(Service.RollbackRequest request)
-
apply
public Service.ExecuteBatchResponse apply(Service.PrepareAndExecuteBatchRequest request)
-
apply
public Service.ExecuteBatchResponse apply(Service.ExecuteBatchRequest request)
-
castProtobufMessage
public static <T extends com.google.protobuf.Message> T castProtobufMessage(com.google.protobuf.Message msg, java.lang.Class<T> expectedType)Checks if the providedMessageis an instance of the Class given byexpectedType. Throws an IllegalArgumentException if the message is not of the expected type, otherwise, it returns the message cast as the expected type.- Parameters:
msg- A Protocol Buffer message.expectedType- The expected type of the Protocol Buffer message.- Returns:
- The msg cast to the concrete Message type.
- Throws:
java.lang.IllegalArgumentException- If the type of the message is not the expectedType.
-
-