throw ISE when no servers found at all

This commit is contained in:
fjy 2014-04-16 10:27:34 -07:00
parent 6306e87a96
commit c6274762b7
1 changed files with 3 additions and 2 deletions

View File

@ -20,6 +20,7 @@
package io.druid.server.router; package io.druid.server.router;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.metamx.common.ISE;
import com.metamx.common.Pair; import com.metamx.common.Pair;
import com.metamx.emitter.EmittingLogger; import com.metamx.emitter.EmittingLogger;
import io.druid.client.selector.Server; import io.druid.client.selector.Server;
@ -67,7 +68,7 @@ public class QueryHostFinder<T>
"Catastrophic failure! No servers found at all! Failing request!" "Catastrophic failure! No servers found at all! Failing request!"
).emit(); ).emit();
return null; throw new ISE("No server found for query[%s]", query);
} }
log.debug("Selected [%s]", server.getHost()); log.debug("Selected [%s]", server.getHost());
@ -84,7 +85,7 @@ public class QueryHostFinder<T>
"Catastrophic failure! No servers found at all! Failing request!" "Catastrophic failure! No servers found at all! Failing request!"
).emit(); ).emit();
return null; throw new ISE("No default server found!");
} }
return server.getHost(); return server.getHost();