BewareMyPower commented on a change in pull request #14604:
URL: https://github.com/apache/pulsar/pull/14604#discussion_r827586571



##########
File path: pulsar-client-cpp/lib/OpSendMsg.h
##########
@@ -25,9 +25,31 @@
 
 #include "TimeUtils.h"
 #include "MessageImpl.h"
+#include "ChunkMessageIdImpl.h"
+#include "ProducerImpl.h"
 
 namespace pulsar {
 
+class ProducerImpl;
+class ProducerChunkedMessageCtx {
+   public:
+    ProducerChunkedMessageCtx() = default;
+
+    ProducerChunkedMessageCtx(const MessageIdImplPtr firstChunkMessageId,
+                              const MessageIdImplPtr lastChunkMessageId)
+        : firstChunkMessageIdImplPtr_(firstChunkMessageId), 
lastChunkMessageIdImplPtr_(lastChunkMessageId) {}
+
+    MessageIdImplPtr getChunkMessageId() {
+        return 
std::make_shared<ChunkMessageIdImpl>(*firstChunkMessageIdImplPtr_, 
*lastChunkMessageIdImplPtr_)
+            ->getLastChunkMessageIdImpl();
+    }

Review comment:
       BTW, is this class used anywhere? I think we can remove the class 
definition. In Java, the same class is managed by Netty recycler to avoid 
frequent JVM heap memory allocation and frequent GC. In C++, there is no need 
to do that. I think the `MessageId` constructor that accepts two `MessageId` 
objects has already archived the same goal.




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