From a96dfc7742444e7b951106bdaa60e5c7a02ee0b0 Mon Sep 17 00:00:00 2001 From: fjy Date: Wed, 19 Mar 2014 10:30:52 -0700 Subject: [PATCH] clean up failure scenarios --- .../server/router/TierAwareQueryRunner.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/server/src/main/java/io/druid/server/router/TierAwareQueryRunner.java b/server/src/main/java/io/druid/server/router/TierAwareQueryRunner.java index 5acb1b6dd8c..381d3c2e82d 100644 --- a/server/src/main/java/io/druid/server/router/TierAwareQueryRunner.java +++ b/server/src/main/java/io/druid/server/router/TierAwareQueryRunner.java @@ -84,12 +84,12 @@ public class TierAwareQueryRunner implements QueryRunner String brokerServiceName = brokerSelector.select(query); if (brokerServiceName == null) { - log.error( + log.makeAlert( "WTF?! No brokerServiceName found for datasource[%s], intervals[%s]. Using default[%s].", query.getDataSource(), query.getIntervals(), tierConfig.getDefaultBrokerServiceName() - ); + ).emit(); brokerServiceName = tierConfig.getDefaultBrokerServiceName(); } @@ -97,11 +97,11 @@ public class TierAwareQueryRunner implements QueryRunner Server server; if (selector == null) { - log.error( + log.makeAlert( "WTF?! No selector found for brokerServiceName[%s]. Using default selector for[%s]", brokerServiceName, tierConfig.getDefaultBrokerServiceName() - ); + ).emit(); selector = selectorMap.get(tierConfig.getDefaultBrokerServiceName()); if (selector != null) { @@ -122,11 +122,11 @@ public class TierAwareQueryRunner implements QueryRunner server = serverBackup.get(brokerServiceName); if (server == null) { - log.error( + log.makeAlert( "WTF?! No backup found for brokerServiceName[%s]. Using default[%s]", brokerServiceName, tierConfig.getDefaultBrokerServiceName() - ); + ).emit(); server = serverBackup.get(tierConfig.getDefaultBrokerServiceName()); } @@ -144,10 +144,8 @@ public class TierAwareQueryRunner implements QueryRunner if (server == null) { log.makeAlert( - "Catastrophic failure! No servers found for default broker [%s]!", - tierConfig.getDefaultBrokerServiceName() + "Catastrophic failure! No servers found at all! Failing request!" ).emit(); - return Sequences.empty(); }