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



##########
File path: 
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClientAbstract.java
##########
@@ -3753,4 +3757,47 @@ public void testOverWriteKeyWithAndWithOutVersioning() 
throws Exception {
     createRequiredForVersioningTest(volumeName, bucketName, keyName, true);
     checkExceptedResultForVersioningTest(volumeName, bucketName, keyName, 2);
   }
+
+  @Test
+  public void testSetECReplicationConfigOnBucket()
+      throws IOException {
+    String volumeName = UUID.randomUUID().toString();
+    store.createVolume(volumeName);
+    OzoneVolume volume = store.getVolume(volumeName);
+    OzoneBucket bucket = getBucket(volume);
+    ReplicationConfig currentReplicationConfig = bucket.getReplicationConfig();
+    Assert.assertEquals(
+        new StandaloneReplicationConfig(HddsProtos.ReplicationFactor.ONE),
+        currentReplicationConfig);
+    ECReplicationConfig ecReplicationConfig =
+        new ECReplicationConfig(3, 2, ECReplicationConfig.EcCodec.RS, 1024);
+    bucket.setReplicationConfig(ecReplicationConfig);
+
+    // Get the bucket and check the updated config.
+    bucket = volume.getBucket(bucket.getName());
+
+    Assert.assertEquals(ecReplicationConfig, bucket.getReplicationConfig());
+
+    RatisReplicationConfig retisReplicationConfig =
+        new RatisReplicationConfig(HddsProtos.ReplicationFactor.THREE);
+    bucket.setReplicationConfig(retisReplicationConfig);
+
+    // Get the bucket and check the updated config.
+    bucket = volume.getBucket(bucket.getName());
+
+    Assert.assertEquals(retisReplicationConfig, bucket.getReplicationConfig());

Review comment:
       Thanks for catching. I have just fixed it.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to