hemantk-12 commented on code in PR #7434:
URL: https://github.com/apache/ozone/pull/7434#discussion_r1844367010
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestDataUtil.java:
##########
@@ -164,21 +164,57 @@ private static BucketLayout
getDefaultBucketLayout(OzoneClient client) {
public static OzoneBucket createBucket(OzoneClient client,
String vol, BucketArgs bucketArgs, String bukName)
throws IOException {
+ return createBucket(client, vol, bucketArgs, bukName, false);
+ }
+
+ public static OzoneBucket createBucket(OzoneClient client,
+ String vol, BucketArgs bucketArgs,
String bukName,
+ boolean createLinkedBucket)
+ throws IOException {
ObjectStore objectStore = client.getObjectStore();
OzoneVolume volume = objectStore.getVolume(vol);
- volume.createBucket(bukName, bucketArgs);
- return volume.getBucket(bukName);
+ String sourceBucket = bukName;
+ if (createLinkedBucket) {
+ sourceBucket = bukName + RandomStringUtils.randomNumeric(5);
+ }
+ volume.createBucket(sourceBucket, bucketArgs);
+ OzoneBucket ozoneBucket = volume.getBucket(sourceBucket);
+ if (createLinkedBucket) {
+ ozoneBucket = createLinkedBucket(client, vol, sourceBucket, bukName);
+ }
+ return ozoneBucket;
+ }
+
+ public static OzoneBucket createLinkedBucket(OzoneClient client, String vol,
String sourceBucketName,
+ String linkedBucketName) throws
IOException {
+ BucketArgs.Builder bb = new BucketArgs.Builder()
+ .setStorageType(StorageType.DEFAULT)
+ .setVersioning(false)
+ .setSourceVolume(vol)
+ .setSourceBucket(sourceBucketName);
+ return createBucket(client, vol, bb.build(), linkedBucketName);
Review Comment:
Shouldn't we need to call
[createBucket](https://github.com/apache/ozone/blob/7830c2baafd367e44f0c3dec308dca3873cdb5c7/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestDataUtil.java#L170)
with true flag? Currently, it is calling `createBucket` which defaults to not
linked bucket.
--
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]