Skip to content

Commit 18fcce6

Browse files
authored
[ISSUE #6250] Fix wrong value of MessageStoreConfig#storePathEpochFile
1. fix wrong value of MessageStoreConfig#storePathEpochFile
1 parent ce99a7f commit 18fcce6

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

store/src/main/java/org/apache/rocketmq/store/config/MessageStoreConfig.java

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package org.apache.rocketmq.store.config;
1818

1919
import java.io.File;
20+
2021
import org.apache.rocketmq.common.annotation.ImportantField;
2122
import org.apache.rocketmq.store.ConsumeQueue;
2223
import org.apache.rocketmq.store.queue.BatchConsumeQueue;
@@ -38,8 +39,7 @@ public class MessageStoreConfig {
3839

3940
//The directory in which the epochFile is kept
4041
@ImportantField
41-
private String storePathEpochFile = System.getProperty("user.home") + File.separator + "store"
42-
+ File.separator + "epochFileCheckpoint";
42+
private String storePathEpochFile = null;
4343

4444
private String readOnlyCommitLogStorePaths = null;
4545

@@ -81,8 +81,8 @@ public class MessageStoreConfig {
8181
/**
8282
* 1. Register to broker after (startTime + disappearTimeAfterStart)
8383
* 2. Internal msg exchange will start after (startTime + disappearTimeAfterStart)
84-
* A. PopReviveService
85-
* B. TimerDequeueGetService
84+
* A. PopReviveService
85+
* B. TimerDequeueGetService
8686
*/
8787
@ImportantField
8888
private int disappearTimeAfterStart = -1;
@@ -627,6 +627,9 @@ public void setStorePathDLedgerCommitLog(String storePathDLedgerCommitLog) {
627627
}
628628

629629
public String getStorePathEpochFile() {
630+
if (storePathEpochFile == null) {
631+
return storePathRootDir + File.separator + "epochFileCheckpoint";
632+
}
630633
return storePathEpochFile;
631634
}
632635

@@ -1067,6 +1070,7 @@ public String getReadOnlyCommitLogStorePaths() {
10671070
public void setReadOnlyCommitLogStorePaths(String readOnlyCommitLogStorePaths) {
10681071
this.readOnlyCommitLogStorePaths = readOnlyCommitLogStorePaths;
10691072
}
1073+
10701074
public String getdLegerGroup() {
10711075
return dLegerGroup;
10721076
}
@@ -1470,13 +1474,15 @@ public void setAsyncLearner(boolean asyncLearner) {
14701474
public int getMappedFileSizeTimerLog() {
14711475
return mappedFileSizeTimerLog;
14721476
}
1477+
14731478
public void setMappedFileSizeTimerLog(final int mappedFileSizeTimerLog) {
14741479
this.mappedFileSizeTimerLog = mappedFileSizeTimerLog;
14751480
}
14761481

14771482
public int getTimerPrecisionMs() {
14781483
return timerPrecisionMs;
14791484
}
1485+
14801486
public void setTimerPrecisionMs(int timerPrecisionMs) {
14811487
int[] candidates = {100, 200, 500, 1000};
14821488
for (int i = 1; i < candidates.length; i++) {
@@ -1487,9 +1493,11 @@ public void setTimerPrecisionMs(int timerPrecisionMs) {
14871493
}
14881494
this.timerPrecisionMs = candidates[candidates.length - 1];
14891495
}
1496+
14901497
public int getTimerRollWindowSlot() {
14911498
return timerRollWindowSlot;
14921499
}
1500+
14931501
public int getTimerGetMessageThreadNum() {
14941502
return timerGetMessageThreadNum;
14951503
}
@@ -1501,9 +1509,11 @@ public void setTimerGetMessageThreadNum(int timerGetMessageThreadNum) {
15011509
public int getTimerPutMessageThreadNum() {
15021510
return timerPutMessageThreadNum;
15031511
}
1512+
15041513
public void setTimerPutMessageThreadNum(int timerPutMessageThreadNum) {
15051514
this.timerPutMessageThreadNum = timerPutMessageThreadNum;
15061515
}
1516+
15071517
public boolean isTimerEnableDisruptor() {
15081518
return timerEnableDisruptor;
15091519
}
@@ -1515,12 +1525,15 @@ public boolean isTimerEnableCheckMetrics() {
15151525
public void setTimerEnableCheckMetrics(boolean timerEnableCheckMetrics) {
15161526
this.timerEnableCheckMetrics = timerEnableCheckMetrics;
15171527
}
1528+
15181529
public boolean isTimerStopEnqueue() {
15191530
return timerStopEnqueue;
15201531
}
1532+
15211533
public void setTimerStopEnqueue(boolean timerStopEnqueue) {
15221534
this.timerStopEnqueue = timerStopEnqueue;
15231535
}
1536+
15241537
public String getTimerCheckMetricsWhen() {
15251538
return timerCheckMetricsWhen;
15261539
}
@@ -1533,9 +1546,10 @@ public boolean isTimerWarmEnable() {
15331546
return timerWarmEnable;
15341547
}
15351548

1536-
public boolean isTimerWheelEnable() {
1549+
public boolean isTimerWheelEnable() {
15371550
return timerWheelEnable;
15381551
}
1552+
15391553
public void setTimerWheelEnable(boolean timerWheelEnable) {
15401554
this.timerWheelEnable = timerWheelEnable;
15411555
}
@@ -1555,20 +1569,24 @@ public void setTimerMetricSmallThreshold(int timerMetricSmallThreshold) {
15551569
public int getTimerCongestNumEachSlot() {
15561570
return timerCongestNumEachSlot;
15571571
}
1572+
15581573
public void setTimerCongestNumEachSlot(int timerCongestNumEachSlot) {
15591574
// In order to get this value from messageStoreConfig properties file created before v4.4.1.
15601575
this.timerCongestNumEachSlot = timerCongestNumEachSlot;
15611576
}
1577+
15621578
public int getTimerFlushIntervalMs() {
15631579
return timerFlushIntervalMs;
15641580
}
15651581

15661582
public void setTimerFlushIntervalMs(final int timerFlushIntervalMs) {
15671583
this.timerFlushIntervalMs = timerFlushIntervalMs;
15681584
}
1585+
15691586
public void setTimerRollWindowSlot(final int timerRollWindowSlot) {
15701587
this.timerRollWindowSlot = timerRollWindowSlot;
15711588
}
1589+
15721590
public int getTimerProgressLogIntervalMs() {
15731591
return timerProgressLogIntervalMs;
15741592
}
@@ -1588,6 +1606,7 @@ public void setTimerInterceptDelayLevel(boolean timerInterceptDelayLevel) {
15881606
public int getTimerMaxDelaySec() {
15891607
return timerMaxDelaySec;
15901608
}
1609+
15911610
public void setTimerMaxDelaySec(final int timerMaxDelaySec) {
15921611
this.timerMaxDelaySec = timerMaxDelaySec;
15931612
}

0 commit comments

Comments
 (0)