private Long attemptToParse(String toParse, String key, String diskId) { Long val = null; if (toParse != null) { try { val = Long.valueOf(toParse); } catch (NumberFormatException e) { logger.warn("%s for disk %s not a number [%s]", key, diskId, toParse); } } return val; }
private Long attemptToParse(String toParse, String key, String diskId) { Long val = null; if (toParse != null) { try { val = Long.valueOf(toParse); } catch (NumberFormatException e) { logger.warn("%s for disk %s not a number [%s]", key, diskId, toParse); } } return val; }
public boolean verify(String hostname, SSLSession session) { String peerHost = session.getPeerHost(); if (!hostname.equals(peerHost)) { String oldPeerHost = sslMap.get(hostname); if (oldPeerHost == null || !oldPeerHost.equals(peerHost)) { logger.warn("hostname was %s while session was %s", hostname, peerHost); sslMap.put(hostname, peerHost); } } return true; } }
public boolean apply(String input) { try { NodeMetadata md = destroyNodeStrategy.destroyNode(id); if (md != null) node.set(md); return true; } catch (IllegalStateException e) { logger.warn("<< illegal state destroying node(%s)", id); return false; } } }, timeouts.nodeTerminated, 1000, MILLISECONDS);
protected NoSuchElementException throwNoSuchElementExceptionAfterLoggingHardwareIds(String message, Iterable<? extends Hardware> hardwares) { NoSuchElementException exception = new NoSuchElementException(message); if (logger.isTraceEnabled()) logger.warn(exception, "hardware ids that didn't match: %s", transform(hardwares, hardwareToId)); throw exception; }
@Override public void close() throws IOException { List<Runnable> runnables = service.shutdownNow(); if (runnables.size() > 0) logger.warn("when shutting down executor %s, runnables outstanding: %s", service, runnables); } }
@Override public void close() throws IOException { List<Runnable> runnables = service.shutdownNow(); if (runnables.size() > 0) logger.warn("when shutting down executor %s, runnables outstanding: %s", service, runnables); } }
public boolean apply(String input) { try { LoadBalancerMetadata md = destroyLoadBalancerStrategy.destroyLoadBalancer(id); if (md != null) loadBalancer.set(md); return true; } catch (IllegalStateException e) { logger.warn("<< illegal state destroying load balancer(%s)", id); return false; } } }, 3000, 1000, MILLISECONDS);// TODO make timeouts class like ComputeServiceconstants
@Override public void close() throws IOException { List<Runnable> runnables = service.shutdownNow(); if (runnables.size() > 0) logger.warn("when shutting down executor %s, runnables outstanding: %s", service, runnables); } }
public boolean verify(String hostname, SSLSession session) { String peerHost = session.getPeerHost(); if (!hostname.equals(peerHost)) { String oldPeerHost = sslMap.get(hostname); if (oldPeerHost == null || !oldPeerHost.equals(peerHost)) { logger.warn("hostname was %s while session was %s", hostname, peerHost); sslMap.put(hostname, peerHost); } } return true; } }
@Override public void close() throws IOException { List<Runnable> runnables = service.shutdownNow(); if (!runnables.isEmpty()) logger.warn("when shutting down executor %s, runnables outstanding: %s", service, runnables); } }
protected NoSuchElementException throwNoSuchElementExceptionAfterLoggingImageIds(String message, Iterable<? extends Image> images) { NoSuchElementException exception = new NoSuchElementException(message); if (logger.isTraceEnabled()) logger.warn(exception, "image ids that didn't match: %s", transform(images, imageToId)); throw exception; }
protected NoSuchElementException throwNoSuchElementExceptionAfterLoggingHardwareIds(String message, Iterable<? extends Hardware> hardwares) { NoSuchElementException exception = new NoSuchElementException(message); if (logger.isTraceEnabled()) logger.warn(exception, "hardware ids that didn't match: %s", transform(hardwares, hardwareToId)); throw exception; }
public boolean verify(String hostname, SSLSession session) { String peerHost = session.getPeerHost(); if (!hostname.equals(peerHost)) { String oldPeerHost = sslMap.get(hostname); if (oldPeerHost == null || !oldPeerHost.equals(peerHost)) { logger.warn("hostname was %s while session was %s", hostname, peerHost); sslMap.put(hostname, peerHost); } } return true; } }
@Override public ListenableFuture<DriveInfo> apply(String input) { try { return Futures.immediateFuture(cache.getUnchecked(input)); } catch (CacheLoader.InvalidCacheLoadException e) { logger.debug("drive %s not found", input); } catch (UncheckedExecutionException e) { logger.warn(e, "error finding drive %s: %s", input, e.getMessage()); } return Futures.immediateFuture(null); }
@Override public ListenableFuture<? extends DriveInfo> apply(String input) { try { return Futures.immediateFuture(cache.getUnchecked(input)); } catch (CacheLoader.InvalidCacheLoadException e) { logger.debug("drive %s not found", input); } catch (UncheckedExecutionException e) { logger.warn(e, "error finding drive %s: %s", input, e.getMessage()); } return Futures.immediateFuture(null); }
@Override public String apply(VAppTemplate vAppTemplate) { checkArgument(vAppTemplate != null, "vAppTemplate was null!"); Set<Network> networks = vAppTemplate.getNetworkSection().getNetworks(); checkArgument(networks.size() > 0, "no networks found in vAppTemplate %s", vAppTemplate); if (networks.size() > 1) logger.warn("multiple networks found for %s, choosing first from: %s", vAppTemplate.getName(), networks); return get(networks, 0).getName(); } }
String parseErrorFromContentOrNull(HttpCommand command, HttpResponse response) { if (response.getPayload() != null) { try { return Strings2.toString(response.getPayload()); } catch (IOException e) { logger.warn(e, "exception reading error from response", response); } } return null; } }
String parseErrorFromContentOrNull(HttpCommand command, HttpResponse response) { if (response.getPayload() != null) { try { return Strings2.toString(response.getPayload()); } catch (IOException e) { logger.warn(e, "exception reading error from response", response); } } return null; } }
@Override public void destroyNode(String id) { ZoneAndId zoneAndId = ZoneAndId.fromSlashEncoded(id); if (novaApi.getFloatingIPExtensionForZone(zoneAndId.getZone()).isPresent()) { try { removeFloatingIpFromNodeAndDeallocate.apply(zoneAndId); } catch (RuntimeException e) { logger.warn(e, "<< error removing and deallocating ip from node(%s): %s", id, e.getMessage()); } } novaApi.getServerApiForZone(zoneAndId.getZone()).delete(zoneAndId.getId()); }