You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "qianye1001 (via GitHub)" <gi...@apache.org> on 2025/01/08 12:58:31 UTC
[PR] [ISSUE #9111] Support export broker RocksDB Config to json file [rocketmq]
qianye1001 opened a new pull request, #9114:
URL: https://github.com/apache/rocketmq/pull/9114
<!-- Please make sure the target branch is right. In most case, the target branch should be `develop`. -->
### Which Issue(s) This PR Fixes
<!-- Please ensure that the related issue has already been created, and [link this pull request to that issue using keywords](<https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword>) to ensure automatic closure. -->
Fixes #9111
### Brief Description
<!-- Write a brief description for your pull request to help the maintainer understand the reasons behind your changes. -->
### How Did You Test This Change?
<!-- In order to ensure the code quality of Apache RocketMQ, we expect every pull request to have undergone thorough testing. -->
--
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-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ISSUE #9111] Support export broker RocksDB Config to json file [rocketmq]
Posted by "RongtongJin (via GitHub)" <gi...@apache.org>.
RongtongJin commented on code in PR #9114:
URL: https://github.com/apache/rocketmq/pull/9114#discussion_r1908290197
##########
tools/src/main/java/org/apache/rocketmq/tools/command/metadata/RocksDBConfigToJsonCommand.java:
##########
@@ -47,41 +54,116 @@ public String commandName() {
@Override
public String commandDesc() {
- return "Convert RocksDB kv config (topics/subscriptionGroups/consumerOffsets) to json";
+ return "Convert RocksDB kv config (topics/subscriptionGroups/consumerOffsets) to json. " +
+ "Use [-n, -c, -t] to send Request to broker ( version >= 5.3.2 ) or use [-p, -t, -e (not require)] load RocksDB. " +
+ "If -e is provided, tools will export json file instead of std print";
}
@Override
public Options buildCommandlineOptions(Options options) {
Option pathOption = new Option("p", "configPath", true,
"Absolute path to the metadata config directory");
- pathOption.setRequired(true);
options.addOption(pathOption);
Option configTypeOption = new Option("t", "configType", true, "Name of kv config, e.g. " +
"topics/subscriptionGroups/consumerOffsets");
- configTypeOption.setRequired(true);
options.addOption(configTypeOption);
+ Option exportPathOption = new Option("e", "exportFile", true,
+ "Absolute file path for exporting, auto backup existing file, not directory!");
+ options.addOption(exportPathOption);
+
+ Option nameserverOption = new Option("n", "nameserverAddr", true,
+ "nameserverAddr. If nameserverAddr and clusterName are provided, will ignore [-p, -t, -e] args");
+ options.addOption(nameserverOption);
+
+ Option clusterOption = new Option("c", "cluster", true,
+ "Cluster name. If nameserverAddr and clusterName are provided, will ignore [-p, -t, -e] args");
+ options.addOption(clusterOption);
+
Review Comment:
Are there situations where it is necessary to use the -b parameter to specify an individual broker?
--
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-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ISSUE #9111] Support export broker RocksDB Config to json file [rocketmq]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins commented on code in PR #9114:
URL: https://github.com/apache/rocketmq/pull/9114#discussion_r1912778003
##########
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(() -> {
+ rocksDBSubscriptionGroupManager.exportToJson();
+ return null;
+ }, asyncExecuteWorker));
+ }
+ break;
+ case consumerOffsets:
+ if (this.brokerController.getConsumerOffsetManager() instanceof RocksDBConsumerOffsetManager) {
+ RocksDBConsumerOffsetManager rocksDBConsumerOffsetManager = (RocksDBConsumerOffsetManager) this.brokerController.getConsumerOffsetManager();
+ futureList.add(CompletableFuture.supplyAsync(() -> {
+ rocksDBConsumerOffsetManager.exportToJson();
+ return null;
+ }, asyncExecuteWorker));
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ try {
+ CompletableFuture.allOf(futureList.toArray(new CompletableFuture[0])).join();
+ } catch (CompletionException e) {
+ RemotingCommand response = RemotingCommand.createResponseCommand(null);
+ response.setCode(ResponseCode.SYSTEM_ERROR);
+ response.setRemark("export failed." + e);
Review Comment:
no need add failed again
--
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-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ISSUE #9111] Support export broker RocksDB Config to json file [rocketmq]
Posted by "lollipopjin (via GitHub)" <gi...@apache.org>.
lollipopjin merged PR #9114:
URL: https://github.com/apache/rocketmq/pull/9114
--
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-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ISSUE #9111] Support export broker RocksDB Config to json file [rocketmq]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
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-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ISSUE #9111] Support export broker RocksDB Config to json file [rocketmq]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins commented on code in PR #9114:
URL: https://github.com/apache/rocketmq/pull/9114#discussion_r1909935710
##########
broker/src/main/java/org/apache/rocketmq/broker/config/v1/RocksDBSubscriptionGroupManager.java:
##########
@@ -184,6 +184,11 @@ public synchronized void persist() {
}
}
+ public synchronized void exportToJson() {
+ log.info("export Subscription Group to json file");
Review Comment:
modify log format
--
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-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ISSUE #9111] Support export broker RocksDB Config to json file [rocketmq]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #9114:
URL: https://github.com/apache/rocketmq/pull/9114#issuecomment-2577673136
## [Codecov](https://app.codecov.io/gh/apache/rocketmq/pull/9114?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
Attention: Patch coverage is `0.60976%` with `163 lines` in your changes missing coverage. Please review.
> Project coverage is 47.91%. Comparing base [(`0548593`)](https://app.codecov.io/gh/apache/rocketmq/commit/0548593b30466e527f0591e757e6efa204ab793d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`76c017b`)](https://app.codecov.io/gh/apache/rocketmq/commit/76c017bf706839a07379a96ffc6974a88296abaf?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
> Report is 3 commits behind head on develop.
| [Files with missing lines](https://app.codecov.io/gh/apache/rocketmq/pull/9114?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...s/command/metadata/RocksDBConfigToJsonCommand.java](https://app.codecov.io/gh/apache/rocketmq/pull/9114?src=pr&el=tree&filepath=tools%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Frocketmq%2Ftools%2Fcommand%2Fmetadata%2FRocksDBConfigToJsonCommand.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-dG9vbHMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3Rvb2xzL2NvbW1hbmQvbWV0YWRhdGEvUm9ja3NEQkNvbmZpZ1RvSnNvbkNvbW1hbmQuamF2YQ==) | 0.00% | [96 Missing :warning: ](https://app.codecov.io/gh/apache/rocketmq/pull/9114?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...ocketmq/broker/processor/AdminBrokerProcessor.java](https://app.codecov.io/gh/apache/rocketmq/pull/9114?src=pr&el=tree&filepath=broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Frocketmq%2Fbroker%2Fprocessor%2FAdminBrokerProcessor.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-YnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9icm9rZXIvcHJvY2Vzc29yL0FkbWluQnJva2VyUHJvY2Vzc29yLmphdmE=) | 2.70% | [36 Missing :warning: ](https://app.codecov.io/gh/apache/rocketmq/pull/9114?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...tocol/header/RocksDBConfigToJsonRequestHeader.java](https://app.codecov.io/gh/apache/rocketmq/pull/9114?src=pr&el=tree&filepath=remoting%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Frocketmq%2Fremoting%2Fprotocol%2Fheader%2FRocksDBConfigToJsonRequestHeader.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cmVtb3Rpbmcvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3JlbW90aW5nL3Byb3RvY29sL2hlYWRlci9Sb2Nrc0RCQ29uZmlnVG9Kc29uUmVxdWVzdEhlYWRlci5qYXZh) | 0.00% | [10 Missing :warning: ](https://app.codecov.io/gh/apache/rocketmq/pull/9114?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...g/apache/rocketmq/client/impl/MQClientAPIImpl.java](https://app.codecov.io/gh/apache/rocketmq/pull/9114?src=pr&el=tree&filepath=client%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Frocketmq%2Fclient%2Fimpl%2FMQClientAPIImpl.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jbGllbnQvaW1wbC9NUUNsaWVudEFQSUltcGwuamF2YQ==) | 0.00% | [8 Missing :warning: ](https://app.codecov.io/gh/apache/rocketmq/pull/9114?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...broker/config/v1/RocksDBConsumerOffsetManager.java](https://app.codecov.io/gh/apache/rocketmq/pull/9114?src=pr&el=tree&filepath=broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Frocketmq%2Fbroker%2Fconfig%2Fv1%2FRocksDBConsumerOffsetManager.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-YnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9icm9rZXIvY29uZmlnL3YxL1JvY2tzREJDb25zdW1lck9mZnNldE1hbmFnZXIuamF2YQ==) | 0.00% | [3 Missing :warning: ](https://app.codecov.io/gh/apache/rocketmq/pull/9114?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...ker/config/v1/RocksDBSubscriptionGroupManager.java](https://app.codecov.io/gh/apache/rocketmq/pull/9114?src=pr&el=tree&filepath=broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Frocketmq%2Fbroker%2Fconfig%2Fv1%2FRocksDBSubscriptionGroupManager.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-YnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9icm9rZXIvY29uZmlnL3YxL1JvY2tzREJTdWJzY3JpcHRpb25Hcm91cE1hbmFnZXIuamF2YQ==) | 0.00% | [3 Missing :warning: ](https://app.codecov.io/gh/apache/rocketmq/pull/9114?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...mq/broker/config/v1/RocksDBTopicConfigManager.java](https://app.codecov.io/gh/apache/rocketmq/pull/9114?src=pr&el=tree&filepath=broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Frocketmq%2Fbroker%2Fconfig%2Fv1%2FRocksDBTopicConfigManager.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-YnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9icm9rZXIvY29uZmlnL3YxL1JvY2tzREJUb3BpY0NvbmZpZ01hbmFnZXIuamF2YQ==) | 0.00% | [3 Missing :warning: ](https://app.codecov.io/gh/apache/rocketmq/pull/9114?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...apache/rocketmq/tools/admin/DefaultMQAdminExt.java](https://app.codecov.io/gh/apache/rocketmq/pull/9114?src=pr&el=tree&filepath=tools%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Frocketmq%2Ftools%2Fadmin%2FDefaultMQAdminExt.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-dG9vbHMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3Rvb2xzL2FkbWluL0RlZmF1bHRNUUFkbWluRXh0LmphdmE=) | 0.00% | [2 Missing :warning: ](https://app.codecov.io/gh/apache/rocketmq/pull/9114?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...he/rocketmq/tools/admin/DefaultMQAdminExtImpl.java](https://app.codecov.io/gh/apache/rocketmq/pull/9114?src=pr&el=tree&filepath=tools%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Frocketmq%2Ftools%2Fadmin%2FDefaultMQAdminExtImpl.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-dG9vbHMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3Rvb2xzL2FkbWluL0RlZmF1bHRNUUFkbWluRXh0SW1wbC5qYXZh) | 0.00% | [2 Missing :warning: ](https://app.codecov.io/gh/apache/rocketmq/pull/9114?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## develop #9114 +/- ##
=============================================
- Coverage 47.94% 47.91% -0.04%
- Complexity 12037 12047 +10
=============================================
Files 1320 1321 +1
Lines 92827 92970 +143
Branches 11897 11912 +15
=============================================
+ Hits 44507 44546 +39
- Misses 42809 42915 +106
+ Partials 5511 5509 -2
```
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/rocketmq/pull/9114?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
--
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-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ISSUE #9111] Support export broker RocksDB Config to json file [rocketmq]
Posted by "RongtongJin (via GitHub)" <gi...@apache.org>.
RongtongJin commented on PR #9114:
URL: https://github.com/apache/rocketmq/pull/9114#issuecomment-2579373110
I think we can remove the ExportMetadataInRocksDBCommand, as this command duplicates the functionality of RocksDBConfigToJsonCommand command.
--
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-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ISSUE #9111] Support export broker RocksDB Config to json file [rocketmq]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins commented on code in PR #9114:
URL: https://github.com/apache/rocketmq/pull/9114#discussion_r1912779064
##########
remoting/src/main/java/org/apache/rocketmq/remoting/protocol/header/RocksDBConfigToJsonRequestHeader.java:
##########
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.rocketmq.remoting.protocol.header;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.rocketmq.common.action.Action;
+import org.apache.rocketmq.common.action.RocketMQAction;
+import org.apache.rocketmq.remoting.CommandCustomHeader;
+import org.apache.rocketmq.remoting.annotation.CFNotNull;
+import org.apache.rocketmq.remoting.exception.RemotingCommandException;
+import org.apache.rocketmq.remoting.protocol.RequestCode;
+
+@RocketMQAction(value = RequestCode.EXPORT_ROCKSDB_CONFIG_TO_JSON, action = Action.GET)
+public class RocksDBConfigToJsonRequestHeader implements CommandCustomHeader {
+ private static final String CONFIG_TYPE_SEPARATOR = ";";
+
+ public enum ConfigType {
+ topics,
+ subscriptionGroups,
+ consumerOffsets;
+
+ public static List<ConfigType> fromString(String ordinal) {
+ String[] configTypeStrings = StringUtils.split(ordinal, CONFIG_TYPE_SEPARATOR);
+ List<ConfigType> configTypes = new ArrayList<>();
+ for (String configTypeString : configTypeStrings) {
+ if (StringUtils.isNotEmpty(configTypeString)) {
+ configTypes.add(ConfigType.valueOf(configTypeString));
+ }
+ }
+ return configTypes;
+ }
+
+ public static String toString(List<ConfigType> configTypes) {
+ StringBuilder sb = new StringBuilder();
+ for (ConfigType configType : configTypes) {
+ sb.append(configType.name()).append(CONFIG_TYPE_SEPARATOR);
+ }
+ return sb.toString();
+ }
+ }
+
+ @CFNotNull
+ private String configType;
+
+ @Override
+ public void checkFields() throws RemotingCommandException {
+
+ }
+
+ public List<ConfigType> getConfigType() {
+ return ConfigType.fromString(configType);
+ }
+
+ public void setConfigType(List<ConfigType> configType) {
Review Comment:
fastjson will scan this method name
--
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-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ISSUE #9111] Support export broker RocksDB Config to json file [rocketmq]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins commented on code in PR #9114:
URL: https://github.com/apache/rocketmq/pull/9114#discussion_r1912781124
##########
tools/src/main/java/org/apache/rocketmq/tools/command/export/ExportMetadataInRocksDBCommand.java:
##########
@@ -18,6 +18,10 @@
package org.apache.rocketmq.tools.command.export;
import com.alibaba.fastjson.JSONObject;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.function.BiConsumer;
Review Comment:
use rocketmq format
--
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-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org