Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
import org.apache.hadoop.hdds.conf.OzoneConfiguration;
import org.apache.hadoop.hdds.utils.IOUtils;
import org.apache.hadoop.hdds.utils.db.Table;
import org.apache.hadoop.ozone.DataTestUtil;
import org.apache.hadoop.ozone.MiniOzoneCluster;
import org.apache.hadoop.ozone.OzoneConsts;
import org.apache.hadoop.ozone.TestDataUtil;
import org.apache.hadoop.ozone.client.OzoneBucket;
import org.apache.hadoop.ozone.client.OzoneClient;
import org.apache.hadoop.ozone.om.helpers.BucketLayout;
Expand Down Expand Up @@ -149,7 +149,7 @@ public static void init() throws Exception {
client = cluster.newClient();

// Create FSO bucket for testing
OzoneBucket bucket = TestDataUtil.createVolumeAndBucket(client,
OzoneBucket bucket = DataTestUtil.createVolumeAndBucket(client,
BucketLayout.FILE_SYSTEM_OPTIMIZED);
String volumeName = bucket.getVolumeName();
String bucketName = bucket.getName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@
import org.apache.hadoop.hdds.scm.pipeline.Pipeline;
import org.apache.hadoop.hdds.scm.pipeline.PipelineManager;
import org.apache.hadoop.hdds.scm.server.StorageContainerManager;
import org.apache.hadoop.ozone.DataTestUtil;
import org.apache.hadoop.ozone.MiniOzoneCluster;
import org.apache.hadoop.ozone.OzoneConfigKeys;
import org.apache.hadoop.ozone.TestDataUtil;
import org.apache.hadoop.ozone.client.OzoneBucket;
import org.apache.hadoop.ozone.client.OzoneClient;
import org.apache.hadoop.ozone.container.TestHelper;
Expand Down Expand Up @@ -177,7 +177,7 @@ static void init() throws Exception {
String volumeName = "vol1";
String bucketName = "bucket1";

ozoneBucket = TestDataUtil.createVolumeAndBucket(
ozoneBucket = DataTestUtil.createVolumeAndBucket(
client, volumeName, bucketName, BucketLayout.FILE_SYSTEM_OPTIMIZED);

String keyNameR3 = "key1";
Expand Down Expand Up @@ -432,7 +432,7 @@ private static OmKeyInfo createTestKey(String keyName,
ReplicationConfig replicationConfig)
throws IOException {
byte[] textBytes = "Testing".getBytes(UTF_8);
TestDataUtil.createKey(ozoneBucket, keyName, replicationConfig, textBytes);
DataTestUtil.createKey(ozoneBucket, keyName, replicationConfig, textBytes);

OmKeyArgs keyArgs = new OmKeyArgs.Builder()
.setVolumeName(ozoneBucket.getVolumeName())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
import org.apache.hadoop.hdds.scm.server.OzoneStorageContainerManager;
import org.apache.hadoop.hdds.utils.IOUtils;
import org.apache.hadoop.hdds.utils.db.Table;
import org.apache.hadoop.ozone.DataTestUtil;
import org.apache.hadoop.ozone.MiniOzoneCluster;
import org.apache.hadoop.ozone.OzoneConsts;
import org.apache.hadoop.ozone.TestDataUtil;
import org.apache.hadoop.ozone.client.OzoneBucket;
import org.apache.hadoop.ozone.client.OzoneClient;
import org.apache.hadoop.ozone.om.OMMetadataManager;
Expand Down Expand Up @@ -159,7 +159,7 @@ public void cleanup() throws IOException {
@MethodSource("replicationConfigs")
public void testGetDeletedDirectoryInfo(ReplicationConfig replicationConfig)
throws Exception {
OzoneBucket bucket = TestDataUtil.createVolumeAndBucket(client, BucketLayout.FILE_SYSTEM_OPTIMIZED,
OzoneBucket bucket = DataTestUtil.createVolumeAndBucket(client, BucketLayout.FILE_SYSTEM_OPTIMIZED,
new DefaultReplicationConfig(replicationConfig));
String rootPath = String.format("%s://%s.%s/", OzoneConsts.OZONE_URI_SCHEME, bucket.getName(),
bucket.getVolumeName());
Expand Down Expand Up @@ -283,7 +283,7 @@ public void testGetDeletedDirectoryInfo(ReplicationConfig replicationConfig)
@MethodSource("replicationConfigs")
public void testGetDeletedDirectoryInfoForNestedDirectories(ReplicationConfig replicationConfig)
throws Exception {
OzoneBucket bucket = TestDataUtil.createVolumeAndBucket(client, BucketLayout.FILE_SYSTEM_OPTIMIZED,
OzoneBucket bucket = DataTestUtil.createVolumeAndBucket(client, BucketLayout.FILE_SYSTEM_OPTIMIZED,
new DefaultReplicationConfig(replicationConfig));
String rootPath = String.format("%s://%s.%s/", OzoneConsts.OZONE_URI_SCHEME, bucket.getName(),
bucket.getVolumeName());
Expand Down Expand Up @@ -395,7 +395,7 @@ public void testGetDeletedDirectoryInfoForNestedDirectories(ReplicationConfig re
@MethodSource("replicationConfigs")
public void testGetDeletedDirectoryInfoWithMultipleSubdirectories(ReplicationConfig replicationConfig)
throws Exception {
OzoneBucket bucket = TestDataUtil.createVolumeAndBucket(client, BucketLayout.FILE_SYSTEM_OPTIMIZED,
OzoneBucket bucket = DataTestUtil.createVolumeAndBucket(client, BucketLayout.FILE_SYSTEM_OPTIMIZED,
new DefaultReplicationConfig(replicationConfig));
String rootPath = String.format("%s://%s.%s/", OzoneConsts.OZONE_URI_SCHEME, bucket.getName(),
bucket.getVolumeName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
import org.apache.hadoop.hdds.protocol.proto.HddsProtos;
import org.apache.hadoop.hdds.scm.server.OzoneStorageContainerManager;
import org.apache.hadoop.hdds.utils.IOUtils;
import org.apache.hadoop.ozone.DataTestUtil;
import org.apache.hadoop.ozone.MiniOzoneCluster;
import org.apache.hadoop.ozone.TestDataUtil;
import org.apache.hadoop.ozone.client.ObjectStore;
import org.apache.hadoop.ozone.client.OzoneBucket;
import org.apache.hadoop.ozone.client.OzoneClient;
Expand Down Expand Up @@ -92,7 +92,7 @@ private void writeKeys(String vol, String bucket, String key)
String keyString = UUID.randomUUID().toString();
byte[] data = ContainerTestHelper.getFixedLengthString(
keyString, 100).getBytes(UTF_8);
TestDataUtil.createKey(ozoneBucket, key, data);
DataTestUtil.createKey(ozoneBucket, key, data);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@
import org.apache.hadoop.hdds.protocol.proto.HddsProtos;
import org.apache.hadoop.hdds.scm.OzoneClientConfig;
import org.apache.hadoop.hdds.utils.IOUtils;
import org.apache.hadoop.ozone.DataTestUtil;
import org.apache.hadoop.ozone.MiniOzoneCluster;
import org.apache.hadoop.ozone.OzoneConfigKeys;
import org.apache.hadoop.ozone.OzoneConsts;
import org.apache.hadoop.ozone.TestDataUtil;
import org.apache.hadoop.ozone.client.BucketArgs;
import org.apache.hadoop.ozone.client.ObjectStore;
import org.apache.hadoop.ozone.client.OzoneBucket;
Expand Down Expand Up @@ -198,7 +198,7 @@ void init() throws Exception {
writeClient = client.getObjectStore()
.getClientProxy().getOzoneManagerClient();
// create a volume and a bucket to be used by OzoneFileSystem
ozoneBucket = TestDataUtil.createVolumeAndBucket(client, bucketLayout);
ozoneBucket = DataTestUtil.createVolumeAndBucket(client, bucketLayout);
volumeName = ozoneBucket.getVolumeName();
bucketName = ozoneBucket.getName();

Expand Down Expand Up @@ -368,7 +368,7 @@ public void testMakeDirsWithAnFakeDirectory() throws Exception {
String fakeGrandpaKey = "dir1";
String fakeParentKey = fakeGrandpaKey + "/dir2";
String fullKeyName = fakeParentKey + "/key1";
TestDataUtil.createKey(ozoneBucket, fullKeyName, new byte[0]);
DataTestUtil.createKey(ozoneBucket, fullKeyName, new byte[0]);

// /dir1/dir2 should not exist
assertFalse(fs.exists(new Path(fakeParentKey)));
Expand Down Expand Up @@ -416,10 +416,10 @@ void testContentSummaryErasureCodingPolicy() throws Exception {
fs.mkdirs(parentDir);
String ratisRelKey = "ec-policy-mixed-o3fs/" + ratisKey;
String ecRelKey = "ec-policy-mixed-o3fs/" + ecKey;
TestDataUtil.createKey(ozoneBucket, ratisRelKey,
DataTestUtil.createKey(ozoneBucket, ratisRelKey,
RatisReplicationConfig.getInstance(HddsProtos.ReplicationFactor.THREE),
new byte[]{0});
TestDataUtil.createKey(ozoneBucket, ecRelKey, ecConfig,
DataTestUtil.createKey(ozoneBucket, ecRelKey, ecConfig,
new byte[]{0});

try {
Expand Down Expand Up @@ -792,7 +792,7 @@ public void testListStatusOnKeyNameContainDelimiter() throws Exception {
* the "/dir1", "/dir1/dir2/" are fake directory
* */
String keyName = "dir1/dir2/key1";
TestDataUtil.createKey(ozoneBucket, keyName, new byte[0]);
DataTestUtil.createKey(ozoneBucket, keyName, new byte[0]);
FileStatus[] fileStatuses;

fileStatuses = fs.listStatus(ROOT, EXCLUDE_TRASH);
Expand Down Expand Up @@ -1119,7 +1119,7 @@ public void testRenameContainDelimiterFile() throws Exception {
String fakeParentKey = fakeGrandpaKey + "/dir2";
String sourceKeyName = fakeParentKey + "/key1";
String targetKeyName = fakeParentKey + "/key2";
TestDataUtil.createKey(ozoneBucket, sourceKeyName, new byte[0]);
DataTestUtil.createKey(ozoneBucket, sourceKeyName, new byte[0]);

Path sourcePath = pathUnderFsRoot("/" + sourceKeyName);
Path targetPath = pathUnderFsRoot("/" + targetKeyName);
Expand Down Expand Up @@ -1246,7 +1246,7 @@ public void testGetTrashRoot() throws IOException {
public void testCreateKeyShouldUseRefreshedBucketReplicationConfig()
throws IOException {
OzoneBucket bucket =
TestDataUtil.createVolumeAndBucket(client, bucketLayout);
DataTestUtil.createVolumeAndBucket(client, bucketLayout);
final MockClock testClock = new MockClock(Instant.now(), ZoneOffset.UTC);

String rootPath = String
Expand Down Expand Up @@ -1552,7 +1552,7 @@ public void testProcessingDetails() throws IOException, InterruptedException {
GenericTestUtils.LogCapturer logCapturer =
GenericTestUtils.LogCapturer.captureLogs(log);
int keySize = 1024;
TestDataUtil.createKey(ozoneBucket, "key1", new byte[keySize]);
DataTestUtil.createKey(ozoneBucket, "key1", new byte[keySize]);
logCapturer.stopCapturing();
String logContent = logCapturer.getOutput();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@
import org.apache.hadoop.hdds.utils.IOUtils;
import org.apache.hadoop.hdfs.protocol.SnapshotDiffReport;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.ozone.DataTestUtil;
import org.apache.hadoop.ozone.MiniOzoneCluster;
import org.apache.hadoop.ozone.OFSPath;
import org.apache.hadoop.ozone.OzoneAcl;
import org.apache.hadoop.ozone.OzoneConfigKeys;
import org.apache.hadoop.ozone.OzoneConsts;
import org.apache.hadoop.ozone.TestDataUtil;
import org.apache.hadoop.ozone.client.BucketArgs;
import org.apache.hadoop.ozone.client.ObjectStore;
import org.apache.hadoop.ozone.client.OzoneBucket;
Expand Down Expand Up @@ -196,7 +196,7 @@ void shutdown() {
void createVolumeAndBucket() throws IOException {
// create a volume and a bucket to be used by RootedOzoneFileSystem (OFS)
OzoneBucket bucket =
TestDataUtil.createVolumeAndBucket(client, bucketLayout);
DataTestUtil.createVolumeAndBucket(client, bucketLayout);
volumeName = bucket.getVolumeName();
volumePath = new Path(OZONE_URI_DELIMITER, volumeName);
bucketName = bucket.getName();
Expand Down Expand Up @@ -304,7 +304,7 @@ void testListStatusWithIntermediateDirWithECEnabled()
String key = "object-dir/object-name1";

// write some test data into bucket
TestDataUtil.createKey(objectStore.getVolume(volumeName).getBucket(bucketName),
DataTestUtil.createKey(objectStore.getVolume(volumeName).getBucket(bucketName),
key, new ECReplicationConfig("RS-3-2-1024k"),
RandomUtils.secure().randomBytes(1));

Expand Down Expand Up @@ -1251,7 +1251,7 @@ void testSymlinkList() throws Exception {

// add key in source bucket
final String key = "object-dir/object-name1";
TestDataUtil.createKey(objectStore.getVolume(srcVolume).getBucket(srcBucket),
DataTestUtil.createKey(objectStore.getVolume(srcVolume).getBucket(srcBucket),
key, RandomUtils.secure().randomBytes(1));
assertEquals(key, objectStore.getVolume(srcVolume)
.getBucket(srcBucket).getKey(key).getName());
Expand Down Expand Up @@ -1299,7 +1299,7 @@ void testSymlinkPosixDelete() throws Exception {

// add key to srcBucket
final String key = "object-dir/object-name1";
TestDataUtil.createKey(objectStore.getVolume(srcVolume).getBucket(srcBucket),
DataTestUtil.createKey(objectStore.getVolume(srcVolume).getBucket(srcBucket),
key, RandomUtils.secure().randomBytes(1));
assertEquals(key, objectStore.getVolume(srcVolume).
getBucket(srcBucket).getKey(key).getName());
Expand Down Expand Up @@ -1535,7 +1535,7 @@ void testGetTrashRoots() throws IOException {

// Create a new volume and a new bucket
OzoneBucket bucket3 =
TestDataUtil.createVolumeAndBucket(client, bucketLayout);
DataTestUtil.createVolumeAndBucket(client, bucketLayout);
OzoneVolume volume3 = objectStore.getVolume(bucket3.getVolumeName());
// Need to setOwner to current test user so it has permission to list vols
volume3.setOwner(username);
Expand Down Expand Up @@ -1596,7 +1596,7 @@ void testTrash() throws Exception {
}
// create second bucket and write a key in it.
OzoneBucket bucket2 =
TestDataUtil.createVolumeAndBucket(client, bucketLayout);
DataTestUtil.createVolumeAndBucket(client, bucketLayout);
String volumeName2 = bucket2.getVolumeName();
Path volumePath2 = new Path(OZONE_URI_DELIMITER, volumeName2);
String bucketName2 = bucket2.getName();
Expand Down Expand Up @@ -1790,7 +1790,7 @@ void testBucketDefaultsShouldNotBeInheritedToFileForNonEC()
BucketArgs omBucketArgs = builder.build();
String vol = UUID.randomUUID().toString();
String buck = UUID.randomUUID().toString();
final OzoneBucket bucket100 = TestDataUtil
final OzoneBucket bucket100 = DataTestUtil
.createVolumeAndBucket(client, vol, buck,
omBucketArgs);
assertEquals(ReplicationType.STAND_ALONE.name(), bucket100.getReplicationConfig().getReplicationType().name());
Expand Down Expand Up @@ -1819,7 +1819,7 @@ void testBucketDefaultsShouldBeInheritedToFileForEC()
BucketArgs omBucketArgs = builder.build();
String vol = UUID.randomUUID().toString();
String buck = UUID.randomUUID().toString();
final OzoneBucket bucket101 = TestDataUtil
final OzoneBucket bucket101 = DataTestUtil
.createVolumeAndBucket(client, vol, buck,
omBucketArgs);
assertEquals(ReplicationType.EC.name(), bucket101.getReplicationConfig().getReplicationType().name());
Expand Down Expand Up @@ -1869,7 +1869,7 @@ void testCreateAndCheckECFileDiskUsage() throws Exception {
Path bucketPathTest = new Path(volPathTest, bucketName);

// write some test data into bucket
TestDataUtil.createKey(objectStore.getVolume(volumeName).
DataTestUtil.createKey(objectStore.getVolume(volumeName).
getBucket(bucketName), key, new ECReplicationConfig("RS-3-2-1024k"),
RandomUtils.secure().randomBytes(1));
// make sure the disk usage matches the expected value
Expand Down Expand Up @@ -1897,10 +1897,10 @@ void testContentSummaryErasureCodingPolicy() throws Exception {
OzoneBucket bucket = objectStore.getVolume(volumeName).getBucket(bucketName);
String ratisRelKey = "ec-policy-mixed/" + ratisKey;
String ecRelKey = "ec-policy-mixed/" + ecKey;
TestDataUtil.createKey(bucket, ratisRelKey,
DataTestUtil.createKey(bucket, ratisRelKey,
RatisReplicationConfig.getInstance(HddsProtos.ReplicationFactor.THREE),
new byte[]{0});
TestDataUtil.createKey(bucket, ecRelKey, ecConfig,
DataTestUtil.createKey(bucket, ecRelKey, ecConfig,
new byte[]{0});

try {
Expand Down Expand Up @@ -1942,7 +1942,7 @@ void testCreateAndCheckRatisFileDiskUsage() throws Exception {
Path filePathTest = new Path(bucketPathTest, key);

// write some test data into bucket
TestDataUtil.createKey(objectStore.
DataTestUtil.createKey(objectStore.
getVolume(volumeName).getBucket(bucketName), key,
RatisReplicationConfig.getInstance(HddsProtos.ReplicationFactor.THREE),
RandomUtils.secure().randomBytes(1));
Expand Down Expand Up @@ -2019,7 +2019,7 @@ private Path createAndGetBucketPath()
String vol = UUID.randomUUID().toString();
String buck = UUID.randomUUID().toString();
final OzoneBucket bucket =
TestDataUtil.createVolumeAndBucket(client, vol, buck, omBucketArgs);
DataTestUtil.createVolumeAndBucket(client, vol, buck, omBucketArgs);
Path volume = new Path(OZONE_URI_DELIMITER, bucket.getVolumeName());
return new Path(volume, bucket.getName());
}
Expand All @@ -2028,7 +2028,7 @@ private Path createAndGetBucketPath()
void testSnapshotRead() throws Exception {
// Init data
OzoneBucket bucket1 =
TestDataUtil.createVolumeAndBucket(client, bucketLayout);
DataTestUtil.createVolumeAndBucket(client, bucketLayout);
Path volume1Path = new Path(OZONE_URI_DELIMITER, bucket1.getVolumeName());
Path bucket1Path = new Path(volume1Path, bucket1.getName());
Path file1 = new Path(bucket1Path, "key1");
Expand All @@ -2038,7 +2038,7 @@ void testSnapshotRead() throws Exception {
ContractTestUtils.touch(fs, file2);

OzoneBucket bucket2 =
TestDataUtil.createVolumeAndBucket(client, bucketLayout);
DataTestUtil.createVolumeAndBucket(client, bucketLayout);
Path volume2Path = new Path(OZONE_URI_DELIMITER, bucket2.getVolumeName());
Path bucket2Path = new Path(volume2Path, bucket2.getName());

Expand Down Expand Up @@ -2071,7 +2071,7 @@ void testFileSystemDeclaresCapability() throws Throwable {
@Test
void testSnapshotDiff() throws Exception {
OzoneBucket bucket1 =
TestDataUtil.createVolumeAndBucket(client, bucketLayout);
DataTestUtil.createVolumeAndBucket(client, bucketLayout);
Path volumePath1 = new Path(OZONE_URI_DELIMITER, bucket1.getVolumeName());
Path bucketPath1 = new Path(volumePath1, bucket1.getName());
Path snap1 = fs.createSnapshot(bucketPath1);
Expand Down Expand Up @@ -2133,7 +2133,7 @@ void testSnapshotDiff() throws Exception {
@Test
void testSetTimes() throws Exception {
OzoneBucket bucket1 =
TestDataUtil.createVolumeAndBucket(client, bucketLayout);
DataTestUtil.createVolumeAndBucket(client, bucketLayout);
Path volumePath1 = new Path(OZONE_URI_DELIMITER, bucket1.getVolumeName());
Path bucketPath1 = new Path(volumePath1, bucket1.getName());
setTimes(bucketPath1);
Expand All @@ -2143,7 +2143,7 @@ void testSetTimes() throws Exception {
public void testSetTimesForLinkedBucketPath() throws Exception {
// Create a file
OzoneBucket sourceBucket =
TestDataUtil.createVolumeAndBucket(client, bucketLayout);
DataTestUtil.createVolumeAndBucket(client, bucketLayout);
Path volumePath1 =
new Path(OZONE_URI_DELIMITER, sourceBucket.getVolumeName());
Path sourceBucketPath = new Path(volumePath1, sourceBucket.getName());
Expand Down
Loading