Search before asking
Motivation
Right now we will scan all beans under org.apache.dolphinscheduler in
AlertServer
|
@ComponentScan(value = "org.apache.dolphinscheduler", excludeFilters = { |
|
@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = JdbcRegistryAutoConfiguration.class) |
|
}) |
|
public class AlertServer { |
ApiServer
|
@ComponentScan(value = "org.apache.dolphinscheduler", excludeFilters = { |
|
@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = JdbcRegistryAutoConfiguration.class) |
|
}) |
|
@Slf4j |
|
public class ApiApplicationServer { |
MasterServer
|
@ComponentScan(value = "org.apache.dolphinscheduler", excludeFilters = { |
|
@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = JdbcRegistryAutoConfiguration.class) |
|
}) |
|
@EnableTransactionManagement |
|
@EnableCaching |
|
@Slf4j |
|
public class MasterServer implements IStoppable { |
WorkerServer.
|
@ComponentScan(value = "org.apache.dolphinscheduler", excludeFilters = { |
|
@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = JdbcRegistryAutoConfiguration.class) |
|
}) |
|
@Slf4j |
|
public class WorkerServer implements IStoppable { |
This will allow us to know the module relation difficultly, furthermore, if there exists an unexpected module in the application, the beans in this module will be loaded into memory, e.g. worker load dao module.
So it's better avoid scan whole project.
Design Detail
First, the application should only scan the package of the bootstrap class. Other package beans should be import by Configuration.
Second, the plugin beans should be registered by AutoConfiguration.
Compatibility, Deprecation, and Migration Plan
Compatibility with 3.x version.
Test Plan
Test by UT and E2E
Are you willing to submit a PR?
Code of Conduct
Search before asking
Motivation
Right now we will scan all beans under
org.apache.dolphinschedulerinAlertServer
dolphinscheduler/dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java
Lines 45 to 48 in 325bfa8
ApiServer
dolphinscheduler/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/ApiApplicationServer.java
Lines 47 to 51 in 325bfa8
MasterServer
dolphinscheduler/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/MasterServer.java
Lines 54 to 60 in 325bfa8
WorkerServer.
dolphinscheduler/dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/WorkerServer.java
Lines 56 to 60 in 325bfa8
This will allow us to know the module relation difficultly, furthermore, if there exists an unexpected module in the application, the beans in this module will be loaded into memory, e.g. worker load dao module.
So it's better avoid scan whole project.
Design Detail
First, the application should only scan the package of the bootstrap class. Other package beans should be import by Configuration.
Second, the plugin beans should be registered by
AutoConfiguration.Compatibility, Deprecation, and Migration Plan
Compatibility with 3.x version.
Test Plan
Test by UT and E2E
Are you willing to submit a PR?
Code of Conduct