Java Code Examples for org.apache.calcite.avatica.Meta#ConnectionProperties

The following examples show how to use org.apache.calcite.avatica.Meta#ConnectionProperties . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Service.java    From calcite-avatica with Apache License 2.0 6 votes vote down vote up
@Override ConnectionSyncRequest deserialize(Message genericMsg) {
  final Requests.ConnectionSyncRequest msg = ProtobufService.castProtobufMessage(genericMsg,
      Requests.ConnectionSyncRequest.class);

  String connectionId = null;
  if (msg.hasField(CONNECTION_ID_DESCRIPTOR)) {
    connectionId = msg.getConnectionId();
  }

  Meta.ConnectionProperties connProps = null;
  if (msg.hasField(CONN_PROPS_DESCRIPTOR)) {
    connProps = ConnectionPropertiesImpl.fromProto(msg.getConnProps());
  }

  return new ConnectionSyncRequest(connectionId, connProps);
}
 
Example 2
Source File: Service.java    From calcite-avatica with Apache License 2.0 5 votes vote down vote up
@JsonCreator
public ConnectionSyncRequest(
    @JsonProperty("connectionId") String connectionId,
    @JsonProperty("connProps") Meta.ConnectionProperties connProps) {
  this.connectionId = connectionId;
  this.connProps = connProps;
}
 
Example 3
Source File: LocalService.java    From calcite-avatica with Apache License 2.0 5 votes vote down vote up
public ConnectionSyncResponse apply(ConnectionSyncRequest request) {
  try (final Context ignore = connectionSyncTimer.start()) {
    final Meta.ConnectionHandle ch =
        new Meta.ConnectionHandle(request.connectionId);
    final Meta.ConnectionProperties connProps =
        meta.connectionSync(ch, request.connProps);
    return new ConnectionSyncResponse(connProps, serverLevelRpcMetadata);
  }
}
 
Example 4
Source File: Service.java    From calcite-avatica with Apache License 2.0 4 votes vote down vote up
@JsonCreator
public ConnectionSyncResponse(@JsonProperty("connProps") Meta.ConnectionProperties connProps,
    @JsonProperty("rpcMetadata") RpcMetadataResponse rpcMetadata) {
  this.connProps = connProps;
  this.rpcMetadata = rpcMetadata;
}