-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce build time flag property to disable the cache extension #11139
Introduce build time flag property to disable the cache extension #11139
Conversation
@@ -113,4 +114,13 @@ void recordCachesBuild(CombinedIndexBuildItem combinedIndex, BeanContainerBuildI | |||
} | |||
return cacheNames; | |||
} | |||
|
|||
private static class IsEnabled implements BooleanSupplier { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nitpick: Can we call give this a more descriptive name, something like CacheEnabled
or something?
That would make it more consistent with the the existing uses of onlyIf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point, I just applied your suggestion. Thanks for reviewing this!
c4d5226
to
d7d3b91
Compare
Hello @gwenneg, if this config set to "disable this extension", then would adding this extension to the application's dependency ( |
@jaikiran this kind of configuration usually proves helpful in testing scenarios |
Hello @geoand, on the other hand, wouldn't this mean that every single build step method of every build step processor that corresponds to this extension will now have to add:
Perhaps, if we do need something like this, maybe this should be some generic config which can then be implemented in the build step processor invocation layer where with a single check it can decide if the processor and its build steps are relevant or not depending on that enabled/disabled config? |
Interesting idea @jaikiran. Are you thinking something |
This PR started from a Quarkus user who needed to disable the extension temporarily for testing purposes. This cannot be done by removing the extension from the application |
For this specific case, I didn't disable all build steps. The one providing the FeatureBuildItem instance is still active since the extension is still part of the application (even if it is disabled). Also, when the programmatic API of this extension will be there, some other build steps will certainly remain active while the annotations caching API might be disabled. |
@geoand Now that I wrote the previous comment, I am wondering if the property included in this PR should contain a part indicating that it will disable the annotations only... Something like |
@gwenneg I don't think that is necessary. Maybe just update the javadoc of the property to mention that the caching annotations will have no effect |
d7d3b91
to
0bdeeb5
Compare
0bdeeb5
to
8eeafbc
Compare
@geoand I did a small |
Looks good, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit torn on that one as I wonder if it would not make more sense to just disable the interceptors and keep the rest of the logic running.
But maybe it could be an issue if it was using an external cache service which we might support at some point.
Merging anyway.
@gsmet I also hesitated between disabling the entire extension logic at build time or disabling the interceptors logic only at run time. But since this PR started from a user who wanted to compare performances with and without the cache extension, disabling it at build time seemed more relevant to me. Anyway, this could easily be changed in the future. Thanks for merging! |
Fixes #11138.