@Test public void testWarmUpConnectionFailureHandling() throws Exception { Properties props = getNonBlockingRouterProperties("DC3"); MockServerLayout mockServerLayout = new MockServerLayout(mockClusterMap); mockSelectorState.set(MockSelectorState.FailConnectionInitiationOnPoll); setRouter(props, mockServerLayout, new LoggingNotificationSystem()); for (DataNodeId node : mockClusterMap.getDataNodes()) { assertTrue("Node should be marked as timed out by ResponseHandler.", ((MockDataNodeId) node).isTimedOut()); } router.close(); mockSelectorState.set(MockSelectorState.Good); }
@Override public void close() { shutDownOperationControllers(); waitForResponseHandlerThreadExit(); if (kms != null) { try { kms.close(); } catch (IOException e) { logger.error("Exception thrown on closing KMS", e); } } if (cryptoJobHandler != null) { cryptoJobHandler.close(); } for (Closeable resource : resourcesToClose) { try { resource.close(); } catch (IOException e) { logger.error("Exception thrown on closing {}", resource.getClass().getName()); } } routerMetrics.close(); }
NonBlockingRouter implements Router { @Override public void close() { shutDownOperationControllers(); waitForResponseHandlerThreadExit(); if (kms != null) { try { kms.close(); } catch (IOException e) { logger.error("Exception thrown on closing KMS", e); } } if (cryptoJobHandler != null) { cryptoJobHandler.close(); } for (Closeable resource : resourcesToClose) { try { resource.close(); } catch (IOException e) { logger.error("Exception thrown on closing {}", resource.getClass().getName()); } } routerMetrics.close(); } }
NonBlockingRouter implements Router { @Override public void close() { shutDownOperationControllers(); waitForResponseHandlerThreadExit(); if (kms != null) { try { kms.close(); } catch (IOException e) { logger.error("Exception thrown on closing KMS", e); } } if (cryptoJobHandler != null) { cryptoJobHandler.close(); } for (Closeable resource : resourcesToClose) { try { resource.close(); } catch (IOException e) { logger.error("Exception thrown on closing {}", resource.getClass().getName()); } } routerMetrics.close(); } NonBlockingRouter(RouterConfig routerConfig, NonBlockingRouterMetrics routerMetrics,
      NetworkClientFactory networkClientFactory, NotificationSystem notificationSystem, ClusterMap clusterMap,
      KeyManagementService kms, CryptoService cryptoService, CryptoJobHandler cryptoJobHandler,
      AccountService accountService, Time time, String defaultPartitionClass); }
NonBlockingRouter implements Router { @Override public void close() { shutDownOperationControllers(); waitForResponseHandlerThreadExit(); if (kms != null) { try { kms.close(); } catch (IOException e) { logger.error("Exception thrown on closing KMS", e); } } if (cryptoJobHandler != null) { cryptoJobHandler.close(); } for (Closeable resource : resourcesToClose) { try { resource.close(); } catch (IOException e) { logger.error("Exception thrown on closing {}", resource.getClass().getName()); } } routerMetrics.close(); } NonBlockingRouter(RouterConfig routerConfig, NonBlockingRouterMetrics routerMetrics,
      NetworkClientFactory networkClientFactory, NotificationSystem notificationSystem, ClusterMap clusterMap,
      KeyManagementService kms, CryptoService cryptoService, CryptoJobHandler cryptoJobHandler,
      AccountService accountService, Time time, String defaultPartitionClass); @Override Future<GetBlobResult> getBlob(String blobIdStr, GetBlobOptions options,
      final Callback<GetBlobResult> callback); @Override Future<String> putBlob(BlobProperties blobProperties, byte[] userMetadata, ReadableStreamChannel channel,
      PutBlobOptions options, Callback<String> callback); @Override Future<String> stitchBlob(BlobProperties blobProperties, byte[] userMetadata, List<ChunkInfo> chunksToStitch,
      Callback<String> callback); @Override Future<Void> deleteBlob(String blobId, String serviceId, Callback<Void> callback); @Override Future<Void> undeleteBlob(String blobId, String serviceId, Callback<Void> callback); @Override Future<Void> updateBlobTtl(String blobId, String serviceId, long expiresAtMs, Callback<Void> callback); @Override void close(); }
NonBlockingRouter implements Router { @Override public void close() { shutDownOperationControllers(); waitForResponseHandlerThreadExit(); if (kms != null) { try { kms.close(); } catch (IOException e) { logger.error("Exception thrown on closing KMS", e); } } if (cryptoJobHandler != null) { cryptoJobHandler.close(); } for (Closeable resource : resourcesToClose) { try { resource.close(); } catch (IOException e) { logger.error("Exception thrown on closing {}", resource.getClass().getName()); } } routerMetrics.close(); } NonBlockingRouter(RouterConfig routerConfig, NonBlockingRouterMetrics routerMetrics,
      NetworkClientFactory networkClientFactory, NotificationSystem notificationSystem, ClusterMap clusterMap,
      KeyManagementService kms, CryptoService cryptoService, CryptoJobHandler cryptoJobHandler,
      AccountService accountService, Time time, String defaultPartitionClass); @Override Future<GetBlobResult> getBlob(String blobIdStr, GetBlobOptions options,
      final Callback<GetBlobResult> callback); @Override Future<String> putBlob(BlobProperties blobProperties, byte[] userMetadata, ReadableStreamChannel channel,
      PutBlobOptions options, Callback<String> callback); @Override Future<String> stitchBlob(BlobProperties blobProperties, byte[] userMetadata, List<ChunkInfo> chunksToStitch,
      Callback<String> callback); @Override Future<Void> deleteBlob(String blobId, String serviceId, Callback<Void> callback); @Override Future<Void> undeleteBlob(String blobId, String serviceId, Callback<Void> callback); @Override Future<Void> updateBlobTtl(String blobId, String serviceId, long expiresAtMs, Callback<Void> callback); @Override void close();  }