/** * Shuts down the client. This stops the internal actor system and actors. */ public void shutdown() throws Exception { synchronized (this) { actorSystemLoader.close(); if (!sharedHaServices && highAvailabilityServices != null) { highAvailabilityServices.close(); } } }
/** * FLINK-6641 * * <p>Tests that the {@link ClusterClient} does not clean up HA data when being shut down. */ @Test public void testClusterClientShutdown() throws Exception { Configuration config = new Configuration(); HighAvailabilityServices highAvailabilityServices = mock(HighAvailabilityServices.class); StandaloneClusterClient clusterClient = new StandaloneClusterClient(config, highAvailabilityServices, false); clusterClient.shutdown(); // check that the client does not clean up HA data but closes the services verify(highAvailabilityServices, never()).closeAndCleanupAllData(); verify(highAvailabilityServices).close(); }
haServices.closeAndCleanupAllData(); } else { haServices.close();
highAvailabilityServices.close(); } catch (Throwable t) { LOG.error("Failed to stop the high availability services.", t);
haServices.closeAndCleanupAllData(); } else { haServices.close();
/** * Shuts down the client. This stops the internal actor system and actors. */ public void shutdown() throws Exception { synchronized (this) { actorSystemLoader.shutdown(); if (!sharedHaServices && highAvailabilityServices != null) { highAvailabilityServices.close(); } } }
haServices.closeAndCleanupAllData(); } else { haServices.close();
/** * Shuts down the client. This stops the internal actor system and actors. */ public void shutdown() throws Exception { synchronized (this) { actorSystemLoader.close(); if (!sharedHaServices && highAvailabilityServices != null) { highAvailabilityServices.close(); } } }
/** * Shuts down the client. This stops the internal actor system and actors. */ public void shutdown() throws Exception { synchronized (this) { try { finalizeCluster(); } finally { actorSystemLoader.shutdown(); } if (highAvailabilityServices != null) { highAvailabilityServices.close(); } } }
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); } }
highAvailabilityServices.close(); } catch (Throwable t) { LOG.error("Failed to stop the high availability services.", t);
highAvailabilityServices.close(); } catch (Throwable t) { LOG.error("Failed to stop the high availability services.", t);