a2l007 commented on a change in pull request #10421:
URL: https://github.com/apache/druid/pull/10421#discussion_r509440346
##########
File path:
server/src/main/java/org/apache/druid/query/lookup/LookupReferencesManager.java
##########
@@ -587,6 +594,43 @@ private StringFullResponseHolder
fetchLookupsForTier(String tier) throws Interru
void handle(Map<String, LookupExtractorFactoryContainer> lookupMap) throws
Exception;
}
+ private static class StatusNotice implements Notice
+ {
+ private final LookupReferencesManager manager;
+ private final String lookupName;
+ private final LookupExtractorFactoryContainer
lookupExtractorFactoryContainer;
+
+ public StatusNotice(
+ LookupReferencesManager manager,
+ String lookupName,
+ LookupExtractorFactoryContainer lookupExtractorFactoryContainer
+ )
+ {
+ this.manager = manager;
+ this.lookupName = lookupName;
+ this.lookupExtractorFactoryContainer = lookupExtractorFactoryContainer;
+ }
+
+ @Override
+ public void handle(Map<String, LookupExtractorFactoryContainer> lookupMap)
+ {
+ if
(lookupExtractorFactoryContainer.getLookupExtractorFactory().isReady()) {
+ LookupExtractorFactoryContainer old = lookupMap.put(lookupName,
lookupExtractorFactoryContainer);
+
+ LOG.info("Loaded lookup [%s] with spec [%s].", lookupName,
lookupExtractorFactoryContainer);
+
+ if (old != null) {
+ if (!old.getLookupExtractorFactory().destroy()) {
+ throw new ISE("destroy method returned false for lookup
[%s]:[%s]", lookupName, old);
+ }
+ }
+ } else {
+ LOG.info("Loading lookup [%s] with spec [%s].", lookupName,
lookupExtractorFactoryContainer);
+ manager.addNotice(new StatusNotice(manager, lookupName,
lookupExtractorFactoryContainer));
Review comment:
For cases where a cached lookup has been "started" but the cache isn't
initialized yet, what would be the behavior for a query using this lookup?
Wouldn't it still fail with the CACHE_NOT_INITIALIZED error?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]