jjzjj

withFallback

全部标签

java - CompletableFuture withFallback/只处理一些错误

我正在通过CompletableFuture接收来自服务调用的响应。我想处理服务返回的一些已知异常,例如乐观并发控制冲突。这是我得到的。有没有更好的不包装异常或使用SneakyThrows的方法?包装异常意味着其他异常处理程序必须检查因果链,而不是仅仅使用instanceof。someService.call(request).handle((response,error)->{if(error==null)returnCompletableFuture.completedFuture(response);elseif(errorinstanceofOCCException)retur

hadoop - 使用 Yarn 运行 spark 作业时出现错误 :com. google.common.util.concurrent.Futures.withFallback

我正在尝试使用yarn运行spark作业,但出现以下错误java.lang.NoSuchMethodError:com.google.common.util.concurrent.Futures.withFallback(Lcom/google/common/util/concurrent/ListenableFuture;Lcom/google/common/util/concurrent/FutureFallback;Ljava/util/concurrent/Executor;)Lcom/google/common/util/concurrent/ListenableFuture