Skip to content
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

remove RaftNode construct code to init #11

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

remove RaftNode construct code to init #11

wants to merge 4 commits into from

Conversation

zhyzhyzhy
Copy link

感觉冗余代码有点多。。。
这里把构造函数中的代码放到init中,同时禁止init被调用两次
去掉peerMap的get方法,外界不应该接触到peerMap

@@ -0,0 +1,13 @@
package com.github.wenweihu86.raft;

public class PeerId {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PeerId作为map的key时,应该实现equals和hashcode函数。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants