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


##########
store/src/main/java/org/apache/rocketmq/store/queue/RocksDBConsumeQueue.java:
##########
@@ -311,7 +311,7 @@ public CqUnit getEarliestUnit() {
     public CqUnit getLatestUnit() {
         try {
             long maxOffset = 
this.messageStore.getQueueStore().getMaxOffsetInQueue(topic, queueId);
-            return get(maxOffset);
+            return get(maxOffset > 0 ? maxOffset - 1 : maxOffset);

Review Comment:
   The reason should be explained



##########
broker/src/main/java/org/apache/rocketmq/broker/subscription/SubscriptionGroupManager.java:
##########
@@ -334,6 +334,26 @@ public DataVersion getDataVersion() {
         return dataVersion;
     }
 
+    public boolean loadDataVersion() {
+        String fileName = null;
+        try {
+            fileName = this.configFilePath();
+            String jsonString = MixAll.file2String(fileName);
+            if (jsonString != null) {
+                SubscriptionGroupManager obj = 
RemotingSerializable.fromJson(jsonString, SubscriptionGroupManager.class);
+                if (obj != null) {
+                    this.dataVersion.assignNewOne(obj.dataVersion);
+                    this.printLoadDataWhenFirstBoot(obj);
+                }
+                log.info("load subGroup dataVersion success " + fileName + " " 
+  obj.dataVersion);

Review Comment:
   should use {} in logger content



##########
tools/src/main/java/org/apache/rocketmq/tools/command/export/ExportMetadataInRocksDBCommand.java:
##########
@@ -38,6 +41,17 @@ public class ExportMetadataInRocksDBCommand implements 
SubCommand {
     private static final String TOPICS_JSON_CONFIG = "topics";
     private static final String SUBSCRIPTION_GROUP_JSON_CONFIG = 
"subscriptionGroups";
 
+    public static void main(String[] args) throws SubCommandException {
+        ExportMetadataInRocksDBCommand cmd = new 
ExportMetadataInRocksDBCommand();
+
+        Options options = ServerUtil.buildCommandlineOptions(new Options());
+        String[] subargs = new String[] {"-p /Users/huyitao/store/config", "-t 
subscriptionGroups", "-j true"};

Review Comment:
   should use "user.home"



-- 
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]

Reply via email to