-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
【remember to add Hu and Peng to co-arthor and delete this bracket before merge】IoTConsensus and IoTConsensusV2 no longer stores the peer list locally on the DataNode #14814
【remember to add Hu and Peng to co-arthor and delete this bracket before merge】IoTConsensus and IoTConsensusV2 no longer stores the peer list locally on the DataNode #14814
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Complete IoTV2 part
@@ -174,7 +175,7 @@ private void initAndRecover() throws IOException { | |||
new IoTConsensusServerImpl( | |||
path.toString(), | |||
new Peer(consensusGroupId, thisNodeId, thisNode), | |||
new ArrayList<>(), | |||
new TreeSet<>(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why use treeset?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, duplicates were removed during configuration persistence. Now that the persistence code is gone, a set is used to keep this logic.
TreeSet is used to return a List with a consistent order (for an interface), which I believe is better than the unordered HashSet.
...core/consensus/src/main/java/org/apache/iotdb/consensus/iot/logdispatcher/LogDispatcher.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM~
Really Awesome work!
The new
resetPeerList
interface is super powerful.Now, IoTConsensus member management can be fully handled by ConfigNode, and DataNode can simply obtain the peer list from ConfigNode during startup (through
resetPeerList
interface).