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 2023/03/28 01:33:21 UTC

[rocketmq] branch develop updated: [ISSUE #6484] Revert inappropriate modification

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 a96f67233 [ISSUE #6484] Revert inappropriate modification
a96f67233 is described below

commit a96f672338ff1ccf04e1554fefa599e04f09dd5c
Author: SSpirits <ad...@lv5.moe>
AuthorDate: Tue Mar 28 09:33:14 2023 +0800

    [ISSUE #6484] Revert inappropriate modification
    
    This reverts commit 054ee473fd665414ef31d3e2a4235ad4525e22d8.
---
 .../tieredstore/provider/posix/PosixFileSegment.java   | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/tieredstore/src/main/java/org/apache/rocketmq/tieredstore/provider/posix/PosixFileSegment.java b/tieredstore/src/main/java/org/apache/rocketmq/tieredstore/provider/posix/PosixFileSegment.java
index f149df33e..9d9620faf 100644
--- a/tieredstore/src/main/java/org/apache/rocketmq/tieredstore/provider/posix/PosixFileSegment.java
+++ b/tieredstore/src/main/java/org/apache/rocketmq/tieredstore/provider/posix/PosixFileSegment.java
@@ -52,7 +52,7 @@ public class PosixFileSegment extends TieredFileSegment {
     private static final String OPERATION_POSIX_WRITE = "write";
 
     private final String basePath;
-    private final String filePath;
+    private final String filepath;
 
     private volatile File file;
     private volatile FileChannel readFileChannel;
@@ -68,7 +68,7 @@ public class PosixFileSegment extends TieredFileSegment {
         } else {
             this.basePath = basePath + File.separator;
         }
-        this.filePath = this.basePath
+        this.filepath = this.basePath
             + TieredStoreUtil.getHash(storeConfig.getBrokerClusterName()) + "_" + storeConfig.getBrokerClusterName() + File.separator
             + messageQueue.getBrokerName() + File.separator
             + messageQueue.getTopic() + File.separator
@@ -86,7 +86,7 @@ public class PosixFileSegment extends TieredFileSegment {
 
     @Override
     public String getPath() {
-        return filePath;
+        return filepath;
     }
 
     @Override
@@ -107,7 +107,7 @@ public class PosixFileSegment extends TieredFileSegment {
         if (file == null) {
             synchronized (this) {
                 if (file == null) {
-                    File file = new File(filePath);
+                    File file = new File(filepath);
                     try {
                         File dir = file.getParentFile();
                         if (!dir.exists()) {
@@ -120,7 +120,7 @@ public class PosixFileSegment extends TieredFileSegment {
                         this.writeFileChannel = new RandomAccessFile(file, "rwd").getChannel();
                         this.file = file;
                     } catch (Exception e) {
-                        logger.error("PosixFileSegment#createFile: create file {} failed: ", filePath, e);
+                        logger.error("PosixFileSegment#createFile: create file {} failed: ", filepath, e);
                     }
                 }
             }
@@ -137,7 +137,7 @@ public class PosixFileSegment extends TieredFileSegment {
                 writeFileChannel.close();
             }
         } catch (IOException e) {
-            logger.error("PosixFileSegment#destroyFile: destroy file {} failed: ", filePath, e);
+            logger.error("PosixFileSegment#destroyFile: destroy file {} failed: ", filepath, e);
         }
 
         if (file.exists()) {
@@ -174,7 +174,7 @@ public class PosixFileSegment extends TieredFileSegment {
             attributesBuilder.put(LABEL_SUCCESS, false);
             TieredStoreMetricsManager.providerRpcLatency.record(costTime, attributesBuilder.build());
             logger.error("PosixFileSegment#read0: read file {} failed: position: {}, length: {}",
-                    filePath, position, length, e);
+                filepath, position, length, e);
             future.completeExceptionally(e);
         }
         return future;
@@ -194,7 +194,7 @@ public class PosixFileSegment extends TieredFileSegment {
                     byte[] byteArray = ByteStreams.toByteArray(inputStream);
                     if (byteArray.length != length) {
                         logger.error("PosixFileSegment#commit0: append file {} failed: real data size: {}, is not equal to length: {}",
-                                filePath, byteArray.length, length);
+                            filepath, byteArray.length, length);
                         future.complete(false);
                         return;
                     }
@@ -220,7 +220,7 @@ public class PosixFileSegment extends TieredFileSegment {
                     TieredStoreMetricsManager.providerRpcLatency.record(costTime, attributesBuilder.build());
 
                     logger.error("PosixFileSegment#commit0: append file {} failed: position: {}, length: {}",
-                            filePath, position, length, e);
+                        filepath, position, length, e);
                     future.completeExceptionally(e);
                 }
             });