lizhanhui commented on code in PR #4989:
URL: https://github.com/apache/rocketmq/pull/4989#discussion_r962455084
##########
namesrv/src/main/java/org/apache/rocketmq/namesrv/NamesrvController.java:
##########
@@ -100,121 +96,115 @@ public NamesrvController(NamesrvConfig namesrvConfig,
NettyServerConfig nettySer
this.kvConfigManager = new KVConfigManager(this);
this.brokerHousekeepingService = new BrokerHousekeepingService(this);
this.routeInfoManager = new RouteInfoManager(namesrvConfig, this);
- this.configuration = new Configuration(
- LOGGER,
- this.namesrvConfig, this.nettyServerConfig
- );
+ this.configuration = new Configuration(LOGGER, this.namesrvConfig,
this.nettyServerConfig);
this.configuration.setStorePathFromConfig(this.namesrvConfig,
"configStorePath");
}
public boolean initialize() {
+ initialConfig();
+
+ initialNetworkComponents();
+
+ initialThreadExecutor();
+
+ registerProcessor();
+
+ startScheduleService();
+
+ initialSslContext();
+
+ initialRpcHooks();
+ return true;
+ }
+ private void initialConfig() {
this.kvConfigManager.load();
+ }
+
+ private void startScheduleService() {
+
this.scanExecutorService.scheduleAtFixedRate(NamesrvController.this.routeInfoManager::scanNotActiveBroker,
5, this.namesrvConfig.getScanNotActiveBrokerInterval(), TimeUnit.MILLISECONDS);
+
+
this.scheduledExecutorService.scheduleAtFixedRate(NamesrvController.this.kvConfigManager::printAllPeriodically,
1, 10, TimeUnit.MINUTES);
+
+ this.scheduledExecutorService.scheduleAtFixedRate(() -> {
+ try {
+ NamesrvController.this.printWaterMark();
+ } catch (Throwable e) {
+ LOGGER.error("printWaterMark error.", e);
+ }
+ }, 10, 1, TimeUnit.SECONDS);
+ }
+ private void initialNetworkComponents() {
this.remotingServer = new NettyRemotingServer(this.nettyServerConfig,
this.brokerHousekeepingService);
+ this.remotingClient = new NettyRemotingClient(this.nettyClientConfig);
+ }
+ private void initialThreadExecutor() {
Review Comment:
initialThreadExecutor --> initiateThreadExecutors
--
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]