[ISSUE #9254] Refactor notifyMessageArriveInBatch in RocksDBConsumeQueueStore to adapt to CombineConsumeQueueStore (#9566)

This commit is contained in:
qianye
2025-07-23 16:11:56 +08:00
committed by GitHub
parent 438077e7ad
commit e20d56b9bd
3 changed files with 21 additions and 2 deletions
@@ -155,7 +155,8 @@ public class DefaultMessageStore implements MessageStore {
private final BrokerConfig brokerConfig;
private volatile boolean shutdown = true;
protected boolean notifyMessageArriveInBatch = false;
private boolean notifyMessageArriveInBatch = false;
protected StoreCheckpoint storeCheckpoint;
private TimerMessageStore timerMessageStore;
@@ -3011,4 +3012,13 @@ public class DefaultMessageStore implements MessageStore {
public MessageStoreStateMachine getStateMachine() {
return stateMachine;
}
public boolean isNotifyMessageArriveInBatch() {
return notifyMessageArriveInBatch;
}
public void setNotifyMessageArriveInBatch(boolean notifyMessageArriveInBatch) {
this.notifyMessageArriveInBatch = notifyMessageArriveInBatch;
}
}
@@ -31,7 +31,6 @@ public class RocksDBMessageStore extends DefaultMessageStore {
final MessageArrivingListener messageArrivingListener, final BrokerConfig brokerConfig, final ConcurrentMap<String, TopicConfig> topicConfigTable) throws
IOException {
super(messageStoreConfig, brokerStatsManager, messageArrivingListener, brokerConfig, topicConfigTable);
notifyMessageArriveInBatch = true;
}
@Override
@@ -93,8 +93,18 @@ public class RocksDBConsumeQueueStore extends AbstractConsumeQueueStore {
private long dispatchFromPhyOffset;
/**
* there are two threads to notify longPolling when build cq successfully
*
* @see DefaultMessageStore.ReputMessageService#doReput()
* @see RocksGroupCommitService#groupCommit()
* <p>
* RocksDB CQ is build by RocksGroupCommitService, so we do not need to notify longPolling in
* ReputMessageService
*/
public RocksDBConsumeQueueStore(DefaultMessageStore messageStore) {
super(messageStore);
messageStore.setNotifyMessageArriveInBatch(true);
this.storePath = StorePathConfigHelper.getStorePathConsumeQueue(messageStoreConfig.getStorePathRootDir());
this.rocksDBStorage = new ConsumeQueueRocksDBStorage(messageStore, storePath);