alex-plekhanov commented on code in PR #12654:
URL: https://github.com/apache/ignite/pull/12654#discussion_r2720327166


##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/DistributedCalciteConfiguration.java:
##########
@@ -95,31 +125,28 @@ public String[] disabledRules() {
             log
         );
 
-        disabledRules.addListener(new DistributePropertyListener<>() {
-            @Override public void onUpdate(String name, String[] oldVal, 
String[] newVal) {
-                if (oldVal != null && F.compareArrays(oldVal, newVal) != 0) {
-                    if (qryPlanCache != null) {
-                        if (log.isInfoEnabled()) {
-                            log.info("Cleaning Calcite's cache plan by 
changing of the property '"
-                                + DISABLED_RULES_PROPERTY_NAME + "'.");
-                        }
-
-                        qryPlanCache.clear();
-                    }
-                }
-            }
-        });
+        disabledRules.addListener(planCacheCleaner);
+
+        registerProperty(
+            dispatcher,
+            PLAN_CACHE_SIZE_PROPERTY_NAME,
+            prop -> planCacheSize = prop,
+            () -> new SimpleDistributedProperty<>(
+                PLAN_CACHE_SIZE_PROPERTY_NAME,
+                Integer::parseInt,
+                "Calcite's plan cache size. NOTE: cleans the planning cache on 
change."

Review Comment:
   1. We need to recreate internal structure with new limit
   2. Chaanging this property - is exceptional, rare situation, so cleaning 
cache not a big problem.
   3. The same spikes can be caused by DDL (which are much more often).



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

Reply via email to