mirror of
https://github.com/apache/rocketmq.git
synced 2026-08-30 18:10:44 +08:00
[ISSUE #9254] Refactor notifyMessageArriveInBatch in RocksDBConsumeQueueStore to adapt to CombineConsumeQueueStore (#9566)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user