amaliujia commented on a change in pull request #401:
URL: https://github.com/apache/incubator-ratis/pull/401#discussion_r562261994
##########
File path: ratis-common/src/main/java/org/apache/ratis/protocol/RaftPeer.java
##########
@@ -132,6 +170,8 @@ private RaftPeerProto buildRaftPeerProto() {
.setId(getId().toByteString());
Optional.ofNullable(getAddress()).ifPresent(builder::setAddress);
Optional.ofNullable(getDataStreamAddress()).ifPresent(builder::setDataStreamAddress);
+
Optional.ofNullable(getClientAddress()).ifPresent(builder::setClientAddress);
+ Optional.ofNullable(getAdminAddress()).ifPresent(builder::setAdminAddress);
Review comment:
Is there a need in build() to check whether these address are different
or it is ok to reuse the same address for these fields (I am not sure, just
asking)
##########
File path: ratis-common/src/main/java/org/apache/ratis/protocol/RaftPeer.java
##########
@@ -163,9 +213,13 @@ public RaftPeerProto getRaftPeerProto() {
@Override
public String toString() {
final String rpc = address != null? "|rpc:" + address: "";
+ final String admin = adminAddress != null && !Objects.equals(address,
adminAddress)
+ ? "|admin:" + adminAddress : "";
+ final String client = clientAddress != null && !Objects.equals(address,
clientAddress)
+ ? "|client:" + clientAddress : "";
Review comment:
Nit: I think it is more readable to move "|admin:" and "|client:" before
the `?` thus these string will always be generated.
##########
File path: ratis-examples/src/main/bin/common.sh
##########
@@ -38,7 +38,7 @@ fi
echo "Found ${ARTIFACT}"
-QUORUM_OPTS="--peers n0:localhost:6000,n1:localhost:6001,n2:localhost:6002"
+QUORUM_OPTS="--peers
n0:localhost:6000:6010:6020:6030,n1:localhost:6001:6011:6021:6031,n2:localhost:6002:6012:6022:6032"
Review comment:
+1
##########
File path: ratis-common/src/main/java/org/apache/ratis/protocol/RaftPeer.java
##########
@@ -132,6 +170,8 @@ private RaftPeerProto buildRaftPeerProto() {
.setId(getId().toByteString());
Optional.ofNullable(getAddress()).ifPresent(builder::setAddress);
Optional.ofNullable(getDataStreamAddress()).ifPresent(builder::setDataStreamAddress);
+
Optional.ofNullable(getClientAddress()).ifPresent(builder::setClientAddress);
+ Optional.ofNullable(getAdminAddress()).ifPresent(builder::setAdminAddress);
Review comment:
I guess this is answered before: client and admin can reuse address.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]