poorbarcode commented on code in PR #16685:
URL: https://github.com/apache/pulsar/pull/16685#discussion_r925622209
##########
pulsar-transaction/coordinator/src/main/java/org/apache/pulsar/transaction/coordinator/impl/MLTransactionLogImpl.java:
##########
@@ -209,15 +238,46 @@ class TransactionLogReplayer {
}
public void start() {
- TransactionMetadataEntry transactionMetadataEntry = new
TransactionMetadataEntry();
-
while (fillEntryQueueCallback.fillQueue() || entryQueue.size() >
0) {
Entry entry = entryQueue.poll();
if (entry != null) {
try {
- ByteBuf buffer = entry.getDataBuffer();
- transactionMetadataEntry.parseFrom(buffer,
buffer.readableBytes());
-
transactionLogReplayCallback.handleMetadataEntry(entry.getPosition(),
transactionMetadataEntry);
+ List<TransactionMetadataEntry> logs =
deserializeEntry(entry);
Review Comment:
This method is currently only used in two places:
- `MLTransactionSequenceIdGenerator.onManagedLedgerLastLedgerInitialize`
Only execute once when managed ledger initialized.
- `MLTransactionLogImpl.replayAsync` Only execute once when Transaction log
component initialized.
Neither approach is performed frequently, so keeping good maintainability is
a good choice. And `SingletonList` is a very lightweight object.
--
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]