org.apache.calcite.avatica.remote

## Class LocalService

- java.lang.Object
- - org.apache.calcite.avatica.remote.LocalService

All Implemented Interfaces:
  Service

    public class LocalService
    extends Object
    implements Service

Implementation of `Service` that talks to a local `Meta`.

### Nested Class Summary

### 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`

### Field Summary

Fields
`private Timer` `commitTimer`
`private Timer` `connectionSyncTimer`
`private Timer` `executeTimer`
`(package private) Meta` `meta`
`(package private) MetricsSystem` `metrics`
`private Timer` `prepareAndExecuteTimer`
`private Timer` `prepareTimer`
`private Service.RpcMetadataResponse` `serverLevelRpcMetadata`

### Constructor Summary

Constructors
Constructor and Description
`LocalService(Meta meta)`
`LocalService(Meta meta, MetricsSystem metrics)`

### Method Summary

Methods
`Service.ResultSetResponse` `apply(Service.CatalogsRequest request)`
`Service.CloseConnectionResponse` `apply(Service.CloseConnectionRequest request)`
`Service.CloseStatementResponse` `apply(Service.CloseStatementRequest request)`
`Service.ResultSetResponse` `apply(Service.ColumnsRequest request)`
`Service.CommitResponse` `apply(Service.CommitRequest request)`
`Service.ConnectionSyncResponse` `apply(Service.ConnectionSyncRequest request)`
`Service.CreateStatementResponse` `apply(Service.CreateStatementRequest request)`
`Service.DatabasePropertyResponse` `apply(Service.DatabasePropertyRequest request)`
`Service.ExecuteBatchResponse` `apply(Service.ExecuteBatchRequest request)`
`Service.ExecuteResponse` `apply(Service.ExecuteRequest request)`
`Service.FetchResponse` `apply(Service.FetchRequest request)`
`Service.OpenConnectionResponse` `apply(Service.OpenConnectionRequest request)`
`Service.ExecuteBatchResponse` `apply(Service.PrepareAndExecuteBatchRequest request)`
`Service.ExecuteResponse` `apply(Service.PrepareAndExecuteRequest request)`
`Service.PrepareResponse` `apply(Service.PrepareRequest request)`
`Service.RollbackResponse` `apply(Service.RollbackRequest request)`
`Service.ResultSetResponse` `apply(Service.SchemasRequest request)`
`Service.SyncResultsResponse` `apply(Service.SyncResultsRequest request)`
`Service.ResultSetResponse` `apply(Service.TablesRequest request)`
`Service.ResultSetResponse` `apply(Service.TableTypesRequest request)`
`Service.ResultSetResponse` `apply(Service.TypeInfoRequest request)`
`private static <E> List<E>` `list(Iterable<E> iterable)`
`private List<List<Object>>` `list2(Meta.MetaResultSet resultSet)`
`private static String` `name(String timer)`
`void` `setRpcMetadata(Service.RpcMetadataResponse serverLevelRpcMetadata)` Sets server-level metadata for RPCs.
`Service.ResultSetResponse` `toResponse(Meta.MetaResultSet resultSet)` Converts a result set (not serializable) into a serializable response.

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

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

### Field Detail

#### meta

    final Meta meta

#### metrics

    final MetricsSystem metrics

#### executeTimer

    private final Timer executeTimer

#### commitTimer

    private final Timer commitTimer

#### prepareTimer

    private final Timer prepareTimer

#### prepareAndExecuteTimer

    private final Timer prepareAndExecuteTimer

#### connectionSyncTimer

    private final Timer connectionSyncTimer

#### serverLevelRpcMetadata

    private Service.RpcMetadataResponse serverLevelRpcMetadata

### Constructor Detail

#### LocalService

    public LocalService(Meta meta)

#### LocalService

    public LocalService(Meta meta,
                MetricsSystem metrics)

### Method Detail

#### name

    private static String name(String timer)

#### setRpcMetadata

    public void setRpcMetadata(Service.RpcMetadataResponse serverLevelRpcMetadata)

Description copied from interface: `Service`
Sets server-level metadata for RPCs. This includes information that is static across all RPCs.

Specified by:
  `setRpcMetadata` in interface `Service`
Parameters:
  `serverLevelRpcMetadata` - The server-level metadata.

#### list

    private static <E> List<E> list(Iterable<E> iterable)

#### toResponse

    public Service.ResultSetResponse toResponse(Meta.MetaResultSet resultSet)

Converts a result set (not serializable) into a serializable response.

#### list2

    private List<List<Object>> list2(Meta.MetaResultSet resultSet)

#### apply

    public Service.ResultSetResponse apply(Service.CatalogsRequest request)

Specified by:
  `apply` in interface `Service`

#### apply

    public Service.ResultSetResponse apply(Service.SchemasRequest request)

Specified by:
  `apply` in interface `Service`

#### apply

    public Service.ResultSetResponse apply(Service.TablesRequest request)

Specified by:
  `apply` in interface `Service`

#### apply

    public Service.ResultSetResponse apply(Service.TableTypesRequest request)

Specified by:
  `apply` in interface `Service`

#### apply

    public Service.ResultSetResponse apply(Service.TypeInfoRequest request)

Specified by:
  `apply` in interface `Service`

#### apply

    public Service.ResultSetResponse apply(Service.ColumnsRequest request)

Specified by:
  `apply` in interface `Service`

#### apply

    public Service.PrepareResponse apply(Service.PrepareRequest request)

Specified by:
  `apply` in interface `Service`

#### apply

    public Service.ExecuteResponse apply(Service.PrepareAndExecuteRequest request)

Specified by:
  `apply` in interface `Service`

#### apply

    public Service.FetchResponse apply(Service.FetchRequest request)

Specified by:
  `apply` in interface `Service`

#### apply

    public Service.ExecuteResponse apply(Service.ExecuteRequest request)

Specified by:
  `apply` in interface `Service`

#### apply

    public Service.CreateStatementResponse apply(Service.CreateStatementRequest request)

Specified by:
  `apply` in interface `Service`

#### apply

    public Service.CloseStatementResponse apply(Service.CloseStatementRequest request)

Specified by:
  `apply` in interface `Service`

#### apply

    public Service.OpenConnectionResponse apply(Service.OpenConnectionRequest request)

Specified by:
  `apply` in interface `Service`

#### apply

    public Service.CloseConnectionResponse apply(Service.CloseConnectionRequest request)

Specified by:
  `apply` in interface `Service`

#### apply

    public Service.ConnectionSyncResponse apply(Service.ConnectionSyncRequest request)

Specified by:
  `apply` in interface `Service`

#### apply

    public Service.DatabasePropertyResponse apply(Service.DatabasePropertyRequest request)

Specified by:
  `apply` in interface `Service`

#### apply

    public Service.SyncResultsResponse apply(Service.SyncResultsRequest request)

Specified by:
  `apply` in interface `Service`

#### apply

    public Service.CommitResponse apply(Service.CommitRequest request)

Specified by:
  `apply` in interface `Service`

#### apply

    public Service.RollbackResponse apply(Service.RollbackRequest request)

Specified by:
  `apply` in interface `Service`

#### apply

    public Service.ExecuteBatchResponse apply(Service.PrepareAndExecuteBatchRequest request)

Specified by:
  `apply` in interface `Service`

#### apply

    public Service.ExecuteBatchResponse apply(Service.ExecuteBatchRequest request)

Specified by:
  `apply` in interface `Service`