未验证 提交 bc5be217 编写于 作者: B Boyang Jerry Peng 提交者: GitHub

Improve the performance of toString for MessageIdImpls (#7820)

Co-authored-by: NJerry Peng <jerryp@splunk.com>
上级 bfa36aeb
......@@ -111,7 +111,15 @@ public class BatchMessageIdImpl extends MessageIdImpl {
@Override
public String toString() {
return String.format("%d:%d:%d:%d", ledgerId, entryId, partitionIndex, batchIndex);
return new StringBuilder()
.append(ledgerId)
.append(':')
.append(entryId)
.append(':')
.append(partitionIndex)
.append(':')
.append(batchIndex)
.toString();
}
// Serialization
......
......@@ -83,7 +83,13 @@ public class MessageIdImpl implements MessageId {
@Override
public String toString() {
return String.format("%d:%d:%d", ledgerId, entryId, partitionIndex);
return new StringBuilder()
.append(ledgerId)
.append(':')
.append(entryId)
.append(':')
.append(partitionIndex)
.toString();
}
// / Serialization
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册