You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/08/08 10:16:29 UTC

[GitHub] [pulsar] hangc0276 commented on a change in pull request #11594: Fix java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer when enabling topic metadata compression

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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org