hangc0276 commented on a change in pull request #11594:
URL: https://github.com/apache/pulsar/pull/11594#discussion_r684750268



##########
File path: 
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/MetaStoreImpl.java
##########
@@ -316,10 +317,11 @@ private static MetaStoreException getException(Throwable 
t) {
             metadataByteBuf.writeShort(MAGIC_MANAGED_LEDGER_INFO_METADATA);
             metadataByteBuf.writeInt(mlInfoMetadata.getSerializedSize());
             metadataByteBuf.writeBytes(mlInfoMetadata.toByteArray());
-
+            byte[] byteArray = managedLedgerInfo.toByteArray();
+            uncompressedByteBuf = Unpooled.directBuffer(byteArray.length);
+            uncompressedByteBuf.writeBytes(byteArray);

Review comment:
       `Unpooled.wrappedBuffer` will create ByteBuf on heap and the 
`hasMemoryAddress` will return `false`. 
   `Unpooled.directBuffer` will create ByteBuf on `PooledUnsafeDirectByteBuf`, 
and the `hasMemoryAddress` will return `false`.




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