Skip to content

Commit

Permalink
[ISSUE #6800] Change the config variable isEnableBatchPush to enableB…
Browse files Browse the repository at this point in the history
…atchPush (#6801)

* fix: wrong setter for config isEnableBatchPush

Change-Id: I1ebf4748c26c42efb058c11a8b5084b69213892c

* fix: change isEnableBatchPush to enableBatchPush

Change-Id: I13db49a30841fe5ff9a548f02afa0cc272ba027d
  • Loading branch information
absolute8511 committed Jun 12, 2023
1 parent 0f1ff25 commit 91d8ee1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public class MessageStoreConfig {
private String dLegerPeers;
private String dLegerSelfId;
private String preferredLeaderId;
private boolean isEnableBatchPush = false;
private boolean enableBatchPush = false;

private boolean enableScheduleMessageStats = true;

Expand Down Expand Up @@ -1132,11 +1132,11 @@ public void setPreferredLeaderId(String preferredLeaderId) {
}

public boolean isEnableBatchPush() {
return isEnableBatchPush;
return enableBatchPush;
}

public void setEnableBatchPush(boolean enableBatchPush) {
isEnableBatchPush = enableBatchPush;
this.enableBatchPush = enableBatchPush;
}

public boolean isEnableScheduleMessageStats() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.util.Map;
import java.util.Random;
import java.util.UUID;
import java.util.Properties;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.TimeUnit;
Expand All @@ -48,6 +49,7 @@
import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.common.message.MessageExtBatch;
import org.apache.rocketmq.common.message.MessageExtBrokerInner;
import org.apache.rocketmq.common.MixAll;
import org.apache.rocketmq.store.config.BrokerRole;
import org.apache.rocketmq.store.config.FlushDiskType;
import org.apache.rocketmq.store.config.MessageStoreConfig;
Expand Down Expand Up @@ -941,6 +943,15 @@ public void testCleanUnusedTopic() {
Assert.assertEquals(resultSet, consumeQueueTable.keySet());
}

@Test
public void testChangeStoreConfig() {
Properties properties = new Properties();
properties.setProperty("enableBatchPush", "true");
MessageStoreConfig messageStoreConfig = new MessageStoreConfig();
MixAll.properties2Object(properties, messageStoreConfig);
assertThat(messageStoreConfig.isEnableBatchPush()).isTrue();
}

private class MyMessageArrivingListener implements MessageArrivingListener {
@Override
public void arriving(String topic, int queueId, long logicOffset, long tagsCode, long msgStoreTime,
Expand Down

0 comments on commit 91d8ee1

Please sign in to comment.