use of org.apache.rocketmq.store.config.MessageStoreConfig in project rocketmq by apache.
the class BrokerControllerTest method testBrokerRestart.
/**
* Tests if the controller can be properly stopped and started.
*
* @throws Exception If fails.
*/
@Test
public void testBrokerRestart() throws Exception {
BrokerController brokerController = new BrokerController(new BrokerConfig(), new NettyServerConfig(), new NettyClientConfig(), new MessageStoreConfig());
assertThat(brokerController.initialize());
brokerController.start();
brokerController.shutdown();
}
use of org.apache.rocketmq.store.config.MessageStoreConfig in project rocketmq by apache.
the class AppendCallbackTest method init.
@Before
public void init() throws Exception {
MessageStoreConfig messageStoreConfig = new MessageStoreConfig();
messageStoreConfig.setMapedFileSizeCommitLog(1024 * 8);
messageStoreConfig.setMapedFileSizeConsumeQueue(1024 * 4);
messageStoreConfig.setMaxHashSlotNum(100);
messageStoreConfig.setMaxIndexNum(100 * 10);
messageStoreConfig.setStorePathRootDir(System.getProperty("user.home") + File.separator + "unitteststore");
messageStoreConfig.setStorePathCommitLog(System.getProperty("user.home") + File.separator + "unitteststore" + File.separator + "commitlog");
// too much reference
DefaultMessageStore messageStore = new DefaultMessageStore(messageStoreConfig, null, null, null);
CommitLog commitLog = new CommitLog(messageStore);
callback = commitLog.new DefaultAppendMessageCallback(1024);
}
use of org.apache.rocketmq.store.config.MessageStoreConfig in project rocketmq by apache.
the class ConsumeQueueTest method gen.
protected DefaultMessageStore gen() throws Exception {
MessageStoreConfig messageStoreConfig = buildStoreConfig(commitLogFileSize, cqFileSize, true, cqExtFileSize);
BrokerConfig brokerConfig = new BrokerConfig();
DefaultMessageStore master = new DefaultMessageStore(messageStoreConfig, new BrokerStatsManager(brokerConfig.getBrokerClusterName()), new MessageArrivingListener() {
@Override
public void arriving(String topic, int queueId, long logicOffset, long tagsCode, long msgStoreTime, byte[] filterBitMap, Map<String, String> properties) {
}
}, brokerConfig);
assertThat(master.load()).isTrue();
master.start();
return master;
}
use of org.apache.rocketmq.store.config.MessageStoreConfig in project rocketmq by apache.
the class DefaultMessageStoreShuwDownTest method buildMessageStore.
public DefaultMessageStore buildMessageStore() throws Exception {
MessageStoreConfig messageStoreConfig = new MessageStoreConfig();
messageStoreConfig.setMapedFileSizeCommitLog(1024 * 1024 * 10);
messageStoreConfig.setMapedFileSizeConsumeQueue(1024 * 1024 * 10);
messageStoreConfig.setMaxHashSlotNum(10000);
messageStoreConfig.setMaxIndexNum(100 * 100);
messageStoreConfig.setFlushDiskType(FlushDiskType.SYNC_FLUSH);
return new DefaultMessageStore(messageStoreConfig, new BrokerStatsManager("simpleTest"), null, new BrokerConfig());
}
use of org.apache.rocketmq.store.config.MessageStoreConfig in project rocketmq by apache.
the class DefaultMessageStoreTest method destory.
@After
public void destory() {
messageStore.shutdown();
messageStore.destroy();
MessageStoreConfig messageStoreConfig = new MessageStoreConfig();
File file = new File(messageStoreConfig.getStorePathRootDir());
UtilAll.deleteFile(file);
}
Aggregations