rocketmq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vongosl...@apache.org
Subject [rocketmq] branch develop updated: Refactoring the method name of checking directybuffer pool available numbers
Date Fri, 12 Jul 2019 02:35:51 GMT
This is an automated email from the ASF dual-hosted git repository.

vongosling 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 d4c2608  Refactoring the method name of checking directybuffer pool available numbers
d4c2608 is described below

commit d4c2608f16a30f63d254d6381b5a9ceb713f0403
Author: vongosling <vongosling@apache.org>
AuthorDate: Fri Jul 12 10:27:03 2019 +0800

    Refactoring the method name of checking directybuffer pool available numbers
---
 .../java/org/apache/rocketmq/store/AllocateMappedFileService.java   | 6 +++---
 .../main/java/org/apache/rocketmq/store/DefaultMessageStore.java    | 2 +-
 .../src/main/java/org/apache/rocketmq/store/TransientStorePool.java | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/store/src/main/java/org/apache/rocketmq/store/AllocateMappedFileService.java
b/store/src/main/java/org/apache/rocketmq/store/AllocateMappedFileService.java
index 5e86b8a..f28af38 100644
--- a/store/src/main/java/org/apache/rocketmq/store/AllocateMappedFileService.java
+++ b/store/src/main/java/org/apache/rocketmq/store/AllocateMappedFileService.java
@@ -53,7 +53,7 @@ public class AllocateMappedFileService extends ServiceThread {
         if (this.messageStore.getMessageStoreConfig().isTransientStorePoolEnable()) {
             if (this.messageStore.getMessageStoreConfig().isFastFailIfNoBufferInStorePool()
                 && BrokerRole.SLAVE != this.messageStore.getMessageStoreConfig().getBrokerRole())
{ //if broker is slave, don't fast fail even no buffer in pool
-                canSubmitRequests = this.messageStore.getTransientStorePool().remainBufferNumbs()
- this.requestQueue.size();
+                canSubmitRequests = this.messageStore.getTransientStorePool().availableBufferNums()
- this.requestQueue.size();
             }
         }
 
@@ -63,7 +63,7 @@ public class AllocateMappedFileService extends ServiceThread {
         if (nextPutOK) {
             if (canSubmitRequests <= 0) {
                 log.warn("[NOTIFYME]TransientStorePool is not enough, so create mapped file
error, " +
-                    "RequestQueueSize : {}, StorePoolSize: {}", this.requestQueue.size(),
this.messageStore.getTransientStorePool().remainBufferNumbs());
+                    "RequestQueueSize : {}, StorePoolSize: {}", this.requestQueue.size(),
this.messageStore.getTransientStorePool().availableBufferNums());
                 this.requestTable.remove(nextFilePath);
                 return null;
             }
@@ -79,7 +79,7 @@ public class AllocateMappedFileService extends ServiceThread {
         if (nextNextPutOK) {
             if (canSubmitRequests <= 0) {
                 log.warn("[NOTIFYME]TransientStorePool is not enough, so skip preallocate
mapped file, " +
-                    "RequestQueueSize : {}, StorePoolSize: {}", this.requestQueue.size(),
this.messageStore.getTransientStorePool().remainBufferNumbs());
+                    "RequestQueueSize : {}, StorePoolSize: {}", this.requestQueue.size(),
this.messageStore.getTransientStorePool().availableBufferNums());
                 this.requestTable.remove(nextNextFilePath);
             } else {
                 boolean offerOK = this.requestQueue.offer(nextNextReq);
diff --git a/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java b/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java
index f254dd1..4b64978 100644
--- a/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java
+++ b/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java
@@ -1445,7 +1445,7 @@ public class DefaultMessageStore implements MessageStore {
     }
 
     public int remainTransientStoreBufferNumbs() {
-        return this.transientStorePool.remainBufferNumbs();
+        return this.transientStorePool.availableBufferNums();
     }
 
     @Override
diff --git a/store/src/main/java/org/apache/rocketmq/store/TransientStorePool.java b/store/src/main/java/org/apache/rocketmq/store/TransientStorePool.java
index 8684fe9..0de0591 100644
--- a/store/src/main/java/org/apache/rocketmq/store/TransientStorePool.java
+++ b/store/src/main/java/org/apache/rocketmq/store/TransientStorePool.java
@@ -80,7 +80,7 @@ public class TransientStorePool {
         return buffer;
     }
 
-    public int remainBufferNumbs() {
+    public int availableBufferNums() {
         if (storeConfig.isTransientStorePoolEnable()) {
             return availableBuffers.size();
         }


Mime
View raw message