You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by ji...@apache.org on 2022/05/17 08:34:34 UTC

[rocketmq] branch develop updated: [ISSUE #4318]make some variables to be final in IndexHeader (#4319)

This is an automated email from the ASF dual-hosted git repository.

jinrongtong pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git


The following commit(s) were added to refs/heads/develop by this push:
     new 0370e5e4d [ISSUE #4318]make some variables to be final in IndexHeader (#4319)
0370e5e4d is described below

commit 0370e5e4d1f722932951167e5fce3470a6865a04
Author: hzh0425 <64...@qq.com>
AuthorDate: Tue May 17 16:34:13 2022 +0800

    [ISSUE #4318]make some variables to be final in IndexHeader (#4319)
    
    * make some variables to be final
    
    * make some variables to be final
---
 .../java/org/apache/rocketmq/store/index/IndexHeader.java   | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/store/src/main/java/org/apache/rocketmq/store/index/IndexHeader.java b/store/src/main/java/org/apache/rocketmq/store/index/IndexHeader.java
index 44021cd58..fbb3f0847 100644
--- a/store/src/main/java/org/apache/rocketmq/store/index/IndexHeader.java
+++ b/store/src/main/java/org/apache/rocketmq/store/index/IndexHeader.java
@@ -29,13 +29,12 @@ public class IndexHeader {
     private static int hashSlotcountIndex = 32;
     private static int indexCountIndex = 36;
     private final ByteBuffer byteBuffer;
-    private AtomicLong beginTimestamp = new AtomicLong(0);
-    private AtomicLong endTimestamp = new AtomicLong(0);
-    private AtomicLong beginPhyOffset = new AtomicLong(0);
-    private AtomicLong endPhyOffset = new AtomicLong(0);
-    private AtomicInteger hashSlotCount = new AtomicInteger(0);
-
-    private AtomicInteger indexCount = new AtomicInteger(1);
+    private final AtomicLong beginTimestamp = new AtomicLong(0);
+    private final AtomicLong endTimestamp = new AtomicLong(0);
+    private final AtomicLong beginPhyOffset = new AtomicLong(0);
+    private final AtomicLong endPhyOffset = new AtomicLong(0);
+    private final AtomicInteger hashSlotCount = new AtomicInteger(0);
+    private final AtomicInteger indexCount = new AtomicInteger(1);
 
     public IndexHeader(final ByteBuffer byteBuffer) {
         this.byteBuffer = byteBuffer;