lizhimins commented on code in PR #9114:
URL: https://github.com/apache/rocketmq/pull/9114#discussion_r1912777249


##########
broker/src/main/java/org/apache/rocketmq/broker/processor/AdminBrokerProcessor.java:
##########
@@ -495,6 +502,60 @@ private RemotingCommand 
checkRocksdbCqWriteProgress(ChannelHandlerContext ctx, R
         return response;
     }
 
+    private RemotingCommand exportRocksDBConfigToJson(ChannelHandlerContext 
ctx,
+        RemotingCommand request) throws RemotingCommandException {
+        RocksDBConfigToJsonRequestHeader requestHeader = 
request.decodeCommandCustomHeader(RocksDBConfigToJsonRequestHeader.class);
+        List<RocksDBConfigToJsonRequestHeader.ConfigType> configType = 
requestHeader.getConfigType();
+        List<CompletableFuture<Void>> futureList = new ArrayList<>();
+        for (RocksDBConfigToJsonRequestHeader.ConfigType type : configType) {
+            switch (type) {
+                case topics:
+                    if (this.brokerController.getTopicConfigManager() 
instanceof RocksDBTopicConfigManager) {
+                        RocksDBTopicConfigManager rocksDBTopicConfigManager = 
(RocksDBTopicConfigManager) this.brokerController.getTopicConfigManager();
+                        futureList.add(CompletableFuture.supplyAsync(() -> {
+                            rocksDBTopicConfigManager.exportToJson();
+                            return null;
+                        }, asyncExecuteWorker));
+                    }
+                    break;
+                case subscriptionGroups:
+                    if (this.brokerController.getSubscriptionGroupManager() 
instanceof RocksDBSubscriptionGroupManager) {
+                        RocksDBSubscriptionGroupManager 
rocksDBSubscriptionGroupManager = (RocksDBSubscriptionGroupManager) 
this.brokerController.getSubscriptionGroupManager();
+                        futureList.add(CompletableFuture.supplyAsync(() -> {

Review Comment:
   CompletableFuture.runAsync()



-- 
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-unsubscr...@rocketmq.apache.org

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

Reply via email to