zk-drizzle commented on code in PR #6724:
URL: https://github.com/apache/rocketmq/pull/6724#discussion_r1226159355


##########
remoting/src/main/java/org/apache/rocketmq/remoting/protocol/heartbeat/HeartbeatData.java:
##########
@@ -53,9 +56,38 @@ public void setConsumerDataSet(Set<ConsumerData> 
consumerDataSet) {
         this.consumerDataSet = consumerDataSet;
     }
 
+    public int getHeartbeatFingerprint() {
+        return heartbeatFingerprint;
+    }
+
+    public void setHeartbeatFingerprint(int heartbeatFingerprint) {
+        this.heartbeatFingerprint = heartbeatFingerprint;
+    }
+
+    public boolean isWithoutSub() {
+        return isWithoutSub;
+    }
+
+    public void setWithoutSub(boolean withoutSub) {
+        isWithoutSub = withoutSub;
+    }
+
     @Override
     public String toString() {
         return "HeartbeatData [clientID=" + clientID + ", producerDataSet=" + 
producerDataSet
             + ", consumerDataSet=" + consumerDataSet + "]";
     }
+
+    public int computeHeartbeatFingerprint() {
+        HeartbeatData heartbeatDataCopy = 
JSON.parseObject(JSON.toJSONString(this), HeartbeatData.class);

Review Comment:
   
![image](https://github.com/apache/rocketmq/assets/13689954/adeca391-b6e9-4699-8203-dc4ec70cc4ec)
   Thank for your review at first,when a cid subscribe 500 topics, the 
computeHeartbeatFingerprint cost 70ms(In a 30s heartbeat cycle, it's not very 
much, but our broker can free up a lot of computation and reduce network 
bandwidth pressure).



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