adoroszlai commented on code in PR #7999:
URL: https://github.com/apache/ozone/pull/7999#discussion_r1977963905


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/AbstractOzoneFileSystemTest.java:
##########
@@ -374,7 +374,7 @@ public void testMakeDirsWithAnFakeDirectory() throws 
Exception {
     String fakeGrandpaKey = "dir1";
     String fakeParentKey = fakeGrandpaKey + "/dir2";
     String fullKeyName = fakeParentKey + "/key1";
-    TestDataUtil.createKey(ozoneBucket, fullKeyName, "");
+    TestDataUtil.createKey(ozoneBucket, fullKeyName, "".getBytes(UTF_8));

Review Comment:
   I guess `"".getBytes(UTF_8)` can be replaced with `new byte[0]`.



##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/OzoneRpcClientTests.java:
##########
@@ -1092,18 +1092,18 @@ public void testDeleteAuditLog() throws Exception {
 
     // create a three replica file
     String keyName1 = "key1";
-    TestDataUtil.createKey(bucket, keyName1, THREE, RATIS, value);
+    TestDataUtil.createKey(bucket, keyName1, THREE, RATIS, 
value.getBytes(UTF_8));

Review Comment:
   Let's change `String value` to `byte[] value` and store result of 
`getBytes(UTF_8)` once.  Then we can keep passing simply `value`.



##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestDataUtil.java:
##########
@@ -140,20 +134,6 @@ public static void createKey(OzoneBucket bucket, String 
keyName,
     }
   }
 
-  public static void createKey(OzoneBucket bucket, String keyName,
-      ReplicationFactor repFactor, ReplicationType repType, String content)
-      throws IOException {
-    ReplicationConfig repConfig = ReplicationConfig
-        .fromTypeAndFactor(repType, repFactor);
-    createKey(bucket, keyName, repConfig, content.getBytes(UTF_8));
-  }
-
-  public static void createKey(OzoneBucket bucket, String keyName,
-      ReplicationConfig repConfig, String content)
-      throws IOException {
-    createKey(bucket, keyName, repConfig, content.getBytes(UTF_8));
-  }

Review Comment:
   I think we should also remove this one:
   
   
https://github.com/apache/ozone/blob/df1f35bee9832d1b005930d785bbef8355b19764/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestDataUtil.java#L115-L125
   
   `OzoneBucket#createKey` with separate `ReplicationFactor` and 
`ReplicationType` parameters is deprecated:
   
   
https://github.com/apache/ozone/blob/bb16f66e22c44b360d42d0cae87024786e27c61b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/OzoneBucket.java#L444-L452
   
   callers can be changed to use the variant that accepts a `ReplicationConfig` 
by using:
   
   
https://github.com/apache/ozone/blob/bb16f66e22c44b360d42d0cae87024786e27c61b/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/RatisReplicationConfig.java#L46-L58
   
   And this one can also be removed:
   
   
https://github.com/apache/ozone/blob/df1f35bee9832d1b005930d785bbef8355b19764/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestDataUtil.java#L137-L147
   
   `ByteBuffer` can be backed by array (`HeapByteBuffer`) or native memory 
(`DirectByteBuffer`).  This method only works with the first type, so callers 
can be changed to simply pass `buffer.array()` and is used only by a single 
test class.



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