From 2f45c9638e8e8e760b77e6ca8868a1ba27ddc9ff Mon Sep 17 00:00:00 2001 From: Boaz Leskes Date: Mon, 30 Dec 2013 22:36:40 +0100 Subject: [PATCH] removed an unneeded getInputStream command which threw a FileNotFound exception. Also - no exporting will occur if loading/verifying index template failed (but it will keep on retrying). --- .../elasticsearch/marvel/monitor/exporter/ESExporter.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exporter/src/main/java/org/elasticsearch/marvel/monitor/exporter/ESExporter.java b/exporter/src/main/java/org/elasticsearch/marvel/monitor/exporter/ESExporter.java index 5f55187ac144..068467e22b7a 100644 --- a/exporter/src/main/java/org/elasticsearch/marvel/monitor/exporter/ESExporter.java +++ b/exporter/src/main/java/org/elasticsearch/marvel/monitor/exporter/ESExporter.java @@ -432,8 +432,8 @@ public class ESExporter extends AbstractLifecycleComponent implement return false; } - boolean hasDoc = conn.getResponseCode() == 200; - conn.getInputStream().close(); // close and release to connection pool. + boolean hasDoc; + hasDoc = conn.getResponseCode() == 200; // nothing there, lets create it if (!hasDoc) { @@ -464,8 +464,8 @@ public class ESExporter extends AbstractLifecycleComponent implement try { return checkAndUpload("_template/marvel", template); } catch (IOException e) { - logger.error("error when checking/adding index template", e); - return false; + // if we're not sure of the template, we can't send data... re-raise exception. + throw new ElasticSearchException("failed to load/verify index template", e); } }