You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "lburgazzoli (via GitHub)" <gi...@apache.org> on 2024/03/12 09:05:40 UTC

[PR] chore: minor camel-catalog cleanup [camel]

lburgazzoli opened a new pull request, #13456:
URL: https://github.com/apache/camel/pull/13456

   # Description
   
   <!--
   - Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   -->
   
   # Target
   
   - [ ] I checked that the commit is targeting the correct branch (note that Camel 3 uses `camel-3.x`, whereas Camel 4 uses the `main` branch)
   
   # Tracking
   - [ ] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it).
   
   <!--
   # *Note*: trivial changes like, typos, minor documentation fixes and other small items do not require a JIRA issue. In this case your pull request should address just this issue, without pulling in other changes.
   -->
   
   # Apache Camel coding standards and style
   
   - [ ] I checked that each commit in the pull request has a meaningful subject line and body.
   
   <!--
   If you're unsure, you can format the pull request title like `[CAMEL-XXX] Fixes bug in camel-file component`, where you replace `CAMEL-XXX` with the appropriate JIRA issue.
   -->
   
   - [ ] I have run `mvn clean install -DskipTests` locally and I have committed all auto-generated changes
   
   <!--
   You can run the aforementioned command in your module so that the build auto-formats your code. This will also be verified as part of the checks and your PR may be rejected if if there are uncommited changes after running `mvn clean install -DskipTests`.
   
   You can learn more about the contribution guidelines at https://github.com/apache/camel/blob/main/CONTRIBUTING.md
   -->
   
   


-- 
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-unsubscribe@camel.apache.org

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


Re: [PR] chore: minor camel-catalog cleanup [camel]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on code in PR #13456:
URL: https://github.com/apache/camel/pull/13456#discussion_r1521100070


##########
catalog/camel-catalog/src/main/java/org/apache/camel/catalog/DefaultCamelCatalog.java:
##########
@@ -113,13 +131,32 @@ public void setRuntimeProvider(RuntimeProvider runtimeProvider) {
         this.runtimeProvider = runtimeProvider;
         // inject CamelCatalog to the provider
         this.runtimeProvider.setCamelCatalog(this);
+
         // invalidate the cache
         cache.remove(FIND_COMPONENT_NAMES);
+        cache.remove(FIND_COMPONENT_LABELS);
         cache.remove(LIST_COMPONENTS_AS_JSON);
+
         cache.remove(FIND_DATA_FORMAT_NAMES);
+        cache.remove(FIND_DATA_FORMAT_LABELS);
         cache.remove(LIST_DATA_FORMATS_AS_JSON);
+
         cache.remove(FIND_LANGUAGE_NAMES);
+        cache.remove(FIND_LANGUAGE_LABELS);
         cache.remove(LIST_LANGUAGES_AS_JSON);
+
+        cache.remove(FIND_OTHER_NAMES);
+        cache.remove(FIND_OTHER_LABELS);
+        cache.remove(LIST_OTHERS_AS_JSON);
+
+        cache.remove(FIND_MODEL_NAMES);
+        cache.remove(FIND_MODEL_LABELS);
+        cache.remove(LIST_MODELS_AS_JSON);
+
+        cache.remove(FIND_TRANSFORMER_NAMES);
+        cache.remove(LIST_TRANSFORMERS_AS_JSON);
+
+        cache.remove(SUMMARY_AS_JSON);

Review Comment:
   @davsclaus I don't know if this was intentional but saw a number of element of the cache not being removed when a new runtime provider is set so I removed them. Maybe cleaning up the whole cache and re-cache some of the element upfront would be better ?



-- 
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-unsubscribe@camel.apache.org

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


Re: [PR] chore: minor camel-catalog cleanup [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #13456:
URL: https://github.com/apache/camel/pull/13456#discussion_r1521159680


##########
catalog/camel-catalog/src/main/java/org/apache/camel/catalog/DefaultCamelCatalog.java:
##########
@@ -113,13 +131,32 @@ public void setRuntimeProvider(RuntimeProvider runtimeProvider) {
         this.runtimeProvider = runtimeProvider;
         // inject CamelCatalog to the provider
         this.runtimeProvider.setCamelCatalog(this);
+
         // invalidate the cache
         cache.remove(FIND_COMPONENT_NAMES);
+        cache.remove(FIND_COMPONENT_LABELS);
         cache.remove(LIST_COMPONENTS_AS_JSON);
+
         cache.remove(FIND_DATA_FORMAT_NAMES);
+        cache.remove(FIND_DATA_FORMAT_LABELS);
         cache.remove(LIST_DATA_FORMATS_AS_JSON);
+
         cache.remove(FIND_LANGUAGE_NAMES);
+        cache.remove(FIND_LANGUAGE_LABELS);
         cache.remove(LIST_LANGUAGES_AS_JSON);
+
+        cache.remove(FIND_OTHER_NAMES);
+        cache.remove(FIND_OTHER_LABELS);
+        cache.remove(LIST_OTHERS_AS_JSON);
+
+        cache.remove(FIND_MODEL_NAMES);
+        cache.remove(FIND_MODEL_LABELS);
+        cache.remove(LIST_MODELS_AS_JSON);
+
+        cache.remove(FIND_TRANSFORMER_NAMES);
+        cache.remove(LIST_TRANSFORMERS_AS_JSON);
+
+        cache.remove(SUMMARY_AS_JSON);

Review Comment:
   Yeah that is safer, and its no problem - also for changing provider, you would just create the provider up front and not change it runtime wise. 
   



-- 
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-unsubscribe@camel.apache.org

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


Re: [PR] chore: minor camel-catalog cleanup [camel]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli merged PR #13456:
URL: https://github.com/apache/camel/pull/13456


-- 
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-unsubscribe@camel.apache.org

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


Re: [PR] chore: minor camel-catalog cleanup [camel]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on code in PR #13456:
URL: https://github.com/apache/camel/pull/13456#discussion_r1521385235


##########
catalog/camel-catalog/src/main/java/org/apache/camel/catalog/DefaultCamelCatalog.java:
##########
@@ -113,13 +131,32 @@ public void setRuntimeProvider(RuntimeProvider runtimeProvider) {
         this.runtimeProvider = runtimeProvider;
         // inject CamelCatalog to the provider
         this.runtimeProvider.setCamelCatalog(this);
+
         // invalidate the cache
         cache.remove(FIND_COMPONENT_NAMES);
+        cache.remove(FIND_COMPONENT_LABELS);
         cache.remove(LIST_COMPONENTS_AS_JSON);
+
         cache.remove(FIND_DATA_FORMAT_NAMES);
+        cache.remove(FIND_DATA_FORMAT_LABELS);
         cache.remove(LIST_DATA_FORMATS_AS_JSON);
+
         cache.remove(FIND_LANGUAGE_NAMES);
+        cache.remove(FIND_LANGUAGE_LABELS);
         cache.remove(LIST_LANGUAGES_AS_JSON);
+
+        cache.remove(FIND_OTHER_NAMES);
+        cache.remove(FIND_OTHER_LABELS);
+        cache.remove(LIST_OTHERS_AS_JSON);
+
+        cache.remove(FIND_MODEL_NAMES);
+        cache.remove(FIND_MODEL_LABELS);
+        cache.remove(LIST_MODELS_AS_JSON);
+
+        cache.remove(FIND_TRANSFORMER_NAMES);
+        cache.remove(LIST_TRANSFORMERS_AS_JSON);
+
+        cache.remove(SUMMARY_AS_JSON);

Review Comment:
   done



-- 
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-unsubscribe@camel.apache.org

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


Re: [PR] chore: minor camel-catalog cleanup [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #13456:
URL: https://github.com/apache/camel/pull/13456#discussion_r1521382354


##########
catalog/camel-catalog/src/main/java/org/apache/camel/catalog/DefaultCamelCatalog.java:
##########
@@ -113,13 +131,32 @@ public void setRuntimeProvider(RuntimeProvider runtimeProvider) {
         this.runtimeProvider = runtimeProvider;
         // inject CamelCatalog to the provider
         this.runtimeProvider.setCamelCatalog(this);
+
         // invalidate the cache
         cache.remove(FIND_COMPONENT_NAMES);
+        cache.remove(FIND_COMPONENT_LABELS);
         cache.remove(LIST_COMPONENTS_AS_JSON);
+
         cache.remove(FIND_DATA_FORMAT_NAMES);
+        cache.remove(FIND_DATA_FORMAT_LABELS);
         cache.remove(LIST_DATA_FORMATS_AS_JSON);
+
         cache.remove(FIND_LANGUAGE_NAMES);
+        cache.remove(FIND_LANGUAGE_LABELS);
         cache.remove(LIST_LANGUAGES_AS_JSON);
+
+        cache.remove(FIND_OTHER_NAMES);
+        cache.remove(FIND_OTHER_LABELS);
+        cache.remove(LIST_OTHERS_AS_JSON);
+
+        cache.remove(FIND_MODEL_NAMES);
+        cache.remove(FIND_MODEL_LABELS);
+        cache.remove(LIST_MODELS_AS_JSON);
+
+        cache.remove(FIND_TRANSFORMER_NAMES);
+        cache.remove(LIST_TRANSFORMERS_AS_JSON);
+
+        cache.remove(SUMMARY_AS_JSON);

Review Comment:
   You are welcome to clear all cache, or create a JIRA so we wont forget



-- 
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-unsubscribe@camel.apache.org

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