poorbarcode commented on code in PR #16685:
URL: https://github.com/apache/pulsar/pull/16685#discussion_r926393477


##########
pulsar-transaction/coordinator/src/main/java/org/apache/pulsar/transaction/coordinator/impl/MLTransactionLogImpl.java:
##########
@@ -147,14 +175,10 @@ public void closeFailed(ManagedLedgerException exception, 
Object ctx) {
 
     @Override
     public CompletableFuture<Position> append(TransactionMetadataEntry 
transactionMetadataEntry) {
-        int transactionMetadataEntrySize = 
transactionMetadataEntry.getSerializedSize();
-        ByteBuf buf = 
PulsarByteBufAllocator.DEFAULT.buffer(transactionMetadataEntrySize, 
transactionMetadataEntrySize);
         CompletableFuture<Position> completableFuture = new 
CompletableFuture<>();
-        transactionMetadataEntry.writeTo(buf);
-        managedLedger.asyncAddEntry(buf, new AsyncCallbacks.AddEntryCallback() 
{
+        bufferedWriter.asyncAddData(transactionMetadataEntry, new 
TxnLogBufferedWriter.AddDataCallback() {

Review Comment:
   No. The byte buf will release by `Entry.release()`.



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