szetszwo commented on a change in pull request #364:
URL: https://github.com/apache/incubator-ratis/pull/364#discussion_r546194092
##########
File path:
ratis-netty/src/main/java/org/apache/ratis/netty/server/DataStreamManagement.java
##########
@@ -231,23 +232,48 @@ StreamInfo remove(Key key) {
return f;
}
+
+ private IdentityHashMap<RaftPeer, RaftPeer> getRouteTable(RaftClientRequest
request)
Review comment:
Let's create a org.apache.ratis.protocol.RouteTable interface/class in
ratis-common.
```
interface RoutingTable {
List<RaftPeerId> getSuccessors(RaftPeerId peer);
}
```
I think we need RaftPeerId since the RaftPeer can be looked up locally.
BTW, why using IdentityHashMap but not just a Map in the implementation?
##########
File path: ratis-proto/src/main/proto/Raft.proto
##########
@@ -280,6 +280,19 @@ message WatchRequestTypeProto {
ReplicationLevel replication = 2;
}
+message RoutePairProto {
+ RaftPeerProto from = 1;
+ RaftPeerProto to = 2;
+}
+
+message DataStreamRouteTableProto {
+ repeated RoutePairProto routeTable = 1;
+}
Review comment:
Let's call the RouteProto and RouteTableProto. It may be useful outside
DataStream in the future.
Let's use RaftPeerId instead of RaftPeerProto. It may be a good time to
create RaftPeerIdProto which is currently missing.
----------------------------------------------------------------
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]