use of com.scalar.db.rpc.TransactionResponse.GetResponse in project scalardb by scalar-labs.
the class GrpcTransactionOnBidirectionalStream method get.
public Optional<Result> get(Get get) throws CrudException {
throwIfTransactionFinished();
ResponseOrError responseOrError = sendRequest(TransactionRequest.newBuilder().setGetRequest(GetRequest.newBuilder().setGet(ProtoUtils.toGet(get))).build());
throwIfErrorForCrud(responseOrError);
GetResponse getResponse = responseOrError.getResponse().getGetResponse();
if (getResponse.hasResult()) {
TableMetadata tableMetadata = getTableMetadata(get);
return Optional.of(ProtoUtils.toResult(getResponse.getResult(), tableMetadata));
}
return Optional.empty();
}
Aggregations