-
Notifications
You must be signed in to change notification settings - Fork 11.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* jRaft-Controller Implemention * fix bazel build * reformat code * remove fury dependence * fix bazel build * resolve conflict * clear code * Optimize code style * Optimize code style * Optimize code style * revert style only change fix code style rollback an unexpected modification. * Update Producer.java * chore: move raft startup to start method * chore: use jraftconfig to collect all configs about jraft * fix: fix wrong store path because init use string constant * fix: fix CONTROLLER_NOT_LEADER error in follower * chore: seperate jraft and controller log * chore: fix conflict with develop * chore: add comment to clear the filter logic * feat: triggerElectMaster will retry when failed * feat: when controller all restart, we use a timestamp to trace the first heartbeat, avoid to elect again * fix: implements Serializable to enable snapshot serialize * fix: use for loop to simple the elect retry * chore: update jraft version * chore: opt import --------- Co-authored-by: leizhiyuan <[email protected]>
- Loading branch information
1 parent
1784213
commit 8df53df
Showing
57 changed files
with
2,484 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
common/src/main/java/org/apache/rocketmq/common/JraftConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.rocketmq.common; | ||
|
||
public class JraftConfig { | ||
int jRaftElectionTimeoutMs = 1000; | ||
|
||
int jRaftScanWaitTimeoutMs = 1000; | ||
int jRaftSnapshotIntervalSecs = 3600; | ||
String jRaftGroupId = "jRaft-Controller"; | ||
String jRaftServerId = "localhost:9880"; | ||
String jRaftInitConf = "localhost:9880,localhost:9881,localhost:9882"; | ||
String jRaftControllerRPCAddr = "localhost:9770,localhost:9771,localhost:9772"; | ||
|
||
public int getjRaftElectionTimeoutMs() { | ||
return jRaftElectionTimeoutMs; | ||
} | ||
|
||
public void setjRaftElectionTimeoutMs(int jRaftElectionTimeoutMs) { | ||
this.jRaftElectionTimeoutMs = jRaftElectionTimeoutMs; | ||
} | ||
|
||
public int getjRaftSnapshotIntervalSecs() { | ||
return jRaftSnapshotIntervalSecs; | ||
} | ||
|
||
public void setjRaftSnapshotIntervalSecs(int jRaftSnapshotIntervalSecs) { | ||
this.jRaftSnapshotIntervalSecs = jRaftSnapshotIntervalSecs; | ||
} | ||
|
||
public String getjRaftGroupId() { | ||
return jRaftGroupId; | ||
} | ||
|
||
public void setjRaftGroupId(String jRaftGroupId) { | ||
this.jRaftGroupId = jRaftGroupId; | ||
} | ||
|
||
public String getjRaftServerId() { | ||
return jRaftServerId; | ||
} | ||
|
||
public void setjRaftServerId(String jRaftServerId) { | ||
this.jRaftServerId = jRaftServerId; | ||
} | ||
|
||
public String getjRaftInitConf() { | ||
return jRaftInitConf; | ||
} | ||
|
||
public void setjRaftInitConf(String jRaftInitConf) { | ||
this.jRaftInitConf = jRaftInitConf; | ||
} | ||
|
||
public String getjRaftControllerRPCAddr() { | ||
return jRaftControllerRPCAddr; | ||
} | ||
|
||
public void setjRaftControllerRPCAddr(String jRaftControllerRPCAddr) { | ||
this.jRaftControllerRPCAddr = jRaftControllerRPCAddr; | ||
} | ||
|
||
public String getjRaftAddress() { | ||
return this.jRaftServerId; | ||
} | ||
|
||
public int getjRaftScanWaitTimeoutMs() { | ||
return jRaftScanWaitTimeoutMs; | ||
} | ||
|
||
public void setjRaftScanWaitTimeoutMs(int jRaftScanWaitTimeoutMs) { | ||
this.jRaftScanWaitTimeoutMs = jRaftScanWaitTimeoutMs; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.