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