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

 ##########
 File path: 
extensions-core/lookups-cached-global/src/main/java/org/apache/druid/server/lookup/namespace/cache/CacheScheduler.java
 ##########
 @@ -197,6 +197,17 @@ public void run()
       }
     }
 
+    public VersionedCache createFromExistingCache(
+        @Nullable EntryImpl<? extends ExtractionNamespace> entryId,
+        String version,
+        Map<String, String> newCacheEntries
+    )
+    {
+      VersionedCache state = (VersionedCache) cacheStateHolder.get();
+      state.cacheHandler.getCache().putAll(newCacheEntries);
 
 Review comment:
   Added javadoc comments explaining race condition and mentioned in docs that 
offHeap is not recommended with incremental load.
   
   To be honest, I haven't tested this with OffHeap lookups, the way I had 
implemented this code earlier, offHeap was not going to work at all, but now I 
am not so sure. 
   Since we are retaining the same `cacheHander` and adding new entries to same 
underlying `ConcurrentMap`, its possible that it will still work.

----------------------------------------------------------------
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]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to