shoothzj commented on code in PR #4334:
URL: https://github.com/apache/bookkeeper/pull/4334#discussion_r1591810241


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDescriptorImpl.java:
##########
@@ -40,10 +40,10 @@
 public class LedgerDescriptorImpl extends LedgerDescriptor {
     private static final Logger LOG = 
LoggerFactory.getLogger(LedgerDescriptorImpl.class);
     final LedgerStorage ledgerStorage;
-    private long ledgerId;
+    private final long ledgerId;

Review Comment:
   @jiazhai When I was submitting this patch, I found this place could do some 
optimize, marking field final has two benefits:
   - For people reading this code, clarify this field never change.
   - For jvm, it could do some optimize since it's immutable.
   
   I suggest we can include this in to this patch, it's not worth opening a new 
pr(I think).
   
   cc @eolivelli @nicoloboschi @merlimat 



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