You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ratis.apache.org by GitBox <gi...@apache.org> on 2020/10/12 00:01:48 UTC

[GitHub] [incubator-ratis] runzhiwang commented on a change in pull request #215: RATIS-1089. Add getDataStreamApi() to RaftClient.

runzhiwang commented on a change in pull request #215:
URL: https://github.com/apache/incubator-ratis/pull/215#discussion_r502984470



##########
File path: ratis-client/src/main/java/org/apache/ratis/client/api/DataStreamApi.java
##########
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ratis.client.api;
+
+/**
+ * Stream data asynchronously to all the servers in the {@link org.apache.ratis.protocol.RaftGroup}.
+ * Clients may stream data to the nearest server and then the server will forward the data to the other servers.
+ * Once all the servers have received all the data of a request,
+ * the leader (may or may not be the nearest server) creates a log entry with a data ID generated by the state machine.
+ * Then, the leader sends the log entry to the followers.
+ * Since the followers already have received the data from the stream,
+ * they may lookup the data from the ID.

Review comment:
       Because follower needs to look up the data from the ID, so when follower receives the data from the stream, it needs to store a map<ID, the data from the stream>, so this ID must be transfered to all servers in the first request of stream.
   Can this ID generated by clientId_streamId ?




----------------------------------------------------------------
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:
users@infra.apache.org