Package org.apache.calcite.avatica.remote

# Class ProtobufHandler

java.lang.Object
org.apache.calcite.avatica.remote.AbstractHandler<byte[]>
org.apache.calcite.avatica.remote.ProtobufHandler

All Implemented Interfaces:
  `Handler<byte[]>`

public class ProtobufHandler extends AbstractHandler<byte[]>
Dispatches serialized protocol buffer messages to the provided `Service` by converting them to the POJO Request. Returns back the serialized protocol buffer response.

## Nested Class Summary

## Nested classes/interfaces inherited from interface org.apache.calcite.avatica.remote.Handler

`Handler.HandlerResponse<T>`

## Field Summary

### Fields inherited from class org.apache.calcite.avatica.remote.AbstractHandler

`service`

### Fields inherited from interface org.apache.calcite.avatica.remote.Handler

`HANDLER_SERIALIZATION_METRICS_NAME, HTTP_INTERNAL_SERVER_ERROR, HTTP_OK, HTTP_UNAUTHENTICATED, HTTP_UNAUTHORIZED`

## Constructor Summary

Constructors
Constructor
Description
`ProtobufHandler(Service service, ProtobufTranslation translation, org.apache.calcite.avatica.metrics.MetricsSystem metrics)`

## Method Summary

Modifier and Type
Method
Description
`Handler.HandlerResponse<byte[]>`
`apply(byte[] requestBytes)`
Compute a response for the given request, handling errors generated by that computation.

### Methods inherited from class org.apache.calcite.avatica.remote.AbstractHandler

`convertToErrorResponse, setRpcMetadata, unauthenticatedErrorResponse, unauthorizedErrorResponse`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ProtobufHandler

public ProtobufHandler(Service service, ProtobufTranslation translation, org.apache.calcite.avatica.metrics.MetricsSystem metrics)

## Method Details

### apply

public Handler.HandlerResponse<byte[]> apply(byte[] requestBytes)
Description copied from class: `AbstractHandler`
Compute a response for the given request, handling errors generated by that computation.

Specified by:
  `apply` in interface `Handler<byte[]>`
Overrides:
  `apply` in class `AbstractHandler<byte[]>`
Parameters:
  `requestBytes` - The caller's request.
Returns:
  A `Service.Response` with additional context about that response.