lhotari commented on code in PR #20366:
URL: https://github.com/apache/pulsar/pull/20366#discussion_r1209693521


##########
tiered-storage/file-system/src/main/java/org/apache/bookkeeper/mledger/offload/filesystem/impl/FileSystemManagedLedgerOffloader.java:
##########
@@ -306,22 +308,25 @@ public static FileSystemWriter create(LedgerEntries 
ledgerEntriesOnce,
         @Override
         public void run() {
             String managedLedgerName = 
ledgerReader.extraMetadata.get(MANAGED_LEDGER_NAME);
+            String topicName = 
TopicName.fromPersistenceNamingEncoding(managedLedgerName);
             if (ledgerReader.fileSystemWriteException == null) {
                 Iterator<LedgerEntry> iterator = ledgerEntriesOnce.iterator();
                 while (iterator.hasNext()) {
                     LedgerEntry entry = iterator.next();
                     long entryId = entry.getEntryId();
                     key.set(entryId);
+                    int currentEntrySize;
                     try {
-                        value.set(entry.getEntryBytes(), 0, 
entry.getEntryBytes().length);
+                        currentEntrySize = entry.getEntryBytes().length;

Review Comment:
   store `entry.getEntryBytes()` to a local variable so that it doesn't get 
called twice. 



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