use of com.scalar.db.rpc.TwoPhaseCommitTransactionResponse.GetResponse in project scalardb by scalar-labs.
the class GrpcTwoPhaseCommitTransactionOnBidirectionalStream method get.
public Optional<Result> get(Get get) throws CrudException {
throwIfTransactionFinished();
ResponseOrError responseOrError = sendRequest(TwoPhaseCommitTransactionRequest.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