Skip to content

Commit 1cb6c36

Browse files
committedMar 8, 2025·
Applied comments
1 parent 5c6a299 commit 1cb6c36

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed
 

‎hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFSWithObjectStoreCreate.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ private void checkKeyList(Iterator<? extends OzoneKey > ozoneKeyIterator,
402402
private void createAndAssertKey(OzoneBucket ozoneBucket, String key, int length)
403403
throws Exception {
404404

405-
byte[] input = createKey(ozoneBucket, key, length);
405+
byte[] input = TestDataUtil.createStringKey(ozoneBucket, key, length);
406406
// Read the key with given key name.
407407
readKey(ozoneBucket, key, length, input);
408408

‎hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestDataUtil.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,9 @@ public static OzoneVolume createVolume(OzoneClient client,
105105

106106
}
107107

108-
public static byte[] createKey(OzoneBucket bucket,
109-
String keyName, int length) throws IOException {
110-
byte[] content = RandomStringUtils.random(length, 0, 0,
111-
true, true, null, new SecureRandom()).getBytes(UTF_8);
108+
public static byte[] createStringKey(OzoneBucket bucket, String keyName, int length)
109+
throws IOException {
110+
byte[] content = RandomStringUtils.secure().nextAlphanumeric(length).getBytes(UTF_8);
112111
createKey(bucket, keyName, content);
113112
return content;
114113
}

‎hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListKeys.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ private void checkKeyShallowList(String keyPrefix, String startKey,
372372
private static void createAndAssertKeys(OzoneBucket ozoneBucket, List<String> keys)
373373
throws Exception {
374374
for (String key : keys) {
375-
byte[] input = createKey(ozoneBucket, key, 10);
375+
byte[] input = TestDataUtil.createStringKey(ozoneBucket, key, 10);
376376
// Read the key with given key name.
377377
readkey(ozoneBucket, key, 10, input);
378378
}

‎hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListKeysWithFSO.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ private void checkKeyShallowList(String keyPrefix, String startKey,
643643
private static void createAndAssertKeys(OzoneBucket ozoneBucket, List<String> keys)
644644
throws Exception {
645645
for (String key : keys) {
646-
byte[] input = createKey(ozoneBucket, key, 10);
646+
byte[] input = TestDataUtil.createStringKey(ozoneBucket, key, 10);
647647
// Read the key with given key name.
648648
readkey(ozoneBucket, key, 10, input);
649649
}

‎hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestObjectStoreWithFSO.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ private void createAndAssertKeys(OzoneBucket ozoneBucket, List<String> keys)
560560
throws Exception {
561561

562562
for (String key : keys) {
563-
byte[] input = createKey(ozoneBucket, key, 10);
563+
byte[] input = TestDataUtil.createStringKey(ozoneBucket, key, 10);
564564
// Read the key with given key name.
565565
readKey(ozoneBucket, key, 10, input);
566566
}

‎hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestRecursiveAclWithFSO.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import org.apache.commons.lang3.RandomStringUtils;
3434
import org.apache.hadoop.hdds.protocol.StorageType;
3535
import org.apache.hadoop.ozone.OzoneAcl;
36+
import org.apache.hadoop.ozone.TestDataUtil;
3637
import org.apache.hadoop.ozone.client.BucketArgs;
3738
import org.apache.hadoop.ozone.client.ObjectStore;
3839
import org.apache.hadoop.ozone.client.OzoneBucket;
@@ -333,7 +334,7 @@ private void createKeys(ObjectStore objectStore, OzoneBucket ozoneBucket,
333334
String aclWorldAll = "world::a";
334335

335336
for (String key : keys) {
336-
createKey(ozoneBucket, key, 10);
337+
TestDataUtil.createStringKey(ozoneBucket, key, 10);
337338
setKeyAcl(objectStore, ozoneBucket.getVolumeName(), ozoneBucket.getName(),
338339
key, aclWorldAll);
339340
}

‎hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystem.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ private void createKeys(OzoneBucket ozoneBucket, List<String> keys)
357357
private void createKey(OzoneBucket ozoneBucket, String key, int length)
358358
throws Exception {
359359

360-
byte[] input = TestDataUtil.createKey(ozoneBucket, key, length);
360+
byte[] input = TestDataUtil.createStringKey(ozoneBucket, key, length);
361361
// Read the key with given key name.
362362
readkey(ozoneBucket, key, length, input);
363363
}

0 commit comments

Comments
 (0)
Please sign in to comment.