raghavyadav01 commented on code in PR #16325:
URL: https://github.com/apache/pinot/pull/16325#discussion_r2198583505


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/store/TextIndexUtils.java:
##########
@@ -56,6 +60,35 @@ public class TextIndexUtils {
   private TextIndexUtils() {
   }
 
+  /**
+   * Configuration change listener for Lucene max clause count.
+   * This allows updating the max clause count dynamically without server 
restart.
+   */
+  public static class LuceneMaxClauseCountConfigChangeListener implements 
PinotClusterConfigChangeListener {
+    @Override
+    public void onChange(Set<String> changedConfigs, Map<String, String> 
clusterConfigs) {
+      if 
(!changedConfigs.contains(CommonConstants.Server.CONFIG_OF_LUCENE_MAX_CLAUSE_COUNT))
 {
+        return;
+      }
+      String maxClauseCountStr = 
clusterConfigs.get(CommonConstants.Server.CONFIG_OF_LUCENE_MAX_CLAUSE_COUNT);
+      if (maxClauseCountStr != null) {
+        try {
+          int newMaxClauseCount = Integer.parseInt(maxClauseCountStr);
+          // Update the static default for all new IndexSearcher instances
+          IndexSearcher.setMaxClauseCount(newMaxClauseCount);
+          LOGGER.info("Updated Lucene max clause count to: {} from cluster 
config", newMaxClauseCount);
+        } catch (NumberFormatException e) {
+          LOGGER.warn("Invalid max clause count value in cluster config: {}, 
keeping current value", maxClauseCountStr);
+        }
+      } else {
+        // Reset to default if config is removed
+        int defaultMaxClauseCount = 
CommonConstants.Server.DEFAULT_LUCENE_MAX_CLAUSE_COUNT;

Review Comment:
   We want to make it cluster level as we want each server to have same value. 



-- 
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: commits-unsubscr...@pinot.apache.org

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


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

Reply via email to