removeNodeAndUpdateServers(cnce.getHost()); return;
@Override public <T extends JestResult> T execute(JestClient client, Action<T> clientRequest) { do { LOG.debug("Executing request {}", clientRequest); try { T result = client.execute(clientRequest); return result; } catch (CouldNotConnectException connectException) { LOG.error("Could not connect to elastic endpoint: {}", connectException.getHost(), connectException); } catch (IOException ex) { LOG.error("Could not perform request {}: {}", clientRequest, ex.getMessage(), ex); } catch (com.google.gson.JsonSyntaxException gsonException) { LOG.error("A Json error occurred: {}", gsonException.getMessage(), gsonException); } // Retry-Logic LOG.debug("Request was not executed properly. Attempting Retry..."); if (cooldownInMs > 0) { LOG.debug("Sleep " + cooldownInMs + " before retrying"); try { Thread.sleep(cooldownInMs); } catch (InterruptedException e) { throw new RuntimeException("Thread interrupted.", e); } } LOG.debug("Retrying now"); } while (true); }
@Override public <T extends JestResult> T execute(JestClient client, Action<T> clientRequest) { do { LOG.debug("Executing request {}", clientRequest); try { T result = client.execute(clientRequest); return result; } catch (CouldNotConnectException connectException) { LOG.error("Could not connect to elastic endpoint: {}", connectException.getHost(), connectException); } catch (IOException ex) { LOG.error("Could not perform request {}: {}", clientRequest, ex.getMessage(), ex); } catch (com.google.gson.JsonSyntaxException gsonException) { LOG.error("A Json error occurred: {}", gsonException.getMessage(), gsonException); } // Retry-Logic LOG.debug("Request was not executed properly. Attempting Retry..."); if (cooldownInMs > 0) { LOG.debug("Sleep " + cooldownInMs + " before retrying"); try { Thread.sleep(cooldownInMs); } catch (InterruptedException e) { throw new RuntimeException("Thread interrupted.", e); } } LOG.debug("Retrying now"); } while (true); }
removeNodeAndUpdateServers(cnce.getHost()); return;
removeNodeAndUpdateServers(cnce.getHost()); return;