You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/08/06 02:12:57 UTC

[GitHub] [ozone] jojochuang commented on a change in pull request #2498: HDDS-5537. Limit grpc threads in ReplicationServer.

jojochuang commented on a change in pull request #2498:
URL: https://github.com/apache/ozone/pull/2498#discussion_r683897522



##########
File path: hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/replication/TestReplicationServer.java
##########
@@ -0,0 +1,70 @@
+/*
+ * 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.hadoop.ozone.container.replication;
+
+import org.apache.hadoop.hdds.conf.OzoneConfiguration;
+import org.apache.hadoop.hdds.security.x509.SecurityConfig;
+import org.apache.hadoop.ozone.container.common.statemachine.DatanodeConfiguration;
+import org.junit.Test;
+
+import java.io.IOException;
+
+/**
+ * Test the replication server.
+ */
+public class TestReplicationServer {
+
+  @Test
+  public void testEpollEnabled() {
+    OzoneConfiguration config = new OzoneConfiguration();
+    DatanodeConfiguration dnConf =
+        config.getObject(DatanodeConfiguration.class);
+    ReplicationServer.ReplicationConfig replicationConfig =
+        config.getObject(ReplicationServer.ReplicationConfig.class);
+    SecurityConfig secConf = new SecurityConfig(config);
+    ReplicationServer server = new ReplicationServer(null, replicationConfig,
+        secConf, dnConf, null);
+    try {
+      server.start();
+      server.stop();
+    } catch (IOException e) {
+      e.printStackTrace();
+    }
+  }
+
+  @Test
+  public void testEpollDisabled() {
+    OzoneConfiguration config = new OzoneConfiguration();
+    DatanodeConfiguration dnConf =
+        config.getObject(DatanodeConfiguration.class);
+    ReplicationServer.ReplicationConfig replicationConfig =
+        config.getObject(ReplicationServer.ReplicationConfig.class);
+    SecurityConfig secConf = new SecurityConfig(config);
+    System.setProperty(
+        "org.apache.ratis.thirdparty.io.netty.transport.noNative", "true");
+    ReplicationServer server = new ReplicationServer(null, replicationConfig,
+        secConf, dnConf, null);
+    try {
+      server.start();
+      server.stop();
+    } catch (IOException e) {

Review comment:
       ditto.

##########
File path: hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/replication/TestReplicationServer.java
##########
@@ -0,0 +1,70 @@
+/*
+ * 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.hadoop.ozone.container.replication;
+
+import org.apache.hadoop.hdds.conf.OzoneConfiguration;
+import org.apache.hadoop.hdds.security.x509.SecurityConfig;
+import org.apache.hadoop.ozone.container.common.statemachine.DatanodeConfiguration;
+import org.junit.Test;
+
+import java.io.IOException;
+
+/**
+ * Test the replication server.
+ */
+public class TestReplicationServer {
+
+  @Test
+  public void testEpollEnabled() {
+    OzoneConfiguration config = new OzoneConfiguration();
+    DatanodeConfiguration dnConf =
+        config.getObject(DatanodeConfiguration.class);
+    ReplicationServer.ReplicationConfig replicationConfig =
+        config.getObject(ReplicationServer.ReplicationConfig.class);
+    SecurityConfig secConf = new SecurityConfig(config);
+    ReplicationServer server = new ReplicationServer(null, replicationConfig,
+        secConf, dnConf, null);
+    try {
+      server.start();
+      server.stop();
+    } catch (IOException e) {
+      e.printStackTrace();
+    }

Review comment:
       you should just let it throw exception when there's one, otherwise it will still succeed even if an IOException is throw.




-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org