Jackie-Jiang commented on code in PR #16325:
URL: https://github.com/apache/pinot/pull/16325#discussion_r2198441859
##########
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:
This will revert the server level config. We should decide whether making it
cluster level or server level
##########
pinot-spi/src/main/java/org/apache/pinot/spi/utils/CommonConstants.java:
##########
@@ -1261,6 +1261,9 @@ public static class Server {
"pinot.server.messagesCount.refreshIntervalSeconds";
public static final int DEFAULT_MESSAGES_COUNT_REFRESH_INTERVAL_SECONDS =
30;
+ public static final String CONFIG_OF_LUCENE_MAX_CLAUSE_COUNT =
"pinot.server.lucene.max.clause.count";
+ public static final int DEFAULT_LUCENE_MAX_CLAUSE_COUNT = 8192;
Review Comment:
Do we want to use a different default? Or we override Lucene default only
when it is configured?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]