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
add cache for scan result. (#7477) #8049
Conversation
@kylixs PTAL |
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.
Please remove unused method:
public Set<BeanDefinitionHolder> doScan(String... basePackages) {
...
}
Please fix it:
|
public Set<BeanDefinition> findCandidateComponents(String basePackage) { | ||
Set<BeanDefinition> beanDefinitions = beanDefinitionMap.get(basePackage); | ||
// if beanDefinitions size ge 0 => don't scan | ||
// if beanDefinitions size is null => scan |
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.
// if beanDefinitions size ge 0 => don't scan
The comment is inaccurate, it is possible that the scan result is empty.
Scan only when the cache is not found.
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.
// if beanDefinitions size ge 0 => don't scan
The comment is inaccurate, it is possible that the scan result is empty.
Scan only when the cache is not found.
beanDefinitions size >= 0, means that the scan has been executed.
Because the result of the scan may be equal to 0, only beanDefinitions is null to scan.
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.
Please remove redundant comments.
Please remove unused method in Dubbo 3.0: @Override
public boolean checkCandidate(String beanName, BeanDefinition beanDefinition) throws IllegalStateException {
return super.checkCandidate(beanName, beanDefinition);
} |
Please add some description of this pr. |
@AlbumenJ Please approve workflow runs |
What is the purpose of the change:
#7477
The method(ServiceClassPostProcessor's registerServiceBeans) is executed to scan the package path twice, so the solution is to add a cache to the scan class(DubboClassPathBeanDefinitionScanner).