captainzmc commented on a change in pull request #557:
URL: https://github.com/apache/ratis/pull/557#discussion_r764700748



##########
File path: 
ratis-examples/src/main/java/org/apache/ratis/examples/filestore/cli/Client.java
##########
@@ -135,7 +135,7 @@ public void run() throws Exception {
           new GrpcFactory(new org.apache.ratis.conf.Parameters())
               .newRaftClientRpc(ClientId.randomId(), raftProperties));
       RaftPeer[] peers = getPeers();
-      builder.setPrimaryDataStreamServer(peers[i % peers.length]);
+      builder.setPrimaryDataStreamServer(peers[0]);

Review comment:
       Currently we  init a number of clients before streamWrite. Each clients 
we will setPrimaryDataStreamServer(one of node in --peers parameter).  This 
determines that the client will write data to that node first. The first node 
determines the next node via a [routingTable constructed by 
peers](https://github.com/apache/ratis/blob/9b1717fa152e7de58edee5e64ab4ff181147c3f6/ratis-examples/src/main/java/org/apache/ratis/examples/filestore/cli/DataStream.java#L162).
 
   
   For example: --peers=node1,node2,node3  --numClients=2
   There will have a client, setPrimaryDataStreamServer for node2(peers[1 % 
3]). The written routingTable is node1->node2->node3. 
   The final write effect will be client -> node2->node3. And node1 will have 
no data.
   
   
   




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to