提交 d4c2608f 编写于 作者: V vongosling

Refactoring the method name of checking directybuffer pool available numbers

上级 c40cdf09
...@@ -53,7 +53,7 @@ public class AllocateMappedFileService extends ServiceThread { ...@@ -53,7 +53,7 @@ public class AllocateMappedFileService extends ServiceThread {
if (this.messageStore.getMessageStoreConfig().isTransientStorePoolEnable()) { if (this.messageStore.getMessageStoreConfig().isTransientStorePoolEnable()) {
if (this.messageStore.getMessageStoreConfig().isFastFailIfNoBufferInStorePool() if (this.messageStore.getMessageStoreConfig().isFastFailIfNoBufferInStorePool()
&& BrokerRole.SLAVE != this.messageStore.getMessageStoreConfig().getBrokerRole()) { //if broker is slave, don't fast fail even no buffer in pool && 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 { ...@@ -63,7 +63,7 @@ public class AllocateMappedFileService extends ServiceThread {
if (nextPutOK) { if (nextPutOK) {
if (canSubmitRequests <= 0) { if (canSubmitRequests <= 0) {
log.warn("[NOTIFYME]TransientStorePool is not enough, so create mapped file error, " + 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); this.requestTable.remove(nextFilePath);
return null; return null;
} }
...@@ -79,7 +79,7 @@ public class AllocateMappedFileService extends ServiceThread { ...@@ -79,7 +79,7 @@ public class AllocateMappedFileService extends ServiceThread {
if (nextNextPutOK) { if (nextNextPutOK) {
if (canSubmitRequests <= 0) { if (canSubmitRequests <= 0) {
log.warn("[NOTIFYME]TransientStorePool is not enough, so skip preallocate mapped file, " + 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); this.requestTable.remove(nextNextFilePath);
} else { } else {
boolean offerOK = this.requestQueue.offer(nextNextReq); boolean offerOK = this.requestQueue.offer(nextNextReq);
......
...@@ -1445,7 +1445,7 @@ public class DefaultMessageStore implements MessageStore { ...@@ -1445,7 +1445,7 @@ public class DefaultMessageStore implements MessageStore {
} }
public int remainTransientStoreBufferNumbs() { public int remainTransientStoreBufferNumbs() {
return this.transientStorePool.remainBufferNumbs(); return this.transientStorePool.availableBufferNums();
} }
@Override @Override
......
...@@ -80,7 +80,7 @@ public class TransientStorePool { ...@@ -80,7 +80,7 @@ public class TransientStorePool {
return buffer; return buffer;
} }
public int remainBufferNumbs() { public int availableBufferNums() {
if (storeConfig.isTransientStorePoolEnable()) { if (storeConfig.isTransientStorePoolEnable()) {
return availableBuffers.size(); return availableBuffers.size();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册