cgivre commented on code in PR #2929:
URL: https://github.com/apache/drill/pull/2929#discussion_r1807897621


##########
contrib/storage-splunk/src/main/java/org/apache/drill/exec/store/splunk/SplunkSchema.java:
##########
@@ -148,8 +183,24 @@ private void registerIndexes() {
     registerTable(SPL_TABLE_NAME, new DynamicDrillTable(plugin, 
plugin.getName(),
       new SplunkScanSpec(plugin.getName(), SPL_TABLE_NAME, plugin.getConfig(), 
queryUserName)));
 
+    Set<String> indexList = null;
     // Retrieve and add all other Splunk indexes
-    for (String indexName : connection.getIndexes().keySet()) {
+    // First check the cache to see if we have a list of indexes.
+    String nameKey = getNameForCache();
+    if (useCache) {
+      indexList = cache.getIfPresent(nameKey);
+    }

Review Comment:
   @jnturton I'm remembering why I did it this way.  When the plugin is 
accessed, Drill calls the `registerTable` method which loads the list of 
indexes in to memory.   From my recollection, all similar storage plugins, do 
something similar in that they load the schemata into memory when the plugin is 
first accessed.   Here the change I made was to first check the memory cache 
and if that's not populated, then call the index list from Splunk.  
   
   I'm happy to do this as you suggest but I'm a little confused as to what 
exactly you're asking for.
   
   



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

To unsubscribe, e-mail: dev-unsubscr...@drill.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to