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/07/26 07:22:33 UTC

[GitHub] [ozone] umamaheswararao commented on a change in pull request #2430: HDDS-5460: ReplicationConfig#getDefault is hardcoded with RatisReplicationConfig

umamaheswararao commented on a change in pull request #2430:
URL: https://github.com/apache/ozone/pull/2430#discussion_r676353411



##########
File path: hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/client/TestReplicationConfig.java
##########
@@ -27,6 +29,23 @@
  */
 public class TestReplicationConfig {
 
+  @Test
+  public void testGetDefaultShouldCreateReplicationConfigFromConf() {
+    OzoneConfiguration conf = new OzoneConfiguration();
+    ReplicationConfig replicationConfig = ReplicationConfig.getDefault(conf);
+    Assert.assertEquals(
+        org.apache.hadoop.hdds.client.ReplicationType.RATIS.name(),
+        replicationConfig.getReplicationType().name());
+    Assert.assertEquals(3, replicationConfig.getRequiredNodes());
+    conf.set(OzoneConfigKeys.OZONE_REPLICATION_TYPE, "STAND_ALONE");
+    conf.set(OzoneConfigKeys.OZONE_REPLICATION, "1");
+    replicationConfig = ReplicationConfig.getDefault(conf);
+    Assert.assertEquals(
+        org.apache.hadoop.hdds.client.ReplicationType.STAND_ALONE.name(),
+        replicationConfig.getReplicationType().name());
+    Assert.assertEquals(1, replicationConfig.getRequiredNodes());

Review comment:
       Sure, I have separated the tests into two.




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