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/08/11 06:29:12 UTC

[GitHub] [incubator-ratis] szetszwo commented on a change in pull request #176: RATIS-1030 - Netty Streaming Implementation Client

szetszwo commented on a change in pull request #176:
URL: https://github.com/apache/incubator-ratis/pull/176#discussion_r468351580



##########
File path: ratis-client/src/main/java/org/apache/ratis/client/DataStreamClient.java
##########
@@ -48,29 +49,18 @@
 
   /** To build {@link DataStreamClient} objects */
   class Builder {
-    private ClientId clientId;
-    private DataStreamClientRpc dataStreamClientRpc;
+    private RaftPeer communicationPeer;
     private RaftProperties properties;
     private Parameters parameters;
 
     private Builder() {}
 
     public DataStreamClientImpl build(){
-      if (clientId == null) {
-        clientId = ClientId.randomId();
-      }
-      if (properties != null) {
-        if (dataStreamClientRpc == null) {
-          final SupportedDataStreamType type = RaftConfigKeys.DataStream.type(properties, LOG::info);
-          dataStreamClientRpc = DataStreamClientFactory.cast(type.newFactory(parameters))
-              .newDataStreamClientRpc(clientId, properties);
-        }
-      }
-      return new DataStreamClientImpl(clientId, properties, dataStreamClientRpc);
+      return new DataStreamClientImpl(communicationPeer, properties, parameters);
     }
 
-    public Builder setClientId(ClientId clientId) {
-      this.clientId = clientId;
+    public Builder setCommunicationPeer(RaftPeer peer) {

Review comment:
       setServer

##########
File path: ratis-client/src/main/java/org/apache/ratis/client/DataStreamClient.java
##########
@@ -48,29 +49,18 @@
 
   /** To build {@link DataStreamClient} objects */
   class Builder {
-    private ClientId clientId;
-    private DataStreamClientRpc dataStreamClientRpc;
+    private RaftPeer communicationPeer;

Review comment:
       Let's rename this to "server".

##########
File path: ratis-client/src/main/java/org/apache/ratis/client/impl/DataStreamClientImpl.java
##########
@@ -1,51 +1,104 @@
 /*
- * 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.
- */
+* 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.
+*/

Review comment:
       Please revert the license whitespace change.




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