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 @@ -17,6 +17,7 @@

package org.apache.hadoop.ozone.container.diskbalancer;

import static org.apache.hadoop.hdds.scm.ScmConfigKeys.HDDS_DATANODE_DIR_KEY;
import static org.apache.hadoop.ozone.container.common.impl.ContainerImplTestUtils.newContainerSet;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
Expand Down Expand Up @@ -106,6 +107,8 @@ private void setupVolumesAndContainer() throws IOException {
destVolume1 = createVolume("dest-volume1", 0.10);
destVolume2 = createVolume("dest-volume2", 0.50);

CONF.set(HDDS_DATANODE_DIR_KEY, baseDir.resolve("defaultVolume").toString());

// Create and spy on the volume set
String datanodeUuid = UUID.randomUUID().toString();
volumeSet = spy(new MutableVolumeSet(datanodeUuid, CONF, null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.apache.hadoop.ozone.container.diskbalancer;

import static org.apache.hadoop.hdds.scm.ScmConfigKeys.HDDS_DATANODE_DIR_KEY;
import static org.apache.hadoop.ozone.container.diskbalancer.DiskBalancerVolumeCalculation.getVolumeUsages;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
Expand Down Expand Up @@ -233,11 +234,9 @@ private List<HddsVolume> createVolumes(List<VolumeTestConfig> configs)
* @param volumes List of volumes to add to volume set
*/
private void setupVolumeSet(List<HddsVolume> volumes) throws IOException {
// Create volume set without any default volumes from configuration
// Use a clean configuration to avoid loading default volumes
OzoneConfiguration testConf = new OzoneConfiguration();
// Explicitly set HDDS_DATANODE_DIR_KEY to empty to prevent default volumes
testConf.set("hdds.datanode.dir.key", "");
testConf.set(HDDS_DATANODE_DIR_KEY, baseDir.resolve("defaultVolume").toString());
volumeSet = new MutableVolumeSet(datanodeUuid, testConf, null,
StorageVolume.VolumeType.DATA_VOLUME, null);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ private void initTests(Boolean enable) throws Exception {
private void setup() throws Exception {
address = SCMTestUtils.getReuseableAddress();
conf.setSocketAddr(ScmConfigKeys.OZONE_SCM_NAMES, address);
conf.set(ScmConfigKeys.HDDS_DATANODE_DIR_KEY,
tempFolder.resolve("data").toString());
conf.set(HddsConfigKeys.OZONE_METADATA_DIRS,
tempFolder.toString());
tempFolder.resolve("meta").toString());
}

@AfterEach
Expand Down