use of org.apache.bookkeeper.stream.proto.kv.rpc.TxnRequest in project bookkeeper by apache.
the class StorageContainerImpl method txn.
@Override
public CompletableFuture<StorageContainerResponse> txn(StorageContainerRequest request) {
checkArgument(KV_TXN_REQ == request.getRequestCase());
long scId = request.getScId();
TxnRequest rr = request.getKvTxnReq();
RoutingHeader header = rr.getHeader();
RangeId rid = RangeId.of(header.getStreamId(), header.getRangeId());
TableStore store = tableStoreCache.getTableStore(rid);
if (null != store) {
return store.txn(request);
} else {
return tableStoreCache.openTableStore(scId, rid).thenCompose(s -> s.txn(request));
}
}
Aggregations