From c6274762b73d48c738a51c8442323ba2b40fc1bc Mon Sep 17 00:00:00 2001 From: fjy Date: Wed, 16 Apr 2014 10:27:34 -0700 Subject: [PATCH] throw ISE when no servers found at all --- .../main/java/io/druid/server/router/QueryHostFinder.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/io/druid/server/router/QueryHostFinder.java b/server/src/main/java/io/druid/server/router/QueryHostFinder.java index 17b4db1104c..ed2c8096c5a 100644 --- a/server/src/main/java/io/druid/server/router/QueryHostFinder.java +++ b/server/src/main/java/io/druid/server/router/QueryHostFinder.java @@ -20,6 +20,7 @@ package io.druid.server.router; import com.google.inject.Inject; +import com.metamx.common.ISE; import com.metamx.common.Pair; import com.metamx.emitter.EmittingLogger; import io.druid.client.selector.Server; @@ -67,7 +68,7 @@ public class QueryHostFinder "Catastrophic failure! No servers found at all! Failing request!" ).emit(); - return null; + throw new ISE("No server found for query[%s]", query); } log.debug("Selected [%s]", server.getHost()); @@ -84,7 +85,7 @@ public class QueryHostFinder "Catastrophic failure! No servers found at all! Failing request!" ).emit(); - return null; + throw new ISE("No default server found!"); } return server.getHost();