dingwpmz opened a new issue #233: 
DefaultMessageStore#isTheBatchFull??maxTransferBytesOnMessageInMemory???
URL: https://github.com/apache/rocketmq/issues/233
 
 
   DefaultMessageStore#isTheBatchFull
   private boolean isTheBatchFull(int sizePy, int maxMsgNums, int bufferTotal, 
int messageTotal, boolean isInDisk) { 
   
   if (0 == bufferTotal || 0 == messageTotal) {
   return false;
   }
   
   if (maxMsgNums <= messageTotal) {
   return true;
   }
   
   if (isInDisk) {
   if ((bufferTotal + sizePy) > 
this.messageStoreConfig.getMaxTransferBytesOnMessageInDisk()) {
   return true;
   }
   
   if (messageTotal > 
this.messageStoreConfig.getMaxTransferCountOnMessageInDisk() - 1) {
   return true;
   }
   } else {
   if ((bufferTotal + sizePy) > 
this.messageStoreConfig.getMaxTransferBytesOnMessageInMemory()) {
   return true;
   }
   
   if (messageTotal > 
this.messageStoreConfig.getMaxTransferCountOnMessageInMemory() - 1) {
   return true;
   }
   }
   
   return false;
   }
   ????????????
   sizePy ??????????
   maxMsgNums : ????????
   bufferTotal : ??????????????????
   messageTotal ? ????????
   isInDisk ?????????????
   ???????
   1???bufferTotal ?messageTotal ???0??????????????????????????false
   2???maxMsgNums <= messageTotal,??true,???????
   3??????????????????
   ?????????????????
   ?????????? + ???????? ? maxTransferBytesOnMessageInDisk 
(MessageStoreConfig)???64K????????????????????
   ????????? > maxTransferCountOnMessageInDisk 
(MessageStoreConfig)???8??????????????????????????8??
   ??????????????????maxTransferBytesOnMessageInMemory 
?maxTransferCountOnMessageInMemory?
   ???????????
   ???????????
   1?checkInDiskByCommitOffset 
????????????????????accessMessageInMemoryMaxRatio???????????RocketMQ
   ????????????????????????????????MappedByteBuffer?????????????????
   2??????????????????????????????????????????????????????????????????????????
   3??????????????????????????????????????????????
   
   ??????????

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to