Provide info when no Backend was loaded.
This commit is contained in:
@ -95,11 +95,14 @@ public class QueryRestController {
|
|||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void afterPropertiesSet() {
|
public void afterPropertiesSet() {
|
||||||
|
List<Exception> exceptions = new ArrayList<>();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
QueryProcessor queryProcessor =
|
QueryProcessor queryProcessor =
|
||||||
appContext.getBean(QueryConfig.BEAN_NAME_CASSANDRA_QUERY_PROCESSOR, QueryProcessor.class);
|
appContext.getBean(QueryConfig.BEAN_NAME_CASSANDRA_QUERY_PROCESSOR, QueryProcessor.class);
|
||||||
queryProcessors.put(queryProcessor.getBackend(), queryProcessor);
|
queryProcessors.put(queryProcessor.getBackend(), queryProcessor);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
exceptions.add(e);
|
||||||
LOGGER.warn("");
|
LOGGER.warn("");
|
||||||
LOGGER.warn("##########");
|
LOGGER.warn("##########");
|
||||||
LOGGER.warn("Could not load query processor for cassandra.");
|
LOGGER.warn("Could not load query processor for cassandra.");
|
||||||
@ -112,6 +115,7 @@ public class QueryRestController {
|
|||||||
appContext.getBean(QueryConfig.BEAN_NAME_ARCHIVER_APPLIANCE_QUERY_PROCESSOR, QueryProcessor.class);
|
appContext.getBean(QueryConfig.BEAN_NAME_ARCHIVER_APPLIANCE_QUERY_PROCESSOR, QueryProcessor.class);
|
||||||
queryProcessors.put(queryProcessor.getBackend(), queryProcessor);
|
queryProcessors.put(queryProcessor.getBackend(), queryProcessor);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
exceptions.add(e);
|
||||||
LOGGER.warn("");
|
LOGGER.warn("");
|
||||||
LOGGER.warn("##########");
|
LOGGER.warn("##########");
|
||||||
LOGGER.warn("Could not load query processor for archiverappliance.");
|
LOGGER.warn("Could not load query processor for archiverappliance.");
|
||||||
@ -119,6 +123,15 @@ public class QueryRestController {
|
|||||||
LOGGER.warn("");
|
LOGGER.warn("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(queryProcessors.isEmpty()){
|
||||||
|
LOGGER.error("No query processor could be loaded! Exceptions were: ");
|
||||||
|
for (Exception exception : exceptions) {
|
||||||
|
LOGGER.error("", exception);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new RuntimeException("No Backends available!");
|
||||||
|
}
|
||||||
|
|
||||||
channelNameCache =
|
channelNameCache =
|
||||||
new ChannelNameCache(queryProcessors, appContext.getBean(CassandraConfig.BEAN_NAME_READ_TIMEOUT,
|
new ChannelNameCache(queryProcessors, appContext.getBean(CassandraConfig.BEAN_NAME_READ_TIMEOUT,
|
||||||
Integer.class).longValue());
|
Integer.class).longValue());
|
||||||
|
Reference in New Issue
Block a user