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/11/17 13:37:01 UTC

[GitHub] [incubator-ratis] szetszwo opened a new pull request #282: RATIS-1162. Enable testing clusters with Netty data stream and gRPC.

szetszwo opened a new pull request #282:
URL: https://github.com/apache/incubator-ratis/pull/282


   See https://issues.apache.org/jira/browse/RATIS-1162


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



[GitHub] [incubator-ratis] szetszwo closed pull request #282: RATIS-1162. Enable testing clusters with Netty data stream and gRPC.

Posted by GitBox <gi...@apache.org>.
szetszwo closed pull request #282:
URL: https://github.com/apache/incubator-ratis/pull/282


   


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



[GitHub] [incubator-ratis] runzhiwang closed pull request #282: RATIS-1162. Enable testing clusters with Netty data stream and gRPC.

Posted by GitBox <gi...@apache.org>.
runzhiwang closed pull request #282:
URL: https://github.com/apache/incubator-ratis/pull/282


   


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



[GitHub] [incubator-ratis] runzhiwang commented on a change in pull request #282: RATIS-1162. Enable testing clusters with Netty data stream and gRPC.

Posted by GitBox <gi...@apache.org>.
runzhiwang commented on a change in pull request #282:
URL: https://github.com/apache/incubator-ratis/pull/282#discussion_r525623807



##########
File path: ratis-netty/src/test/java/org/apache/ratis/netty/MiniRaftClusterWithNetty.java
##########
@@ -30,12 +31,16 @@
 
 import java.io.IOException;
 
+/**
+ * A {@link MiniRaftCluster} with {{@link SupportedRpcType#NETTY}} and {@link SupportedDataStreamType#NETTY}.
+ */
 public class MiniRaftClusterWithNetty extends MiniRaftCluster.RpcBase {
   public static final Factory<MiniRaftClusterWithNetty> FACTORY
       = new Factory<MiniRaftClusterWithNetty>() {
     @Override
     public MiniRaftClusterWithNetty newCluster(String[] ids, RaftProperties prop) {
       RaftConfigKeys.Rpc.setType(prop, SupportedRpcType.NETTY);
+      RaftConfigKeys.DataStream.setType(prop, SupportedDataStreamType.NETTY);

Review comment:
       @szetszwo Can we define `RaftConfigKeys.DataStream.setType(prop, SupportedDataStreamType.NETTY);` in the following code ? If we define it here, other tests use MiniRaftClusterWithNetty but  unrelated to data stream will also start data stream server.
   ```
   public class TestNettyDataStreamWithNettyCluster extends DataStreamClusterTests<MiniRaftClusterWithNetty>
       implements MiniRaftClusterWithNetty.FactoryGet {
     {
       RaftConfigKeys.DataStream.setType(getProperties(), SupportedDataStreamType.NETTY);
     }
   }
   ```




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



[GitHub] [incubator-ratis] runzhiwang closed pull request #282: RATIS-1162. Enable testing clusters with Netty data stream and gRPC.

Posted by GitBox <gi...@apache.org>.
runzhiwang closed pull request #282:
URL: https://github.com/apache/incubator-ratis/pull/282


   


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



[GitHub] [incubator-ratis] runzhiwang commented on a change in pull request #282: RATIS-1162. Enable testing clusters with Netty data stream and gRPC.

Posted by GitBox <gi...@apache.org>.
runzhiwang commented on a change in pull request #282:
URL: https://github.com/apache/incubator-ratis/pull/282#discussion_r525623807



##########
File path: ratis-netty/src/test/java/org/apache/ratis/netty/MiniRaftClusterWithNetty.java
##########
@@ -30,12 +31,16 @@
 
 import java.io.IOException;
 
+/**
+ * A {@link MiniRaftCluster} with {{@link SupportedRpcType#NETTY}} and {@link SupportedDataStreamType#NETTY}.
+ */
 public class MiniRaftClusterWithNetty extends MiniRaftCluster.RpcBase {
   public static final Factory<MiniRaftClusterWithNetty> FACTORY
       = new Factory<MiniRaftClusterWithNetty>() {
     @Override
     public MiniRaftClusterWithNetty newCluster(String[] ids, RaftProperties prop) {
       RaftConfigKeys.Rpc.setType(prop, SupportedRpcType.NETTY);
+      RaftConfigKeys.DataStream.setType(prop, SupportedDataStreamType.NETTY);

Review comment:
       @szetszwo Can we define `RaftConfigKeys.DataStream.setType(prop, SupportedDataStreamType.NETTY);` in the following code ? If we define it here, other test unrelated to data stream will also start data stream server.
   ```
   public class TestNettyDataStreamWithNettyCluster extends DataStreamClusterTests<MiniRaftClusterWithNetty>
       implements MiniRaftClusterWithNetty.FactoryGet {
     {
       RaftConfigKeys.DataStream.setType(getProperties(), SupportedDataStreamType.NETTY);
     }
   }
   ```




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



[GitHub] [incubator-ratis] runzhiwang merged pull request #282: RATIS-1162. Enable testing clusters with Netty data stream and gRPC.

Posted by GitBox <gi...@apache.org>.
runzhiwang merged pull request #282:
URL: https://github.com/apache/incubator-ratis/pull/282


   


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



[GitHub] [incubator-ratis] amaliujia commented on a change in pull request #282: RATIS-1162. Enable testing clusters with Netty data stream and gRPC.

Posted by GitBox <gi...@apache.org>.
amaliujia commented on a change in pull request #282:
URL: https://github.com/apache/incubator-ratis/pull/282#discussion_r529044789



##########
File path: ratis-test/src/test/java/org/apache/ratis/datastream/MiniRaftClusterWithRpcTypeGrpcAndDataStreamTypeNetty.java
##########
@@ -0,0 +1,64 @@
+/*
+ * 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.datastream;
+
+import org.apache.ratis.MiniRaftCluster;
+import org.apache.ratis.RaftConfigKeys;
+import org.apache.ratis.conf.RaftProperties;
+import org.apache.ratis.grpc.MiniRaftClusterWithGrpc;
+import org.apache.ratis.netty.NettyConfigKeys;
+import org.apache.ratis.protocol.RaftGroup;
+import org.apache.ratis.protocol.RaftPeerId;
+import org.apache.ratis.rpc.SupportedRpcType;
+import org.apache.ratis.server.impl.RaftServerProxy;
+import org.apache.ratis.statemachine.StateMachine;
+
+import java.io.IOException;
+
+/**
+ * A {@link MiniRaftCluster} with {{@link SupportedRpcType#GRPC}} and {@link SupportedDataStreamType#NETTY}.
+ */
+public class MiniRaftClusterWithRpcTypeGrpcAndDataStreamTypeNetty extends MiniRaftClusterWithGrpc {

Review comment:
       O I see. In the past I was confused on how to solve the dependency issues to enable streaming for a grpc cluster because the grpc cluster is defined in the grpc module but data stream is in netty module.
   
   So the resolution is define this cluster impl in ratis-test module directly 👍  




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



[GitHub] [incubator-ratis] szetszwo commented on a change in pull request #282: RATIS-1162. Enable testing clusters with Netty data stream and gRPC.

Posted by GitBox <gi...@apache.org>.
szetszwo commented on a change in pull request #282:
URL: https://github.com/apache/incubator-ratis/pull/282#discussion_r525633322



##########
File path: ratis-netty/src/test/java/org/apache/ratis/netty/MiniRaftClusterWithNetty.java
##########
@@ -30,12 +31,16 @@
 
 import java.io.IOException;
 
+/**
+ * A {@link MiniRaftCluster} with {{@link SupportedRpcType#NETTY}} and {@link SupportedDataStreamType#NETTY}.
+ */
 public class MiniRaftClusterWithNetty extends MiniRaftCluster.RpcBase {
   public static final Factory<MiniRaftClusterWithNetty> FACTORY
       = new Factory<MiniRaftClusterWithNetty>() {
     @Override
     public MiniRaftClusterWithNetty newCluster(String[] ids, RaftProperties prop) {
       RaftConfigKeys.Rpc.setType(prop, SupportedRpcType.NETTY);
+      RaftConfigKeys.DataStream.setType(prop, SupportedDataStreamType.NETTY);

Review comment:
       That's is a good point.  Let's add another subclass like MiniRaftClusterWithGrpcAndNettyDataStream.




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