BewareMyPower commented on code in PR #321:
URL: https://github.com/apache/pulsar-client-cpp/pull/321#discussion_r1349457311
##########
lib/ChunkMessageIdImpl.h:
##########
@@ -28,21 +28,21 @@ class ChunkMessageIdImpl;
typedef std::shared_ptr<ChunkMessageIdImpl> ChunkMessageIdImplPtr;
class ChunkMessageIdImpl : public MessageIdImpl, public
std::enable_shared_from_this<ChunkMessageIdImpl> {
public:
- ChunkMessageIdImpl() : firstChunkMsgId_(std::make_shared<MessageIdImpl>())
{}
-
- void setFirstChunkMessageId(const MessageId& msgId) { *firstChunkMsgId_ =
*msgId.impl_; }
-
- void setLastChunkMessageId(const MessageId& msgId) {
- this->ledgerId_ = msgId.ledgerId();
- this->entryId_ = msgId.entryId();
- this->partition_ = msgId.partition();
+ explicit ChunkMessageIdImpl(std::vector<MessageId>&& chunkedMessageIds)
+ : chunkedMessageIds_(std::move(chunkedMessageIds)) {
+ auto lastChunkMsgId = chunkedMessageIds_.back();
+ this->ledgerId_ = lastChunkMsgId.ledgerId();
+ this->entryId_ = lastChunkMsgId.entryId();
+ this->partition_ = lastChunkMsgId.partition();
}
- std::shared_ptr<const MessageIdImpl> getFirstChunkMessageId() const {
return firstChunkMsgId_; }
+ const std::vector<MessageId>& getChunkedMessageIds() const noexcept {
return chunkedMessageIds_; }
+
+ std::vector<MessageId> moveChunkedMessageIds() noexcept { return
std::move(chunkedMessageIds_); }
Review Comment:
```suggestion
```
This method is never used.
--
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]