use of io.dingodb.store.row.cmd.store.NodeExecuteRequest in project dingo by dingodb.
the class DefaultDingoRowStore method internalExecute.
private void internalExecute(final String regionId, final NodeExecutor executor, final CompletableFuture<Boolean> future, final int retriesLeft, final Errors lastCause) {
final Region region = this.pdClient.getRegionById(regionId);
final RegionEngine regionEngine = getRegionEngine(region.getId(), true);
final RetryRunner retryRunner = retryCause -> internalExecute(regionId, executor, future, retriesLeft - 1, retryCause);
final FailoverClosure<Boolean> closure = new FailoverClosureImpl<>(future, retriesLeft, retryRunner);
if (regionEngine != null) {
if (ensureOnValidEpoch(region, regionEngine, closure)) {
getRawKVStore(regionEngine).execute(executor, true, closure);
}
} else {
final NodeExecuteRequest request = new NodeExecuteRequest();
request.setNodeExecutor(executor);
request.setRegionId(region.getId());
request.setRegionEpoch(region.getRegionEpoch());
this.dingoRowStoreRpcService.callAsyncWithRpc(request, closure, lastCause);
}
}
Aggregations