You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "nicoloboschi (via GitHub)" <gi...@apache.org> on 2023/04/17 07:34:34 UTC

[GitHub] [pulsar] nicoloboschi commented on a diff in pull request #20112: [improve] [broker] Pin AppendIndexMetadataInterceptor to field in `ManagedLedgerInterceptorImpl`

nicoloboschi commented on code in PR #20112:
URL: https://github.com/apache/pulsar/pull/20112#discussion_r1168296420


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/intercept/ManagedLedgerInterceptorImpl.java:
##########
@@ -122,14 +130,9 @@ public CompletableFuture<Void> onManagedLedgerLastLedgerInitialize(String name,
                             if (ledgerEntry != null) {
                                 BrokerEntryMetadata brokerEntryMetadata =
                                         Commands.parseBrokerEntryMetadataIfExist(ledgerEntry.getEntryBuffer());
-                                for (BrokerEntryMetadataInterceptor interceptor : brokerEntryMetadataInterceptors) {
-                                    if (interceptor instanceof AppendIndexMetadataInterceptor) {
-                                        if (brokerEntryMetadata != null && brokerEntryMetadata.hasIndex()) {
-                                            ((AppendIndexMetadataInterceptor) interceptor)
-                                                    .recoveryIndexGenerator(brokerEntryMetadata.getIndex());
-                                        }
-                                        break;
-                                    }
+                                if (brokerEntryMetadata != null) {

Review Comment:
   ```suggestion
                                   if (brokerEntryMetadata != null && brokerEntryMetadata.hasIndex()) {
   ```



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