private CompletableFuture<Void> shutDownServices() { synchronized (lock) { Collection<CompletableFuture<Void>> terminationFutures = new ArrayList<>(3); Exception exception = null; try { blobCacheService.close(); } catch (Exception e) { exception = ExceptionUtils.firstOrSuppressed(e, exception); } try { metricRegistry.shutdown(); } catch (Exception e) { exception = ExceptionUtils.firstOrSuppressed(e, exception); } try { highAvailabilityServices.close(); } catch (Exception e) { exception = ExceptionUtils.firstOrSuppressed(e, exception); } terminationFutures.add(rpcService.stopService()); terminationFutures.add(ExecutorUtils.nonBlockingShutdown(timeout.toMilliseconds(), TimeUnit.MILLISECONDS, executor)); if (exception != null) { terminationFutures.add(FutureUtils.completedExceptionally(exception)); } return FutureUtils.completeAll(terminationFutures); } }
private CompletableFuture<Void> shutDownServices() { synchronized (lock) { Collection<CompletableFuture<Void>> terminationFutures = new ArrayList<>(3); Exception exception = null; try { blobCacheService.close(); } catch (Exception e) { exception = ExceptionUtils.firstOrSuppressed(e, exception); } try { metricRegistry.shutdown(); } catch (Exception e) { exception = ExceptionUtils.firstOrSuppressed(e, exception); } if (metricQueryServiceActorSystem != null) { terminationFutures.add(AkkaUtils.terminateActorSystem(metricQueryServiceActorSystem)); } try { highAvailabilityServices.close(); } catch (Exception e) { exception = ExceptionUtils.firstOrSuppressed(e, exception); } terminationFutures.add(rpcService.stopService()); terminationFutures.add(ExecutorUtils.nonBlockingShutdown(timeout.toMilliseconds(), TimeUnit.MILLISECONDS, executor)); if (exception != null) { terminationFutures.add(FutureUtils.completedExceptionally(exception)); } return FutureUtils.completeAll(terminationFutures); } }
private CompletableFuture<Void> shutDownServices() { synchronized (lock) { Collection<CompletableFuture<Void>> terminationFutures = new ArrayList<>(3); Exception exception = null; try { blobCacheService.close(); } catch (Exception e) { exception = ExceptionUtils.firstOrSuppressed(e, exception); } try { metricRegistry.shutdown(); } catch (Exception e) { exception = ExceptionUtils.firstOrSuppressed(e, exception); } if (metricQueryServiceActorSystem != null) { terminationFutures.add(AkkaUtils.terminateActorSystem(metricQueryServiceActorSystem)); } try { highAvailabilityServices.close(); } catch (Exception e) { exception = ExceptionUtils.firstOrSuppressed(e, exception); } terminationFutures.add(rpcService.stopService()); terminationFutures.add(ExecutorUtils.nonBlockingShutdown(timeout.toMilliseconds(), TimeUnit.MILLISECONDS, executor)); if (exception != null) { terminationFutures.add(FutureUtils.completedExceptionally(exception)); } return FutureUtils.completeAll(terminationFutures); } }
if (blobCacheService != null) { try { blobCacheService.close(); } catch (Exception e) { exception = ExceptionUtils.firstOrSuppressed(e, exception);
if (blobCacheService != null) { try { blobCacheService.close(); } catch (Exception e) { exception = ExceptionUtils.firstOrSuppressed(e, exception);
if (blobCacheService != null) { try { blobCacheService.close(); } catch (Exception e) { exception = ExceptionUtils.firstOrSuppressed(e, exception);