leventov commented on a change in pull request #8272: Support incremental load 
in Druid lookups
URL: https://github.com/apache/incubator-druid/pull/8272#discussion_r320220845
 
 

 ##########
 File path: 
extensions-core/lookups-cached-global/src/main/java/org/apache/druid/server/lookup/namespace/JdbcCacheGenerator.java
 ##########
 @@ -101,23 +121,50 @@
         }
     );
     final String newVersion;
-    if (lastDBUpdate != null) {
-      newVersion = lastDBUpdate.toString();
-    } else {
-      newVersion = StringUtils.format("%d", dbQueryStart);
-    }
-    final CacheScheduler.VersionedCache versionedCache = 
scheduler.createVersionedCache(entryId, newVersion);
+    CacheScheduler.VersionedCache versionedCache = null;
     try {
-      final Map<String, String> cache = versionedCache.getCache();
-      for (Pair<String, String> pair : pairs) {
-        cache.put(pair.lhs, pair.rhs);
+      if (doIncrementalLoad) {
+        newVersion = StringUtils.format("%d", lastDBUpdate);
+        Map<String, String> newCachedEntries = new HashMap<>();
 
 Review comment:
   This map is later used only for `putAll()`. You could pass down the list of 
pairs directly and put them into the existing cache, avoiding creating 
intermediate `HashMap`.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to