[ 
https://issues.apache.org/jira/browse/DRILL-8504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17889419#comment-17889419
 ] 

ASF GitHub Bot commented on DRILL-8504:
---------------------------------------

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


##########
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 sorry, I misspoke.   The way I intended the cache to work was that we 
combine the plugin name + user name to create a key, and the value is a list of 
indexes.   Every time a user adds or drops an index, we have to recreate the 
cache entry for that plugin/username.
   
   So:
   ```
   splunk1-cgivre: [index1, index2, index2]
   splunk2-cgivre: [index5, index6, index7]
   splunk1-jnturton: [index1, index2]
   ```
   
   That's what the cache should look like.  (In theory)





> Add Schema Caching to Splunk Plugin
> -----------------------------------
>
>                 Key: DRILL-8504
>                 URL: https://issues.apache.org/jira/browse/DRILL-8504
>             Project: Apache Drill
>          Issue Type: Improvement
>          Components: Storage - Splunk
>    Affects Versions: 1.21.2
>            Reporter: Charles Givre
>            Assignee: Charles Givre
>            Priority: Major
>             Fix For: 1.22.0
>
>
> See PR



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to