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/07/29 01:06:55 UTC

[GitHub] [pulsar] codelipenghui commented on a change in pull request #11490: [WIP] [ManagedLedger] Compress managed ledger info

codelipenghui commented on a change in pull request #11490:
URL: https://github.com/apache/pulsar/pull/11490#discussion_r678749971



##########
File path: managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/MetaStoreImpl.java
##########
@@ -47,6 +54,15 @@
     private final MetadataStore store;
     private final OrderedExecutor executor;
 
+    public static final short magicManagedLedgerInfoMetadata = 0x0b9c;

Review comment:
       ```suggestion
       public static final short MAGIC_MANAGED_LEDGER_INFO_METADATA = 0x0b9c;
   ```

##########
File path: pulsar-common/src/main/proto/PulsarApi.proto
##########
@@ -186,6 +186,11 @@ message BrokerEntryMetadata {
     optional uint64 index = 2;
 }
 
+message ManagedLedgerInfoMetadata {

Review comment:
       @gaoran10 We should move it to `MLDataFormats.proto`? The PulsarApi.proto is used for the broker and client interaction.

##########
File path: managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/MetaStoreImpl.java
##########
@@ -101,9 +117,8 @@ public void asyncUpdateLedgerIds(String ledgerName, ManagedLedgerInfo mlInfo, St
             log.debug("[{}] Updating metadata version={} with content={}", ledgerName, stat, mlInfo);
         }
 
-        byte[] serializedMlInfo = mlInfo.toByteArray(); // Binary format
         String path = PREFIX + ledgerName;
-        store.put(path, serializedMlInfo, Optional.of(stat.getVersion()))
+        store.put(path, compressLedgerInfo(mlInfo, CompressionType.ZSTD), Optional.of(stat.getVersion()))

Review comment:
       The compression type should be configurable




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