diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFsHAURLs.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFsHAURLs.java index e86e44f55b51..3ade5b62c3b9 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFsHAURLs.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFsHAURLs.java @@ -35,7 +35,6 @@ import org.apache.hadoop.ozone.client.OzoneVolume; import org.apache.hadoop.ozone.ha.ConfUtils; import org.apache.hadoop.ozone.om.OMConfigKeys; -import org.apache.hadoop.ozone.om.OMStorage; import org.apache.hadoop.ozone.om.OzoneManager; import org.apache.hadoop.ozone.om.helpers.BucketLayout; import org.apache.ozone.test.GenericTestUtils; @@ -46,12 +45,13 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; +import org.junit.jupiter.api.io.TempDir; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.File; import java.util.Optional; import java.util.OptionalInt; -import java.util.UUID; import static org.apache.hadoop.hdds.HddsUtils.getHostName; import static org.apache.hadoop.hdds.HddsUtils.getHostPort; @@ -73,10 +73,7 @@ public class TestOzoneFsHAURLs { private OzoneConfiguration conf; private static MiniOzoneCluster cluster; - private static String omId; private static String omServiceId; - private static String clusterId; - private static String scmId; private static OzoneManager om; private static int numOfOMs; @@ -98,33 +95,21 @@ public class TestOzoneFsHAURLs { @BeforeAll - public static void initClass() throws Exception { + static void initClass(@TempDir File tempDir) throws Exception { OzoneConfiguration conf = new OzoneConfiguration(); - omId = UUID.randomUUID().toString(); omServiceId = "om-service-test1"; numOfOMs = 3; - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); - final String path = GenericTestUtils.getTempPath(omId); - java.nio.file.Path metaDirPath = java.nio.file.Paths.get(path, "om-meta"); - conf.set(HddsConfigKeys.OZONE_METADATA_DIRS, metaDirPath.toString()); + conf.set(HddsConfigKeys.OZONE_METADATA_DIRS, tempDir.getAbsolutePath()); conf.setInt(ScmConfigKeys.OZONE_DATANODE_PIPELINE_LIMIT, 3); conf.set(OMConfigKeys.OZONE_DEFAULT_BUCKET_LAYOUT, BucketLayout.LEGACY.name()); conf.setBoolean(OMConfigKeys.OZONE_OM_ENABLE_FILESYSTEM_PATHS, true); - OMStorage omStore = new OMStorage(conf); - omStore.setClusterId(clusterId); - // writes the version file properties - omStore.initialize(); - // Start the cluster cluster = MiniOzoneCluster.newOMHABuilder(conf) .setNumDatanodes(5) .setTotalPipelineNumLimit(3) - .setClusterId(clusterId) - .setScmId(scmId) .setOMServiceId(omServiceId) .setNumOfOzoneManagers(numOfOMs) .build(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFsSnapshot.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFsSnapshot.java index 6d537d03ca13..ae6a24a910cf 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFsSnapshot.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFsSnapshot.java @@ -24,7 +24,6 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.UUID; import java.util.stream.Stream; import org.apache.commons.io.FileUtils; @@ -88,8 +87,6 @@ static void initClass() throws Exception { // Start the cluster cluster = MiniOzoneCluster.newOMHABuilder(conf) - .setClusterId(UUID.randomUUID().toString()) - .setScmId(UUID.randomUUID().toString()) .setOMServiceId(OM_SERVICE_ID) .setNumOfOzoneManagers(1) .build(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestFailoverWithSCMHA.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestFailoverWithSCMHA.java index 95d9f52b4c18..688d13ad361b 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestFailoverWithSCMHA.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestFailoverWithSCMHA.java @@ -48,7 +48,6 @@ import java.io.IOException; import java.util.Map; -import java.util.UUID; import java.util.concurrent.TimeoutException; import static org.apache.hadoop.hdds.protocol.proto.HddsProtos.ContainerBalancerConfigurationProto; @@ -65,8 +64,6 @@ public class TestFailoverWithSCMHA { private MiniOzoneHAClusterImpl cluster = null; private OzoneConfiguration conf; - private String clusterId; - private String scmId; private String omServiceId; private String scmServiceId; private int numOfOMs = 1; @@ -82,15 +79,13 @@ public class TestFailoverWithSCMHA { @BeforeEach public void init() throws Exception { conf = new OzoneConfiguration(); - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); omServiceId = "om-service-test1"; scmServiceId = "scm-service-test1"; conf.setLong(ScmConfigKeys.OZONE_SCM_HA_RATIS_SNAPSHOT_THRESHOLD, SNAPSHOT_THRESHOLD); cluster = (MiniOzoneHAClusterImpl) MiniOzoneCluster.newHABuilder(conf) - .setClusterId(clusterId).setScmId(scmId).setOMServiceId(omServiceId) + .setOMServiceId(omServiceId) .setSCMServiceId(scmServiceId).setNumOfOzoneManagers(numOfOMs) .setNumOfStorageContainerManagers(numOfSCMs).setNumOfActiveSCMs(3) .build(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMDbCheckpointServlet.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMDbCheckpointServlet.java index a545e392182a..6b5b1aedcda9 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMDbCheckpointServlet.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMDbCheckpointServlet.java @@ -34,7 +34,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import java.util.UUID; import java.util.stream.Stream; import org.apache.hadoop.hdds.conf.OzoneConfiguration; @@ -81,9 +80,6 @@ public class TestSCMDbCheckpointServlet { private StorageContainerManager scm; private SCMMetrics scmMetrics; private OzoneConfiguration conf; - private String clusterId; - private String scmId; - private String omId; private HttpServletRequest requestMock; private HttpServletResponse responseMock; private String method; @@ -100,14 +96,8 @@ public class TestSCMDbCheckpointServlet { @BeforeEach public void init() throws Exception { conf = new OzoneConfiguration(); - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); - omId = UUID.randomUUID().toString(); conf.setBoolean(OZONE_ACL_ENABLED, true); cluster = MiniOzoneCluster.newBuilder(conf) - .setClusterId(clusterId) - .setScmId(scmId) - .setOmId(omId) .build(); cluster.waitForClusterToBeReady(); scm = cluster.getStorageContainerManager(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMInstallSnapshotWithHA.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMInstallSnapshotWithHA.java index 0fbf05fb5837..0aa2599637a9 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMInstallSnapshotWithHA.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMInstallSnapshotWithHA.java @@ -22,7 +22,6 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import java.util.UUID; import java.util.concurrent.TimeoutException; import org.apache.commons.io.FileUtils; @@ -71,8 +70,6 @@ public class TestSCMInstallSnapshotWithHA { private MiniOzoneHAClusterImpl cluster = null; private OzoneConfiguration conf; - private String clusterId; - private String scmId; private String omServiceId; private String scmServiceId; private int numOfOMs = 1; @@ -89,8 +86,6 @@ public class TestSCMInstallSnapshotWithHA { @BeforeEach public void init() throws Exception { conf = new OzoneConfiguration(); - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); omServiceId = "om-service-test1"; scmServiceId = "scm-service-test1"; @@ -100,8 +95,6 @@ public void init() throws Exception { SNAPSHOT_THRESHOLD); cluster = (MiniOzoneHAClusterImpl) MiniOzoneCluster.newHABuilder(conf) - .setClusterId(clusterId) - .setScmId(scmId) .setOMServiceId(omServiceId) .setSCMServiceId(scmServiceId) .setNumOfOzoneManagers(numOfOMs) diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMSnapshot.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMSnapshot.java index 6dcce0f52f18..0375d83baaf8 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMSnapshot.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMSnapshot.java @@ -29,8 +29,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.util.UUID; - import static org.apache.hadoop.hdds.protocol.proto.HddsProtos.ReplicationFactor.ONE; import static org.apache.hadoop.hdds.protocol.proto.HddsProtos.ReplicationFactor.THREE; import static org.assertj.core.api.Assertions.assertThat; @@ -52,7 +50,6 @@ public static void setup() throws Exception { cluster = MiniOzoneCluster .newBuilder(conf) .setNumDatanodes(3) - .setScmId(UUID.randomUUID().toString()) .build(); cluster.waitForClusterToBeReady(); } diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSecretKeySnapshot.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSecretKeySnapshot.java index 755d074a18e6..f7a3aa9c9b7b 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSecretKeySnapshot.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSecretKeySnapshot.java @@ -47,7 +47,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Properties; -import java.util.UUID; import java.util.concurrent.TimeoutException; import static org.apache.hadoop.fs.CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHENTICATION; @@ -96,8 +95,6 @@ public final class TestSecretKeySnapshot { private File ozoneKeytab; private File spnegoKeytab; private String host; - private String clusterId; - private String scmId; private MiniOzoneHAClusterImpl cluster; @BeforeEach @@ -107,9 +104,6 @@ public void init() throws Exception { ExitUtils.disableSystemExit(); - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); - startMiniKdc(); setSecureConfig(); createCredentialsInKDC(); @@ -125,9 +119,7 @@ public void init() throws Exception { conf.set(HDDS_SECRET_KEY_EXPIRY_DURATION, EXPIRY_DURATION_MS + "ms"); MiniOzoneCluster.Builder builder = MiniOzoneCluster.newHABuilder(conf) - .setClusterId(clusterId) .setSCMServiceId("TestSecretKeySnapshot") - .setScmId(scmId) .setSCMServiceId("SCMServiceId") .setNumDatanodes(1) .setNumOfStorageContainerManagers(3) diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSecretKeysApi.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSecretKeysApi.java index 26c3fc2f7a07..eb2442cd0988 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSecretKeysApi.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSecretKeysApi.java @@ -99,8 +99,6 @@ public final class TestSecretKeysApi { private File testUserKeytab; private String testUserPrincipal; private String ozonePrincipal; - private String clusterId; - private String scmId; private MiniOzoneHAClusterImpl cluster; @BeforeEach @@ -111,9 +109,6 @@ public void init() throws Exception { ExitUtils.disableSystemExit(); ExitUtil.disableSystemExit(); - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); - startMiniKdc(); setSecureConfig(); createCredentialsInKDC(); @@ -332,9 +327,7 @@ private void startCluster(int numSCMs) throws IOException, TimeoutException, InterruptedException { OzoneManager.setTestSecureOmFlag(true); MiniOzoneCluster.Builder builder = MiniOzoneCluster.newHABuilder(conf) - .setClusterId(clusterId) .setSCMServiceId("TestSecretKey") - .setScmId(scmId) .setNumDatanodes(3) .setNumOfStorageContainerManagers(numSCMs) .setNumOfOzoneManagers(1); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestStorageContainerManager.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestStorageContainerManager.java index cf43ffcc22f3..8626bd037867 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestStorageContainerManager.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestStorageContainerManager.java @@ -374,7 +374,7 @@ public void testOldDNRegistersToReInitialisedSCM() throws Exception { MiniOzoneCluster cluster = MiniOzoneCluster.newBuilder(conf).setHbInterval(1000) .setHbProcessorInterval(3000).setNumDatanodes(1) - .setClusterId(UUID.randomUUID().toString()).build(); + .build(); cluster.waitForClusterToBeReady(); try { @@ -776,7 +776,6 @@ public void testScmInfo() throws Exception { @Test public void testScmProcessDatanodeHeartbeat() throws Exception { OzoneConfiguration conf = new OzoneConfiguration(); - String scmId = UUID.randomUUID().toString(); conf.setClass(NET_TOPOLOGY_NODE_SWITCH_MAPPING_IMPL_KEY, StaticMapping.class, DNSToSwitchMapping.class); StaticMapping.addNodeToRack(NetUtils.normalizeHostNames( @@ -786,7 +785,6 @@ public void testScmProcessDatanodeHeartbeat() throws Exception { final int datanodeNum = 3; MiniOzoneCluster cluster = MiniOzoneCluster.newBuilder(conf) .setNumDatanodes(datanodeNum) - .setScmId(scmId) .build(); cluster.waitForClusterToBeReady(); StorageContainerManager scm = cluster.getStorageContainerManager(); @@ -1062,10 +1060,7 @@ public void testNonRatisToRatis() throws IOException, AuthenticationException, InterruptedException, TimeoutException { final OzoneConfiguration conf = new OzoneConfiguration(); - final String clusterID = UUID.randomUUID().toString(); try (MiniOzoneCluster cluster = MiniOzoneCluster.newBuilder(conf) - .setClusterId(clusterID) - .setScmId(UUID.randomUUID().toString()) .setNumDatanodes(3) .build()) { final StorageContainerManager nonRatisSCM = cluster @@ -1077,7 +1072,7 @@ public void testNonRatisToRatis() DefaultConfigManager.clearDefaultConfigs(); conf.setBoolean(ScmConfigKeys.OZONE_SCM_HA_ENABLE_KEY, true); - StorageContainerManager.scmInit(conf, clusterID); + StorageContainerManager.scmInit(conf, cluster.getClusterId()); cluster.restartStorageContainerManager(false); final StorageContainerManager ratisSCM = cluster diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestStorageContainerManagerHA.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestStorageContainerManagerHA.java index c2703e43227d..e62820cfb1d0 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestStorageContainerManagerHA.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestStorageContainerManagerHA.java @@ -74,8 +74,6 @@ public class TestStorageContainerManagerHA { private MiniOzoneHAClusterImpl cluster = null; private OzoneConfiguration conf; - private String clusterId; - private String scmId; private String omServiceId; private static int numOfOMs = 3; private String scmServiceId; @@ -95,13 +93,9 @@ public void init() throws Exception { conf.set(ScmConfigKeys.OZONE_SCM_HA_DBTRANSACTIONBUFFER_FLUSH_INTERVAL, "5s"); conf.set(ScmConfigKeys.OZONE_SCM_HA_RATIS_SNAPSHOT_GAP, "1"); - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); omServiceId = "om-service-test1"; scmServiceId = "scm-service-test1"; cluster = (MiniOzoneHAClusterImpl) MiniOzoneCluster.newHABuilder(conf) - .setClusterId(clusterId) - .setScmId(scmId) .setOMServiceId(omServiceId) .setSCMServiceId(scmServiceId) .setNumOfStorageContainerManagers(numOfSCMs) diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/storage/TestContainerCommandsEC.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/storage/TestContainerCommandsEC.java index 2e90975258ed..3c980f94c59c 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/storage/TestContainerCommandsEC.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/storage/TestContainerCommandsEC.java @@ -130,8 +130,6 @@ public class TestContainerCommandsEC { private static ObjectStore store; private static StorageContainerLocationProtocolClientSideTranslatorPB storageContainerLocationClient; - private static final String SCM_ID = UUID.randomUUID().toString(); - private static final String CLUSTER_ID = UUID.randomUUID().toString(); private static final int EC_DATA = 3; private static final int EC_PARITY = 2; private static final EcCodec EC_CODEC = EcCodec.RS; @@ -926,7 +924,6 @@ public static void startCluster(OzoneConfiguration conf) throws Exception { secretKeyClient = new SecretKeyTestClient(); cluster = MiniOzoneCluster.newBuilder(conf).setNumDatanodes(NUM_DN) - .setScmId(SCM_ID).setClusterId(CLUSTER_ID) .setCertificateClient(certClient) .setSecretKeyClient(secretKeyClient) .build(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/utils/db/managed/TestRocksObjectLeakDetector.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/utils/db/managed/TestRocksObjectLeakDetector.java index 62912ad4aab8..4197ac8a8165 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/utils/db/managed/TestRocksObjectLeakDetector.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/utils/db/managed/TestRocksObjectLeakDetector.java @@ -27,7 +27,6 @@ import org.junit.jupiter.api.Test; import java.io.IOException; -import java.util.UUID; import java.util.concurrent.TimeoutException; import java.util.function.Supplier; @@ -51,12 +50,8 @@ static void setUp() throws IOException, InterruptedException, TimeoutException { OzoneConfiguration conf = new OzoneConfiguration(); conf.set(OZONE_METADATA_STORE_ROCKSDB_STATISTICS, "ALL"); - String clusterId = UUID.randomUUID().toString(); - String scmId = UUID.randomUUID().toString(); String omServiceId = "omServiceId1"; cluster = MiniOzoneCluster.newBuilder(conf) - .setClusterId(clusterId) - .setScmId(scmId) .setOMServiceId(omServiceId) .setNumOfOzoneManagers(1) .build(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneCluster.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneCluster.java index 458a0ca891fd..d625bf797b7d 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneCluster.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneCluster.java @@ -322,10 +322,9 @@ abstract class Builder { protected Optional enableTrace = Optional.of(false); protected Optional hbInterval = Optional.empty(); protected Optional hbProcessorInterval = Optional.empty(); - protected Optional scmId = Optional.empty(); - protected Optional omId = Optional.empty(); + protected String scmId = UUID.randomUUID().toString(); + protected String omId = UUID.randomUUID().toString(); - protected Boolean enableContainerDatastream = true; protected Optional datanodeReservedSpace = Optional.empty(); protected Optional chunkSize = Optional.empty(); protected OptionalInt streamBufferSize = OptionalInt.empty(); @@ -343,9 +342,6 @@ abstract class Builder { protected Optional scmLayoutVersion = Optional.empty(); protected Optional dnLayoutVersion = Optional.empty(); - // Use relative smaller number of handlers for testing - protected int numOfOmHandlers = 20; - protected int numOfScmHandlers = 20; protected int numOfDatanodes = 3; protected int numDataVolumes = 1; protected boolean startDataNodes = true; @@ -375,14 +371,11 @@ public Builder setSCMConfigurator(SCMConfigurator configurator) { * Sets the cluster Id. * * @param id cluster Id - * - * @return MiniOzoneCluster.Builder */ - public Builder setClusterId(String id) { + void setClusterId(String id) { clusterId = id; path = GenericTestUtils.getTempPath( MiniOzoneClusterImpl.class.getSimpleName() + "-" + clusterId); - return this; } /** @@ -418,30 +411,6 @@ public Builder setSecretKeyClient(SecretKeyClient client) { return this; } - /** - * Sets the SCM id. - * - * @param id SCM Id - * - * @return MiniOzoneCluster.Builder - */ - public Builder setScmId(String id) { - scmId = Optional.of(id); - return this; - } - - /** - * Sets the OM id. - * - * @param id OM Id - * - * @return MiniOzoneCluster.Builder - */ - public Builder setOmId(String id) { - omId = Optional.of(id); - return this; - } - /** * Sets the number of HddsDatanodes to be started as part of * MiniOzoneCluster. @@ -543,11 +512,6 @@ public Builder setChunkSize(int size) { return this; } - public Builder setStreamBufferSize(int size) { - streamBufferSize = OptionalInt.of(size); - return this; - } - /** * Sets the flush size for stream buffer. * diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneClusterImpl.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneClusterImpl.java index 24a3ff84f1cf..fa22b30cad6f 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneClusterImpl.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneClusterImpl.java @@ -764,10 +764,7 @@ protected void initializeScmStorage(SCMStorageConfig scmStore) return; } scmStore.setClusterId(clusterId); - if (!scmId.isPresent()) { - scmId = Optional.of(UUID.randomUUID().toString()); - } - scmStore.setScmId(scmId.get()); + scmStore.setScmId(scmId); scmStore.initialize(); //TODO: HDDS-6897 //Disabling Ratis for only of MiniOzoneClusterImpl. @@ -777,7 +774,7 @@ protected void initializeScmStorage(SCMStorageConfig scmStore) && SCMHAUtils.isSCMHAEnabled(conf)) { scmStore.setSCMHAFlag(true); scmStore.persistCurrentState(); - SCMRatisServerImpl.initialize(clusterId, scmId.get(), + SCMRatisServerImpl.initialize(clusterId, scmId, SCMHANodeDetails.loadSCMHAConfig(conf, scmStore) .getLocalNodeDetails(), conf); } @@ -788,10 +785,10 @@ void initializeOmStorage(OMStorage omStorage) throws IOException { return; } omStorage.setClusterId(clusterId); - omStorage.setOmId(omId.orElse(UUID.randomUUID().toString())); + omStorage.setOmId(omId); // Initialize ozone certificate client if security is enabled. if (OzoneSecurityUtil.isSecurityEnabled(conf)) { - OzoneManager.initializeSecurity(conf, omStorage, scmId.get()); + OzoneManager.initializeSecurity(conf, omStorage, scmId); } omStorage.initialize(); } @@ -838,7 +835,6 @@ protected String getSCMAddresses(List scms) { protected List createHddsDatanodes( List scms, ReconServer reconServer) throws IOException { - configureHddsDatanodes(); String scmAddress = getSCMAddresses(scms); String[] args = new String[] {}; conf.setStrings(ScmConfigKeys.OZONE_SCM_NAMES, scmAddress); @@ -909,7 +905,6 @@ protected void configureSCM() { localhostWithFreePort()); conf.set(ScmConfigKeys.OZONE_SCM_HTTP_ADDRESS_KEY, localhostWithFreePort()); - conf.setInt(ScmConfigKeys.OZONE_SCM_HANDLER_COUNT_KEY, numOfScmHandlers); conf.set(HddsConfigKeys.HDDS_SCM_WAIT_TIME_AFTER_SAFE_MODE_EXIT, "3s"); configureSCMheartbeat(); @@ -944,12 +939,6 @@ private void configureOM() { conf.set(OMConfigKeys.OZONE_OM_HTTPS_ADDRESS_KEY, localhostWithFreePort()); conf.setInt(OMConfigKeys.OZONE_OM_RATIS_PORT_KEY, getFreePort()); - conf.setInt(OMConfigKeys.OZONE_OM_HANDLER_COUNT_KEY, numOfOmHandlers); - } - - private void configureHddsDatanodes() { - conf.setBoolean(OzoneConfigKeys.DFS_CONTAINER_RATIS_DATASTREAM_ENABLED, - enableContainerDatastream); } protected void configureDatanodePorts(ConfigurationTarget conf) { diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneHAClusterImpl.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneHAClusterImpl.java index 9d09ac43ebe1..797a7515f206 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneHAClusterImpl.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneHAClusterImpl.java @@ -427,7 +427,6 @@ public MiniOzoneCluster build() throws IOException { protected void initOMRatisConf() { conf.setBoolean(OMConfigKeys.OZONE_OM_RATIS_ENABLE_KEY, true); - conf.setInt(OMConfigKeys.OZONE_OM_HANDLER_COUNT_KEY, numOfOmHandlers); // If test change the following config values we will respect, // otherwise we will set lower timeout values. diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestBlockTokens.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestBlockTokens.java index 9cf4f53a68f8..a04c1236186c 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestBlockTokens.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestBlockTokens.java @@ -116,8 +116,6 @@ public final class TestBlockTokens { private static File testUserKeytab; private static String testUserPrincipal; private static String host; - private static String clusterId; - private static String scmId; private static MiniOzoneHAClusterImpl cluster; private static OzoneClient client; private static BlockInputStreamFactory blockInputStreamFactory = @@ -132,8 +130,6 @@ public static void init() throws Exception { workDir = GenericTestUtils.getTestDir(TestBlockTokens.class.getSimpleName()); - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); startMiniKdc(); setSecureConfig(); @@ -383,9 +379,7 @@ private static void startCluster() throws IOException, TimeoutException, InterruptedException { OzoneManager.setTestSecureOmFlag(true); MiniOzoneCluster.Builder builder = MiniOzoneCluster.newHABuilder(conf) - .setClusterId(clusterId) .setSCMServiceId("TestSecretKey") - .setScmId(scmId) .setNumDatanodes(3) .setNumOfStorageContainerManagers(3) .setNumOfOzoneManagers(1); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestBlockTokensCLI.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestBlockTokensCLI.java index 53356087e696..a181a6f45e95 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestBlockTokensCLI.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestBlockTokensCLI.java @@ -47,7 +47,6 @@ import java.time.Instant; import java.util.Map; import java.util.Properties; -import java.util.UUID; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; @@ -94,8 +93,6 @@ public final class TestBlockTokensCLI { private static File ozoneKeytab; private static File spnegoKeytab; private static String host; - private static String clusterId; - private static String scmId; private static String omServiceId; private static String scmServiceId; private static MiniOzoneHAClusterImpl cluster; @@ -110,8 +107,6 @@ public static void init() throws Exception { workDir = GenericTestUtils.getTestDir(TestBlockTokens.class.getSimpleName()); - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); omServiceId = "om-service-test"; scmServiceId = "scm-service-test"; @@ -324,10 +319,8 @@ private static void startCluster() throws IOException, TimeoutException, InterruptedException { OzoneManager.setTestSecureOmFlag(true); MiniOzoneCluster.Builder builder = MiniOzoneCluster.newHABuilder(conf) - .setClusterId(clusterId) .setSCMServiceId(scmServiceId) .setOMServiceId(omServiceId) - .setScmId(scmId) .setNumDatanodes(3) .setNumOfStorageContainerManagers(3) .setNumOfOzoneManagers(3); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestMiniOzoneOMHACluster.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestMiniOzoneOMHACluster.java index 76a304086b71..0c51ba41311c 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestMiniOzoneOMHACluster.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestMiniOzoneOMHACluster.java @@ -22,7 +22,6 @@ import org.apache.hadoop.ozone.om.OzoneManager; import org.apache.ozone.test.GenericTestUtils; -import java.util.UUID; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicReference; @@ -45,8 +44,6 @@ public class TestMiniOzoneOMHACluster { private MiniOzoneHAClusterImpl cluster = null; private OzoneConfiguration conf; - private String clusterId; - private String scmId; private String omServiceId; private int numOfOMs = 3; @@ -58,15 +55,11 @@ public class TestMiniOzoneOMHACluster { @BeforeEach public void init() throws Exception { conf = new OzoneConfiguration(); - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); omServiceId = "omServiceId1"; conf.setBoolean(OZONE_ACL_ENABLED, true); conf.set(OzoneConfigKeys.OZONE_ADMINISTRATORS, OZONE_ADMINISTRATORS_WILDCARD); cluster = (MiniOzoneHAClusterImpl) MiniOzoneCluster.newOMHABuilder(conf) - .setClusterId(clusterId) - .setScmId(scmId) .setOMServiceId(omServiceId) .setNumOfOzoneManagers(numOfOMs) .build(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestMultipartObjectGet.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestMultipartObjectGet.java index c2e671b896e6..852f351ee25a 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestMultipartObjectGet.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestMultipartObjectGet.java @@ -43,7 +43,6 @@ import java.io.IOException; import java.io.ByteArrayInputStream; import java.util.ArrayList; -import java.util.UUID; import java.util.List; import java.util.Base64; import java.util.concurrent.TimeoutException; @@ -64,8 +63,6 @@ public class TestMultipartObjectGet { public static final Logger LOG = LoggerFactory.getLogger( TestMultipartObjectGet.class); private static OzoneConfiguration conf; - private static String clusterId; - private static String scmId; private static String omServiceId; private static String scmServiceId; private static final String BUCKET = OzoneConsts.BUCKET; @@ -80,8 +77,6 @@ public class TestMultipartObjectGet { @BeforeAll public static void init() throws Exception { conf = new OzoneConfiguration(); - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); omServiceId = "om-service-test"; scmServiceId = "scm-service-test"; @@ -109,10 +104,8 @@ private static void startCluster() throws IOException, TimeoutException, InterruptedException { OzoneManager.setTestSecureOmFlag(true); MiniOzoneCluster.Builder builder = MiniOzoneCluster.newHABuilder(conf) - .setClusterId(clusterId) .setSCMServiceId(scmServiceId) .setOMServiceId(omServiceId) - .setScmId(scmId) .setNumDatanodes(3) .setNumOfStorageContainerManagers(3) .setNumOfOzoneManagers(3); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/TestOzoneClientFactory.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/TestOzoneClientFactory.java index 666161bcf1bc..f2a079ca80ca 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/TestOzoneClientFactory.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/TestOzoneClientFactory.java @@ -26,16 +26,12 @@ import java.io.IOException; import java.security.PrivilegedExceptionAction; -import java.util.UUID; /** * Test implementation for OzoneClientFactory. */ public class TestOzoneClientFactory { - private static String scmId = UUID.randomUUID().toString(); - private static String clusterId = UUID.randomUUID().toString(); - @Test public void testRemoteException() { @@ -44,8 +40,6 @@ public void testRemoteException() { MiniOzoneCluster cluster = MiniOzoneCluster.newBuilder(conf) .setNumDatanodes(3) .setTotalPipelineNumLimit(10) - .setScmId(scmId) - .setClusterId(clusterId) .build(); String omPort = cluster.getOzoneManager().getRpcPort(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneAtRestEncryption.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneAtRestEncryption.java index 08df9c941144..bc328d531535 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneAtRestEncryption.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneAtRestEncryption.java @@ -108,8 +108,6 @@ class TestOzoneAtRestEncryption { private static StorageContainerLocationProtocolClientSideTranslatorPB storageContainerLocationClient; - private static final String SCM_ID = UUID.randomUUID().toString(); - private static final String CLUSTER_ID = UUID.randomUUID().toString(); private static File testDir; private static OzoneConfiguration conf; private static final String TEST_KEY = "key1"; @@ -144,8 +142,6 @@ static void init() throws Exception { new CertificateClientTestImpl(conf); cluster = MiniOzoneCluster.newBuilder(conf) .setNumDatanodes(10) - .setScmId(SCM_ID) - .setClusterId(CLUSTER_ID) .setBlockSize(BLOCK_SIZE) .setChunkSize(CHUNK_SIZE) .setStreamBufferSizeUnit(StorageUnit.BYTES) @@ -166,7 +162,6 @@ static void init() throws Exception { TestOzoneRpcClient.setStorageContainerLocationClient( storageContainerLocationClient); TestOzoneRpcClient.setStore(store); - TestOzoneRpcClient.setClusterId(CLUSTER_ID); // create test key createKey(TEST_KEY, cluster.getOzoneManager().getKmsProvider(), conf); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneClientMultipartUploadWithFSO.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneClientMultipartUploadWithFSO.java index 027af41319f7..a89e61769966 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneClientMultipartUploadWithFSO.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneClientMultipartUploadWithFSO.java @@ -98,7 +98,6 @@ public class TestOzoneClientMultipartUploadWithFSO { private static MiniOzoneCluster cluster = null; private static OzoneClient ozClient = null; - private static String scmId = UUID.randomUUID().toString(); private String volumeName; private String bucketName; private String keyName; @@ -137,7 +136,6 @@ static void startCluster(OzoneConfiguration conf) throws Exception { cluster = MiniOzoneCluster.newBuilder(conf) .setNumDatanodes(5) .setTotalPipelineNumLimit(10) - .setScmId(scmId) .build(); cluster.waitForClusterToBeReady(); ozClient = OzoneClientFactory.getRpcClient(conf); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClientAbstract.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClientAbstract.java index c2f1eb069cfc..7682138bbb84 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClientAbstract.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClientAbstract.java @@ -194,10 +194,6 @@ public abstract class TestOzoneRpcClientAbstract { private static OzoneAcl inheritedGroupAcl = new OzoneAcl(GROUP, remoteGroupName, READ, ACCESS); - private static String scmId = UUID.randomUUID().toString(); - private static String clusterId; - - /** * Create a MiniOzoneCluster for testing. * @param conf Configurations to start the cluster. @@ -206,13 +202,10 @@ public abstract class TestOzoneRpcClientAbstract { static void startCluster(OzoneConfiguration conf) throws Exception { // Reduce long wait time in MiniOzoneClusterImpl#waitForHddsDatanodesStop // for testZReadKeyWithUnhealthyContainerReplica. - clusterId = UUID.randomUUID().toString(); conf.set("ozone.scm.stale.node.interval", "10s"); cluster = MiniOzoneCluster.newBuilder(conf) .setNumDatanodes(14) .setTotalPipelineNumLimit(10) - .setScmId(scmId) - .setClusterId(clusterId) .setDataStreamMinPacketSize(1) // 1MB .build(); cluster.waitForClusterToBeReady(); @@ -267,10 +260,6 @@ public static ObjectStore getStore() { return TestOzoneRpcClientAbstract.store; } - public static void setClusterId(String clusterId) { - TestOzoneRpcClientAbstract.clusterId = clusterId; - } - public static OzoneClient getClient() { return TestOzoneRpcClientAbstract.ozClient; } @@ -2115,7 +2104,7 @@ private void corruptData(Container container, OzoneKey key) String containreBaseDir = container.getContainerData().getVolume().getHddsRootDir().getPath(); File chunksLocationPath = KeyValueContainerLocationUtil - .getChunksLocationPath(containreBaseDir, clusterId, containerID); + .getChunksLocationPath(containreBaseDir, cluster.getClusterId(), containerID); byte[] corruptData = "corrupted data".getBytes(UTF_8); // Corrupt the contents of chunk files for (File file : FileUtils.listFiles(chunksLocationPath, null, false)) { diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClientForAclAuditLog.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClientForAclAuditLog.java index a830c8c739d8..e373b06d950c 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClientForAclAuditLog.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClientForAclAuditLog.java @@ -51,7 +51,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import java.util.UUID; import static org.apache.hadoop.ozone.OzoneAcl.AclScope.ACCESS; import static org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_ACL_AUTHORIZER_CLASS; @@ -94,8 +93,6 @@ public class TestOzoneRpcClientForAclAuditLog { private static ObjectStore store = null; private static StorageContainerLocationProtocolClientSideTranslatorPB storageContainerLocationClient; - private static String scmId = UUID.randomUUID().toString(); - /** * Create a MiniOzoneCluster for testing. @@ -127,7 +124,6 @@ public static void init() throws Exception { private static void startCluster(OzoneConfiguration conf) throws Exception { cluster = MiniOzoneCluster.newBuilder(conf) .setNumDatanodes(3) - .setScmId(scmId) .build(); cluster.waitForClusterToBeReady(); ozClient = OzoneClientFactory.getRpcClient(conf); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestSecureOzoneRpcClient.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestSecureOzoneRpcClient.java index 38044805f3b4..0f69245a6d30 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestSecureOzoneRpcClient.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestSecureOzoneRpcClient.java @@ -95,8 +95,6 @@ public class TestSecureOzoneRpcClient extends TestOzoneRpcClient { private static StorageContainerLocationProtocolClientSideTranslatorPB storageContainerLocationClient; - private static final String SCM_ID = UUID.randomUUID().toString(); - private static final String CLUSTER_ID = UUID.randomUUID().toString(); private static File testDir; private static OzoneConfiguration conf; @@ -129,8 +127,6 @@ public static void init() throws Exception { OMConfigKeys.OZONE_BUCKET_LAYOUT_OBJECT_STORE); cluster = MiniOzoneCluster.newBuilder(conf) .setNumDatanodes(14) - .setScmId(SCM_ID) - .setClusterId(CLUSTER_ID) .setCertificateClient(certificateClientTest) .setSecretKeyClient(new SecretKeyTestClient()) .build(); @@ -147,7 +143,6 @@ public static void init() throws Exception { TestOzoneRpcClient.setStorageContainerLocationClient( storageContainerLocationClient); TestOzoneRpcClient.setStore(store); - TestOzoneRpcClient.setClusterId(CLUSTER_ID); } /** diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/metrics/TestDatanodeQueueMetrics.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/metrics/TestDatanodeQueueMetrics.java index b3f3030d70ad..a1d436b3360a 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/metrics/TestDatanodeQueueMetrics.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/metrics/TestDatanodeQueueMetrics.java @@ -30,7 +30,6 @@ import org.slf4j.LoggerFactory; import java.io.IOException; -import java.util.UUID; import static org.apache.commons.text.WordUtils.capitalize; import static org.apache.hadoop.ozone.container.common.statemachine.DatanodeQueueMetrics.COMMAND_DISPATCHER_QUEUE_PREFIX; @@ -47,8 +46,6 @@ public class TestDatanodeQueueMetrics { private MiniOzoneHAClusterImpl cluster = null; private OzoneConfiguration conf; - private String clusterId; - private String scmId; private String omServiceId; private static int numOfOMs = 3; private String scmServiceId; @@ -68,13 +65,9 @@ public class TestDatanodeQueueMetrics { public void init() throws Exception { conf = new OzoneConfiguration(); conf.set(ScmConfigKeys.OZONE_SCM_PIPELINE_CREATION_INTERVAL, "10s"); - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); omServiceId = "om-service-test1"; scmServiceId = "scm-service-test1"; cluster = (MiniOzoneHAClusterImpl) MiniOzoneCluster.newHABuilder(conf) - .setClusterId(clusterId) - .setScmId(scmId) .setOMServiceId(omServiceId) .setSCMServiceId(scmServiceId) .setNumOfStorageContainerManagers(numOfSCMs) diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/server/TestContainerServer.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/server/TestContainerServer.java index 2e3cefb94fe7..3c89bb12ee7a 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/server/TestContainerServer.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/server/TestContainerServer.java @@ -89,6 +89,7 @@ public class TestContainerServer { public static void setup() { DefaultMetricsSystem.setMiniClusterMode(true); CONF.set(HddsConfigKeys.HDDS_METADATA_DIR_NAME, TEST_DIR); + CONF.setBoolean(OzoneConfigKeys.DFS_CONTAINER_RATIS_DATASTREAM_ENABLED, false); DatanodeDetails dn = MockDatanodeDetails.randomDatanodeDetails(); caClient = new DNCertificateClient(new SecurityConfig(CONF), null, dn, null, null, null); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/debug/TestLeaseRecoverer.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/debug/TestLeaseRecoverer.java index f35506eccd5d..dbb354eccfd2 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/debug/TestLeaseRecoverer.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/debug/TestLeaseRecoverer.java @@ -19,7 +19,6 @@ import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; -import java.util.UUID; import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.TimeUnit; @@ -70,12 +69,8 @@ public class TestLeaseRecoverer { public static void init() throws Exception { conf = new OzoneConfiguration(); conf.setBoolean(OzoneConfigKeys.OZONE_FS_HSYNC_ENABLED, true); - String clusterId = UUID.randomUUID().toString(); - String scmId = UUID.randomUUID().toString(); - String omId = UUID.randomUUID().toString(); // Set the number of keys to be processed during batch operate. - cluster = MiniOzoneCluster.newBuilder(conf).setClusterId(clusterId) - .setScmId(scmId).setOmId(omId).build(); + cluster = MiniOzoneCluster.newBuilder(conf).build(); cluster.waitForClusterToBeReady(); client = cluster.newClient(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java index 77815698c3b8..7811470887dc 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java @@ -67,7 +67,6 @@ public class TestContainerMapper { private static OzoneManager ozoneManager; private static StorageContainerLocationProtocolClientSideTranslatorPB storageContainerLocationClient; - private static final String SCM_ID = UUID.randomUUID().toString(); private static String volName = UUID.randomUUID().toString(); private static String bucketName = UUID.randomUUID().toString(); private static OzoneConfiguration conf; @@ -88,7 +87,6 @@ public static void init() throws Exception { conf.setInt(ScmConfigKeys.OZONE_SCM_PIPELINE_OWNER_CONTAINER_COUNT, 6); cluster = MiniOzoneCluster.newBuilder(conf) .setNumDatanodes(3) - .setScmId(SCM_ID) .build(); cluster.waitForClusterToBeReady(); ozClient = OzoneClientFactory.getRpcClient(conf); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestAddRemoveOzoneManager.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestAddRemoveOzoneManager.java index ec22bbd39fd4..9d4d489586b0 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestAddRemoveOzoneManager.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestAddRemoveOzoneManager.java @@ -25,7 +25,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; -import java.util.UUID; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; @@ -77,8 +76,6 @@ public class TestAddRemoveOzoneManager { private MiniOzoneHAClusterImpl cluster = null; private ObjectStore objectStore; private OzoneConfiguration conf; - private final String clusterId = UUID.randomUUID().toString(); - private final String scmId = UUID.randomUUID().toString(); private long lastTransactionIndex; private UserGroupInformation user; @@ -99,8 +96,6 @@ private void setupCluster(int numInitialOMs) throws Exception { conf = new OzoneConfiguration(); conf.setInt(OzoneConfigKeys.OZONE_CLIENT_FAILOVER_MAX_ATTEMPTS_KEY, 5); cluster = (MiniOzoneHAClusterImpl) MiniOzoneCluster.newHABuilder(conf) - .setClusterId(clusterId) - .setScmId(scmId) .setSCMServiceId(SCM_DUMMY_SERVICE_ID) .setOMServiceId(OM_SERVICE_ID) .setNumOfOzoneManagers(numInitialOMs) diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestBucketLayoutWithOlderClient.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestBucketLayoutWithOlderClient.java index 69085830629a..73596781cc64 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestBucketLayoutWithOlderClient.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestBucketLayoutWithOlderClient.java @@ -45,9 +45,6 @@ public class TestBucketLayoutWithOlderClient { private static MiniOzoneCluster cluster = null; private static OzoneConfiguration conf; - private static String clusterId; - private static String scmId; - private static String omId; private static OzoneClient client; /** @@ -59,13 +56,9 @@ public class TestBucketLayoutWithOlderClient { @BeforeAll public static void init() throws Exception { conf = new OzoneConfiguration(); - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); - omId = UUID.randomUUID().toString(); conf.set(OMConfigKeys.OZONE_DEFAULT_BUCKET_LAYOUT, BucketLayout.OBJECT_STORE.name()); - cluster = MiniOzoneCluster.newBuilder(conf).setClusterId(clusterId) - .setScmId(scmId).setOmId(omId).build(); + cluster = MiniOzoneCluster.newBuilder(conf).build(); cluster.waitForClusterToBeReady(); client = cluster.newClient(); } diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestBucketOwner.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestBucketOwner.java index b26c3cbc5879..37fec8dcda72 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestBucketOwner.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestBucketOwner.java @@ -39,7 +39,6 @@ import org.slf4j.LoggerFactory; import java.io.IOException; -import java.util.UUID; import static org.apache.hadoop.ozone.OzoneAcl.AclScope.DEFAULT; import static org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_ACL_AUTHORIZER_CLASS; @@ -73,13 +72,9 @@ public static void init() throws Exception { // loginUser is the user running this test. UserGroupInformation.setLoginUser(adminUser); OzoneConfiguration conf = new OzoneConfiguration(); - String clusterId = UUID.randomUUID().toString(); - String scmId = UUID.randomUUID().toString(); - String omId = UUID.randomUUID().toString(); conf.set(OZONE_ACL_AUTHORIZER_CLASS, OZONE_ACL_AUTHORIZER_CLASS_NATIVE); conf.setBoolean(OZONE_ACL_ENABLED, true); - cluster = MiniOzoneCluster.newBuilder(conf).setClusterId(clusterId) - .setScmId(scmId).setOmId(omId).build(); + cluster = MiniOzoneCluster.newBuilder(conf).build(); cluster.waitForClusterToBeReady(); try (OzoneClient client = cluster.newClient()) { ObjectStore objectStore = client.getObjectStore(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListKeys.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListKeys.java index d373eeae71a2..be972557f4a4 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListKeys.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListKeys.java @@ -43,7 +43,6 @@ import java.util.List; import java.util.ArrayList; import java.util.Optional; -import java.util.UUID; import java.util.stream.Stream; import static com.google.common.collect.Lists.newLinkedList; @@ -62,9 +61,6 @@ public class TestListKeys { private static MiniOzoneCluster cluster = null; private static OzoneConfiguration conf; - private static String clusterId; - private static String scmId; - private static String omId; private static OzoneBucket legacyOzoneBucket; private static OzoneClient client; @@ -79,14 +75,10 @@ public class TestListKeys { public static void init() throws Exception { conf = new OzoneConfiguration(); conf.setBoolean(OMConfigKeys.OZONE_OM_ENABLE_FILESYSTEM_PATHS, true); - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); - omId = UUID.randomUUID().toString(); // Set the number of keys to be processed during batch operate. conf.setInt(OZONE_FS_ITERATE_BATCH_SIZE, 3); conf.setInt(OZONE_CLIENT_LIST_CACHE_SIZE, 3); - cluster = MiniOzoneCluster.newBuilder(conf).setClusterId(clusterId) - .setScmId(scmId).setOmId(omId).build(); + cluster = MiniOzoneCluster.newBuilder(conf).build(); cluster.waitForClusterToBeReady(); client = cluster.newClient(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListKeysWithFSO.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListKeysWithFSO.java index 99fb69048c60..f499e3569c8b 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListKeysWithFSO.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListKeysWithFSO.java @@ -44,7 +44,6 @@ import java.util.List; import java.util.ArrayList; import java.util.Optional; -import java.util.UUID; import static org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_CLIENT_LIST_CACHE_SIZE; import static org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_FS_ITERATE_BATCH_SIZE; @@ -59,9 +58,6 @@ public class TestListKeysWithFSO { private static MiniOzoneCluster cluster = null; private static OzoneConfiguration conf; - private static String clusterId; - private static String scmId; - private static String omId; private static OzoneBucket legacyOzoneBucket; private static OzoneBucket fsoOzoneBucket; @@ -80,14 +76,10 @@ public static void init() throws Exception { conf = new OzoneConfiguration(); conf.setBoolean(OMConfigKeys.OZONE_OM_ENABLE_FILESYSTEM_PATHS, true); - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); - omId = UUID.randomUUID().toString(); // Set the number of keys to be processed during batch operate. conf.setInt(OZONE_FS_ITERATE_BATCH_SIZE, 3); conf.setInt(OZONE_CLIENT_LIST_CACHE_SIZE, 3); - cluster = MiniOzoneCluster.newBuilder(conf).setClusterId(clusterId) - .setScmId(scmId).setOmId(omId).build(); + cluster = MiniOzoneCluster.newBuilder(conf).build(); cluster.waitForClusterToBeReady(); client = cluster.newClient(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListStatus.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListStatus.java index a24e78617f72..52cb9287cc02 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListStatus.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListStatus.java @@ -33,7 +33,6 @@ import org.junit.jupiter.api.Timeout; import java.io.IOException; -import java.util.UUID; import java.util.List; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -48,9 +47,6 @@ public class TestListStatus { private static MiniOzoneCluster cluster = null; private static OzoneConfiguration conf; - private static String clusterId; - private static String scmId; - private static String omId; private static OzoneBucket fsoOzoneBucket; private static OzoneClient client; @@ -65,11 +61,7 @@ public static void init() throws Exception { conf = new OzoneConfiguration(); conf.setBoolean(OMConfigKeys.OZONE_OM_ENABLE_FILESYSTEM_PATHS, true); - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); - omId = UUID.randomUUID().toString(); - cluster = MiniOzoneCluster.newBuilder(conf).setClusterId(clusterId) - .setScmId(scmId).setOmId(omId).build(); + cluster = MiniOzoneCluster.newBuilder(conf).build(); cluster.waitForClusterToBeReady(); client = cluster.newClient(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMBucketLayoutUpgrade.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMBucketLayoutUpgrade.java index f56a95d30a4a..b8e115864727 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMBucketLayoutUpgrade.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMBucketLayoutUpgrade.java @@ -93,8 +93,6 @@ void setup() throws Exception { OzoneConfiguration conf = new OzoneConfiguration(); String omServiceId = UUID.randomUUID().toString(); cluster = (MiniOzoneHAClusterImpl) MiniOzoneCluster.newOMHABuilder(conf) - .setClusterId(UUID.randomUUID().toString()) - .setScmId(UUID.randomUUID().toString()) .setOMServiceId(omServiceId) .setNumOfOzoneManagers(3) .setNumDatanodes(1) diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMEpochForNonRatis.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMEpochForNonRatis.java index d63aab63dd42..991b3a66fb03 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMEpochForNonRatis.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMEpochForNonRatis.java @@ -18,7 +18,6 @@ package org.apache.hadoop.ozone.om; import java.util.HashMap; -import java.util.UUID; import org.apache.hadoop.hdds.utils.IOUtils; import org.apache.commons.lang3.RandomStringUtils; @@ -56,22 +55,13 @@ public class TestOMEpochForNonRatis { private static MiniOzoneCluster cluster = null; private static OzoneConfiguration conf; - private static String clusterId; - private static String scmId; - private static String omId; private static OzoneClient client; @BeforeAll public static void init() throws Exception { conf = new OzoneConfiguration(); - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); - omId = UUID.randomUUID().toString(); conf.setBoolean(OZONE_OM_RATIS_ENABLE_KEY, false); cluster = MiniOzoneCluster.newBuilder(conf) - .setClusterId(clusterId) - .setScmId(scmId) - .setOmId(omId) .build(); cluster.waitForClusterToBeReady(); client = cluster.newClient(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java index 3780363a1b34..9e816174b7d5 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java @@ -78,7 +78,6 @@ import java.util.List; import java.util.Objects; import java.util.Set; -import java.util.UUID; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -109,8 +108,6 @@ public class TestOMRatisSnapshots { private MiniOzoneHAClusterImpl cluster = null; private ObjectStore objectStore; private OzoneConfiguration conf; - private String clusterId; - private String scmId; private String omServiceId; private int numOfOMs = 3; private OzoneBucket ozoneBucket; @@ -136,8 +133,6 @@ public class TestOMRatisSnapshots { @BeforeEach public void init(TestInfo testInfo) throws Exception { conf = new OzoneConfiguration(); - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); omServiceId = "om-service-test1"; conf.setInt(OMConfigKeys.OZONE_OM_RATIS_LOG_PURGE_GAP, LOG_PURGE_GAP); conf.setStorageSize(OMConfigKeys.OZONE_OM_RATIS_SEGMENT_SIZE_KEY, 16, @@ -161,8 +156,6 @@ public void init(TestInfo testInfo) throws Exception { conf.setFromObject(omRatisConf); cluster = (MiniOzoneHAClusterImpl) MiniOzoneCluster.newOMHABuilder(conf) - .setClusterId(clusterId) - .setScmId(scmId) .setOMServiceId("om-service-test1") .setNumOfOzoneManagers(numOfOMs) .setNumOfActiveOMs(2) diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMStartupWithBucketLayout.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMStartupWithBucketLayout.java index 00b5b2a6243c..354a11ad554f 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMStartupWithBucketLayout.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMStartupWithBucketLayout.java @@ -28,8 +28,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; -import java.util.UUID; - /** * Verifies OM startup with different layout. */ @@ -41,11 +39,8 @@ public class TestOMStartupWithBucketLayout { public static void startCluster(OzoneConfiguration conf) throws Exception { - String clusterId = UUID.randomUUID().toString(); - String scmId = UUID.randomUUID().toString(); - String omId = UUID.randomUUID().toString(); - cluster = MiniOzoneCluster.newBuilder(conf).setClusterId(clusterId) - .setScmId(scmId).setOmId(omId).withoutDatanodes().build(); + cluster = MiniOzoneCluster.newBuilder(conf) + .withoutDatanodes().build(); cluster.waitForClusterToBeReady(); client = cluster.newClient(); } diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMUpgradeFinalization.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMUpgradeFinalization.java index 1e657d0ea781..fa84130c9d6f 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMUpgradeFinalization.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMUpgradeFinalization.java @@ -104,8 +104,6 @@ void testOMUpgradeFinalizationWithOneOMDown() throws Exception { private static MiniOzoneHAClusterImpl newCluster(OzoneConfiguration conf) throws IOException { return (MiniOzoneHAClusterImpl) MiniOzoneCluster.newOMHABuilder(conf) - .setClusterId(UUID.randomUUID().toString()) - .setScmId(UUID.randomUUID().toString()) .setOMServiceId(UUID.randomUUID().toString()) .setNumOfOzoneManagers(3) .setNumDatanodes(1) diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestObjectStore.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestObjectStore.java index 2f4df748ee75..5997d5758a28 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestObjectStore.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestObjectStore.java @@ -44,9 +44,6 @@ public class TestObjectStore { private static MiniOzoneCluster cluster = null; private static OzoneConfiguration conf; - private static String clusterId; - private static String scmId; - private static String omId; private static OzoneClient client; /** @@ -58,11 +55,7 @@ public class TestObjectStore { @BeforeAll public static void init() throws Exception { conf = new OzoneConfiguration(); - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); - omId = UUID.randomUUID().toString(); - cluster = MiniOzoneCluster.newBuilder(conf).setClusterId(clusterId) - .setScmId(scmId).setOmId(omId).build(); + cluster = MiniOzoneCluster.newBuilder(conf).build(); cluster.waitForClusterToBeReady(); client = cluster.newClient(); } diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestObjectStoreWithFSO.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestObjectStoreWithFSO.java index 81c11eb9cd45..2e58b6dbb731 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestObjectStoreWithFSO.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestObjectStoreWithFSO.java @@ -89,9 +89,6 @@ public class TestObjectStoreWithFSO { new Path(OZONE_URI_DELIMITER); private static MiniOzoneCluster cluster = null; private static OzoneConfiguration conf; - private static String clusterId; - private static String scmId; - private static String omId; private static String volumeName; private static String bucketName; private static FileSystem fs; @@ -106,13 +103,9 @@ public class TestObjectStoreWithFSO { @BeforeAll public static void init() throws Exception { conf = new OzoneConfiguration(); - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); - omId = UUID.randomUUID().toString(); conf.set(OMConfigKeys.OZONE_DEFAULT_BUCKET_LAYOUT, BucketLayout.FILE_SYSTEM_OPTIMIZED.name()); - cluster = MiniOzoneCluster.newBuilder(conf).setClusterId(clusterId) - .setScmId(scmId).setOmId(omId).build(); + cluster = MiniOzoneCluster.newBuilder(conf).build(); cluster.waitForClusterToBeReady(); client = cluster.newClient(); // create a volume and a bucket to be used by OzoneFileSystem diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmAcls.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmAcls.java index 02ad087965dd..d9724b2a4900 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmAcls.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmAcls.java @@ -41,7 +41,6 @@ import java.io.IOException; import java.util.ArrayList; -import java.util.UUID; import static org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_ACL_AUTHORIZER_CLASS; import static org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_ACL_ENABLED; @@ -78,17 +77,11 @@ public class TestOmAcls { @BeforeAll public static void init() throws Exception { OzoneConfiguration conf = new OzoneConfiguration(); - String clusterId = UUID.randomUUID().toString(); - String scmId = UUID.randomUUID().toString(); - String omId = UUID.randomUUID().toString(); conf.setBoolean(OZONE_ACL_ENABLED, true); conf.setClass(OZONE_ACL_AUTHORIZER_CLASS, OzoneAccessAuthorizerTest.class, IAccessAuthorizer.class); conf.setStrings(OZONE_ADMINISTRATORS, OZONE_ADMINISTRATORS_WILDCARD); cluster = MiniOzoneCluster.newBuilder(conf) - .setClusterId(clusterId) - .setScmId(scmId) - .setOmId(omId) .build(); cluster.waitForClusterToBeReady(); client = cluster.newClient(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java index 84387a232d90..dc2d6e3cf395 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java @@ -18,7 +18,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.IOException; -import java.util.UUID; import org.apache.hadoop.hdds.conf.OzoneConfiguration; import org.apache.hadoop.ozone.MiniOzoneCluster; @@ -38,9 +37,6 @@ public class TestOmInit { private static MiniOzoneCluster cluster = null; private static OMMetrics omMetrics; private static OzoneConfiguration conf; - private static String clusterId; - private static String scmId; - private static String omId; /** * Create a MiniDFSCluster for testing. @@ -52,13 +48,7 @@ public class TestOmInit { @BeforeAll public static void init() throws Exception { conf = new OzoneConfiguration(); - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); - omId = UUID.randomUUID().toString(); cluster = MiniOzoneCluster.newBuilder(conf) - .setClusterId(clusterId) - .setScmId(scmId) - .setOmId(omId) .build(); cluster.waitForClusterToBeReady(); omMetrics = cluster.getOzoneManager().getMetrics(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshotDisabled.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshotDisabled.java index 1e6cd969542c..fd1a60128de1 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshotDisabled.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshotDisabled.java @@ -33,8 +33,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; -import java.util.UUID; - import static org.apache.hadoop.hdds.HddsConfigKeys.HDDS_DB_PROFILE; import static org.apache.hadoop.ozone.om.exceptions.OMException.ResultCodes.FEATURE_NOT_ENABLED; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -53,8 +51,6 @@ public class TestOmSnapshotDisabled { @Timeout(60) public static void init() throws Exception { OzoneConfiguration conf = new OzoneConfiguration(); - String clusterId = UUID.randomUUID().toString(); - String scmId = UUID.randomUUID().toString(); conf.set(OMConfigKeys.OZONE_DEFAULT_BUCKET_LAYOUT, BucketLayout.LEGACY.name()); conf.setEnum(HDDS_DB_PROFILE, DBProfile.TEST); @@ -62,8 +58,6 @@ public static void init() throws Exception { conf.setBoolean(OMConfigKeys.OZONE_FILESYSTEM_SNAPSHOT_ENABLED_KEY, false); cluster = MiniOzoneCluster.newOMHABuilder(conf) - .setClusterId(clusterId) - .setScmId(scmId) .setOMServiceId("om-service-test1") .setNumOfOzoneManagers(3) .build(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshotDisabledRestart.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshotDisabledRestart.java index 6048f1e4d600..babc643ffa01 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshotDisabledRestart.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshotDisabledRestart.java @@ -31,8 +31,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; -import java.util.UUID; - import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.fail; @@ -52,15 +50,11 @@ public class TestOmSnapshotDisabledRestart { @Timeout(60) public static void init() throws Exception { OzoneConfiguration conf = new OzoneConfiguration(); - String clusterId = UUID.randomUUID().toString(); - String scmId = UUID.randomUUID().toString(); // Enable filesystem snapshot feature at the beginning conf.setBoolean(OMConfigKeys.OZONE_FILESYSTEM_SNAPSHOT_ENABLED_KEY, true); cluster = (MiniOzoneHAClusterImpl) MiniOzoneCluster.newOMHABuilder(conf) - .setClusterId(clusterId) - .setScmId(scmId) .setOMServiceId("om-service-test2") .setNumOfOzoneManagers(3) .build(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshotFileSystem.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshotFileSystem.java index 790399c3237f..ae6fac2deeb9 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshotFileSystem.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshotFileSystem.java @@ -124,12 +124,8 @@ public TestOmSnapshotFileSystem(String bucketName) { @BeforeAll public static void init() throws Exception { conf = new OzoneConfiguration(); - String clusterId = UUID.randomUUID().toString(); - String scmId = UUID.randomUUID().toString(); - String omId = UUID.randomUUID().toString(); conf.setBoolean(OMConfigKeys.OZONE_OM_ENABLE_FILESYSTEM_PATHS, true); - cluster = MiniOzoneCluster.newBuilder(conf).setClusterId(clusterId) - .setScmId(scmId).setOmId(omId).build(); + cluster = MiniOzoneCluster.newBuilder(conf).build(); cluster.waitForClusterToBeReady(); client = cluster.newClient(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmStartupSlvLessThanMlv.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmStartupSlvLessThanMlv.java index 0af41af83183..77bb7189b5e4 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmStartupSlvLessThanMlv.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmStartupSlvLessThanMlv.java @@ -20,7 +20,6 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.UUID; import org.apache.hadoop.hdds.conf.OzoneConfiguration; import org.apache.hadoop.hdds.protocol.proto.HddsProtos; @@ -66,10 +65,7 @@ public void testStartupSlvLessThanMlv() throws Exception { // Create version file with MLV > SLV, which should fail the cluster build. UpgradeTestUtils.createVersionFile(omSubdir, HddsProtos.NodeType.OM, mlv); - MiniOzoneCluster.Builder clusterBuilder = MiniOzoneCluster.newBuilder(conf) - .setClusterId(UUID.randomUUID().toString()) - .setScmId(UUID.randomUUID().toString()) - .setOmId(UUID.randomUUID().toString()); + MiniOzoneCluster.Builder clusterBuilder = MiniOzoneCluster.newBuilder(conf); OMException omException = assertThrows(OMException.class, clusterBuilder::build); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerConfiguration.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerConfiguration.java index f44a5cbea8ef..81f87265b0a4 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerConfiguration.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerConfiguration.java @@ -20,10 +20,8 @@ import java.io.IOException; import java.net.InetSocketAddress; import java.nio.file.Path; -import java.nio.file.Paths; import java.util.Collection; import java.util.List; -import java.util.UUID; import java.util.concurrent.TimeUnit; import org.apache.hadoop.hdds.HddsConfigKeys; @@ -35,7 +33,6 @@ import org.apache.hadoop.ozone.ha.ConfUtils; import org.apache.hadoop.ozone.om.helpers.OMNodeDetails; import org.apache.hadoop.ozone.om.ratis.OzoneManagerRatisServer; -import org.apache.ozone.test.GenericTestUtils; import org.apache.ratis.protocol.RaftPeer; import org.apache.ratis.util.LifeCycle; @@ -43,6 +40,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; +import org.junit.jupiter.api.io.TempDir; import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_ADDRESS_KEY; import static org.assertj.core.api.Assertions.assertThat; @@ -60,30 +58,18 @@ public class TestOzoneManagerConfiguration { private OzoneConfiguration conf; private MiniOzoneCluster cluster; - private String omId; - private String clusterId; - private String scmId; private OzoneManager om; private OzoneManagerRatisServer omRatisServer; private static final long RATIS_RPC_TIMEOUT = 500L; @BeforeEach - public void init() throws IOException { + void init(@TempDir Path metaDirPath) throws IOException { conf = new OzoneConfiguration(); - omId = UUID.randomUUID().toString(); - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); - final String path = GenericTestUtils.getTempPath(omId); - Path metaDirPath = Paths.get(path, "om-meta"); conf.set(HddsConfigKeys.OZONE_METADATA_DIRS, metaDirPath.toString()); conf.setBoolean(OMConfigKeys.OZONE_OM_RATIS_ENABLE_KEY, true); conf.setTimeDuration(OMConfigKeys.OZONE_OM_RATIS_MINIMUM_TIMEOUT_KEY, RATIS_RPC_TIMEOUT, TimeUnit.MILLISECONDS); - OMStorage omStore = new OMStorage(conf); - omStore.setClusterId("testClusterId"); - // writes the version file properties - omStore.initialize(); } @AfterEach @@ -95,9 +81,6 @@ public void shutdown() { private void startCluster() throws Exception { cluster = MiniOzoneCluster.newBuilder(conf) - .setClusterId(clusterId) - .setScmId(scmId) - .setOmId(omId) .withoutDatanodes() .build(); cluster.waitForClusterToBeReady(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHA.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHA.java index 2bc4dbf3a100..454019b4a8a4 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHA.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHA.java @@ -79,9 +79,6 @@ public abstract class TestOzoneManagerHA { private static MiniOzoneCluster.Builder clusterBuilder = null; private static ObjectStore objectStore; private static OzoneConfiguration conf; - private static String clusterId; - private static String scmId; - private static String omId; private static String omServiceId; private static int numOfOMs = 3; private static final int LOG_PURGE_GAP = 50; @@ -147,10 +144,7 @@ public static Duration getRetryCacheDuration() { @BeforeAll public static void init() throws Exception { conf = new OzoneConfiguration(); - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); omServiceId = "om-service-test1"; - omId = UUID.randomUUID().toString(); conf.setBoolean(OZONE_ACL_ENABLED, true); conf.set(OzoneConfigKeys.OZONE_ADMINISTRATORS, OZONE_ADMINISTRATORS_WILDCARD); @@ -184,10 +178,7 @@ public static void init() throws Exception { conf.set(OZONE_KEY_DELETING_LIMIT_PER_TASK, "2"); clusterBuilder = MiniOzoneCluster.newOMHABuilder(conf) - .setClusterId(clusterId) - .setScmId(scmId) .setOMServiceId(omServiceId) - .setOmId(omId) .setNumOfOzoneManagers(numOfOMs); cluster = (MiniOzoneHAClusterImpl) clusterBuilder.build(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHASnapshot.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHASnapshot.java index fa91985b0153..1d3ddb08a684 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHASnapshot.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHASnapshot.java @@ -68,13 +68,9 @@ public class TestOzoneManagerHASnapshot { @BeforeAll public static void staticInit() throws Exception { OzoneConfiguration conf = new OzoneConfiguration(); - String clusterId = UUID.randomUUID().toString(); - String scmId = UUID.randomUUID().toString(); conf.setBoolean(OMConfigKeys.OZONE_FILESYSTEM_SNAPSHOT_ENABLED_KEY, true); cluster = (MiniOzoneHAClusterImpl) MiniOzoneCluster.newOMHABuilder(conf) - .setClusterId(clusterId) - .setScmId(scmId) .setOMServiceId("om-service-test") .setNumOfOzoneManagers(3) .build(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerListVolumes.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerListVolumes.java index 16e6ad086ca5..1fcfa63d1a80 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerListVolumes.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerListVolumes.java @@ -25,7 +25,6 @@ import java.util.Iterator; import java.util.List; import java.util.Set; -import java.util.UUID; import java.util.concurrent.TimeoutException; import org.apache.hadoop.hdds.conf.OzoneConfiguration; @@ -93,9 +92,6 @@ public static void setupClass() throws InterruptedException, TimeoutException, IOException { OzoneConfiguration conf = new OzoneConfiguration(); UserGroupInformation.setLoginUser(adminUser); - String clusterId = UUID.randomUUID().toString(); - String scmId = UUID.randomUUID().toString(); - String omId = UUID.randomUUID().toString(); conf.setInt(OZONE_SCM_RATIS_PIPELINE_LIMIT, 10); // Use native impl here, default impl doesn't do actual checks @@ -103,7 +99,6 @@ public static void setupClass() cluster = MiniOzoneCluster.newBuilder(conf) .withoutDatanodes() - .setClusterId(clusterId).setScmId(scmId).setOmId(omId) .build(); cluster.waitForClusterToBeReady(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerRestart.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerRestart.java index ac4710c0c6be..440b75aff6a0 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerRestart.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerRestart.java @@ -21,7 +21,6 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; -import java.util.UUID; import org.apache.hadoop.hdds.utils.IOUtils; import org.apache.hadoop.hdds.client.ReplicationFactor; @@ -63,9 +62,6 @@ public class TestOzoneManagerRestart { private static MiniOzoneCluster cluster = null; private static OzoneConfiguration conf; - private static String clusterId; - private static String scmId; - private static String omId; private static OzoneClient client; /** @@ -78,9 +74,6 @@ public class TestOzoneManagerRestart { @BeforeAll public static void init() throws Exception { conf = new OzoneConfiguration(); - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); - omId = UUID.randomUUID().toString(); conf.setBoolean(OZONE_ACL_ENABLED, true); conf.set(OZONE_ADMINISTRATORS, OZONE_ADMINISTRATORS_WILDCARD); conf.setInt(OZONE_SCM_RATIS_PIPELINE_LIMIT, 10); @@ -88,9 +81,6 @@ public static void init() throws Exception { conf.set(OMConfigKeys.OZONE_DEFAULT_BUCKET_LAYOUT, BucketLayout.OBJECT_STORE.name()); cluster = MiniOzoneCluster.newBuilder(conf) - .setClusterId(clusterId) - .setScmId(scmId) - .setOmId(omId) .build(); cluster.waitForClusterToBeReady(); client = cluster.newClient(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestRecursiveAclWithFSO.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestRecursiveAclWithFSO.java index e19ecf1a9d85..6f86fcba70ec 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestRecursiveAclWithFSO.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestRecursiveAclWithFSO.java @@ -45,7 +45,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import java.util.UUID; import static org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_ACL_AUTHORIZER_CLASS; import static org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_ACL_AUTHORIZER_CLASS_NATIVE; @@ -233,9 +232,6 @@ private void removeAclsFromKey(ObjectStore objectStore, private void startCluster() throws Exception { OzoneConfiguration conf = new OzoneConfiguration(); - String clusterId = UUID.randomUUID().toString(); - String scmId = UUID.randomUUID().toString(); - String omId = UUID.randomUUID().toString(); // Use native impl here, default impl doesn't do actual checks conf.set(OZONE_ACL_AUTHORIZER_CLASS, OZONE_ACL_AUTHORIZER_CLASS_NATIVE); @@ -244,9 +240,7 @@ private void startCluster() throws Exception { OMRequestTestUtils.configureFSOptimizedPaths(conf, true); - cluster = - MiniOzoneCluster.newBuilder(conf).setClusterId(clusterId) - .setScmId(scmId).setOmId(omId).build(); + cluster = MiniOzoneCluster.newBuilder(conf).build(); cluster.waitForClusterToBeReady(); } diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestSnapshotBackgroundServices.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestSnapshotBackgroundServices.java index 8f270b7c4325..a7bc55446413 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestSnapshotBackgroundServices.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestSnapshotBackgroundServices.java @@ -62,7 +62,6 @@ import java.util.Collections; import java.util.List; import java.util.Objects; -import java.util.UUID; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicInteger; @@ -112,8 +111,6 @@ public class TestSnapshotBackgroundServices { @BeforeEach public void init(TestInfo testInfo) throws Exception { OzoneConfiguration conf = new OzoneConfiguration(); - String clusterId = UUID.randomUUID().toString(); - String scmId = UUID.randomUUID().toString(); String omServiceId = "om-service-test1"; OzoneManagerRatisServerConfig omRatisConf = conf.getObject(OzoneManagerRatisServerConfig.class); omRatisConf.setLogAppenderWaitTimeMin(10); @@ -157,8 +154,6 @@ public void init(TestInfo testInfo) throws Exception { SNAPSHOT_THRESHOLD); int numOfOMs = 3; cluster = (MiniOzoneHAClusterImpl) MiniOzoneCluster.newOMHABuilder(conf) - .setClusterId(clusterId) - .setScmId(scmId) .setOMServiceId("om-service-test1") .setNumOfOzoneManagers(numOfOMs) .setNumOfActiveOMs(2) diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshot.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshot.java index 7872a5627455..37c788a405bc 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshot.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshot.java @@ -196,8 +196,6 @@ public TestOmSnapshot(BucketLayout newBucketLayout, */ private void init() throws Exception { OzoneConfiguration conf = new OzoneConfiguration(); - String clusterId = UUID.randomUUID().toString(); - String scmId = UUID.randomUUID().toString(); conf.setBoolean(OZONE_OM_ENABLE_FILESYSTEM_PATHS, enabledFileSystemPaths); conf.set(OZONE_DEFAULT_BUCKET_LAYOUT, bucketLayout.name()); conf.setBoolean(OZONE_OM_SNAPSHOT_FORCE_FULL_DIFF, forceFullSnapshotDiff); @@ -211,12 +209,8 @@ private void init() throws Exception { conf.setBoolean(OMConfigKeys.OZONE_FILESYSTEM_SNAPSHOT_ENABLED_KEY, true); cluster = MiniOzoneCluster.newBuilder(conf) - .setClusterId(clusterId) - .setScmId(scmId) .setNumOfOzoneManagers(3) - .setOmLayoutVersion(OMLayoutFeature. - BUCKET_LAYOUT_SUPPORT.layoutVersion()) - .setOmId(UUID.randomUUID().toString()) + .setOmLayoutVersion(OMLayoutFeature.BUCKET_LAYOUT_SUPPORT.layoutVersion()) .build(); cluster.waitForClusterToBeReady(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneManagerSnapshotAcl.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneManagerSnapshotAcl.java index 0fa439f2acd9..8c0b375c3ca9 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneManagerSnapshotAcl.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneManagerSnapshotAcl.java @@ -21,7 +21,6 @@ import java.io.File; import java.io.IOException; -import java.util.UUID; import java.util.stream.Stream; import org.apache.hadoop.hdds.utils.IOUtils; @@ -112,8 +111,6 @@ public static void init() throws Exception { + RandomStringUtils.randomNumeric(32); cluster = MiniOzoneCluster.newOMHABuilder(conf) - .setClusterId(UUID.randomUUID().toString()) - .setScmId(UUID.randomUUID().toString()) .setOMServiceId(omServiceId) .setNumOfOzoneManagers(1) .build(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneManagerSnapshotProvider.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneManagerSnapshotProvider.java index 091471fab171..643191b36d41 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneManagerSnapshotProvider.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneManagerSnapshotProvider.java @@ -18,8 +18,6 @@ package org.apache.hadoop.ozone.om.snapshot; -import java.util.UUID; - import org.apache.commons.lang3.RandomStringUtils; import org.apache.hadoop.hdds.conf.OzoneConfiguration; import org.apache.hadoop.hdds.utils.IOUtils; @@ -54,8 +52,6 @@ public class TestOzoneManagerSnapshotProvider { private MiniOzoneHAClusterImpl cluster = null; private ObjectStore objectStore; private OzoneConfiguration conf; - private String clusterId; - private String scmId; private String omServiceId; private int numOfOMs = 3; @@ -67,14 +63,10 @@ public class TestOzoneManagerSnapshotProvider { @BeforeEach public void init() throws Exception { conf = new OzoneConfiguration(); - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); omServiceId = "om-service-test1"; conf.setBoolean(OMConfigKeys.OZONE_OM_HTTP_ENABLED_KEY, true); conf.setBoolean(OMConfigKeys.OZONE_OM_RATIS_ENABLE_KEY, true); cluster = (MiniOzoneHAClusterImpl) MiniOzoneCluster.newOMHABuilder(conf) - .setClusterId(clusterId) - .setScmId(scmId) .setOMServiceId(omServiceId) .setNumOfOzoneManagers(numOfOMs) .build(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneSnapshotRestore.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneSnapshotRestore.java index 21fdd853b9e9..e0d01c148d6b 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneSnapshotRestore.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneSnapshotRestore.java @@ -53,7 +53,6 @@ import java.io.File; import java.io.IOException; import java.util.Iterator; -import java.util.UUID; import java.util.concurrent.TimeoutException; import java.util.stream.Stream; import java.util.concurrent.atomic.AtomicInteger; @@ -104,13 +103,9 @@ public void init() throws Exception { // Enable filesystem snapshot feature for the test regardless of the default conf.setBoolean(OMConfigKeys.OZONE_FILESYSTEM_SNAPSHOT_ENABLED_KEY, true); - String clusterId = UUID.randomUUID().toString(); - String scmId = UUID.randomUUID().toString(); String serviceID = OM_SERVICE_ID + RandomStringUtils.randomNumeric(5); cluster = MiniOzoneCluster.newOMHABuilder(conf) - .setClusterId(clusterId) - .setScmId(scmId) .setOMServiceId(serviceID) .setNumOfOzoneManagers(3) .build(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/parser/TestOzoneHARatisLogParser.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/parser/TestOzoneHARatisLogParser.java index e5349b09d00f..8f11941fcbf6 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/parser/TestOzoneHARatisLogParser.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/parser/TestOzoneHARatisLogParser.java @@ -63,14 +63,10 @@ class TestOzoneHARatisLogParser { @BeforeEach void setup() throws Exception { - String clusterId = UUID.randomUUID().toString(); - String scmId = UUID.randomUUID().toString(); String omServiceId = "omServiceId1"; OzoneConfiguration conf = new OzoneConfiguration(); String scmServiceId = "scmServiceId"; cluster = (MiniOzoneHAClusterImpl) MiniOzoneCluster.newHABuilder(conf) - .setClusterId(clusterId) - .setScmId(scmId) .setOMServiceId(omServiceId) .setSCMServiceId(scmServiceId) .setNumOfOzoneManagers(3) diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconWithOzoneManagerHA.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconWithOzoneManagerHA.java index 721f04085b00..8baad9cb97b4 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconWithOzoneManagerHA.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconWithOzoneManagerHA.java @@ -44,7 +44,6 @@ import org.junit.jupiter.api.Timeout; import java.util.HashMap; -import java.util.UUID; import java.util.concurrent.atomic.AtomicReference; import static java.nio.charset.StandardCharsets.UTF_8; @@ -75,8 +74,6 @@ public void setup() throws Exception { conf.setFromObject(dbConf); cluster = (MiniOzoneHAClusterImpl) MiniOzoneCluster.newOMHABuilder(conf) - .setClusterId(UUID.randomUUID().toString()) - .setScmId(UUID.randomUUID().toString()) .setOMServiceId(OM_SERVICE_ID) .setNumDatanodes(1) .setNumOfOzoneManagers(3) diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestDeletedBlocksTxnShell.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestDeletedBlocksTxnShell.java index 3b525cfa1019..9d0552a169fe 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestDeletedBlocksTxnShell.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestDeletedBlocksTxnShell.java @@ -53,7 +53,6 @@ import java.util.List; import java.util.Map; import java.util.Set; -import java.util.UUID; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -75,8 +74,6 @@ public class TestDeletedBlocksTxnShell { private final ByteArrayOutputStream outContent = new ByteArrayOutputStream(); private MiniOzoneHAClusterImpl cluster = null; private OzoneConfiguration conf; - private String clusterId; - private String scmId; private String scmServiceId; private File txnFile; private int numOfSCMs = 3; @@ -94,16 +91,12 @@ public class TestDeletedBlocksTxnShell { @BeforeEach public void init() throws Exception { conf = new OzoneConfiguration(); - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); scmServiceId = "scm-service-test1"; conf.setBoolean(ScmConfigKeys.OZONE_SCM_HA_ENABLE_KEY, true); conf.setInt(OZONE_SCM_BLOCK_DELETION_MAX_RETRY, 20); cluster = (MiniOzoneHAClusterImpl) MiniOzoneCluster.newOMHABuilder(conf) - .setClusterId(clusterId) - .setScmId(scmId) .setSCMServiceId(scmServiceId) .setNumOfStorageContainerManagers(numOfSCMs) .setNumOfActiveSCMs(numOfSCMs) diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneContainerUpgradeShell.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneContainerUpgradeShell.java index 153d97e4d3dc..a79e2de245da 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneContainerUpgradeShell.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneContainerUpgradeShell.java @@ -81,8 +81,6 @@ public class TestOzoneContainerUpgradeShell { private static final Logger LOG = LoggerFactory.getLogger(TestOzoneContainerUpgradeShell.class); private static String omServiceId; - private static String clusterId; - private static String scmId; private static MiniOzoneCluster cluster = null; private static OzoneClient client; private static OzoneConfiguration conf = null; @@ -92,11 +90,10 @@ public class TestOzoneContainerUpgradeShell { protected static void startCluster() throws Exception { // Init HA cluster omServiceId = "om-service-test-upgrade-container1"; - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); final int numDNs = 3; - cluster = MiniOzoneCluster.newBuilder(conf).setClusterId(clusterId) - .setScmId(scmId).setOMServiceId(omServiceId).setNumDatanodes(numDNs) + cluster = MiniOzoneCluster.newBuilder(conf) + .setOMServiceId(omServiceId) + .setNumDatanodes(numDNs) .build(); cluster.waitForClusterToBeReady(); client = cluster.newClient(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneDebugShell.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneDebugShell.java index 05e26200aa0d..b50cea759ea4 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneDebugShell.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneDebugShell.java @@ -77,8 +77,6 @@ public class TestOzoneDebugShell { private static String omServiceId; - private static String clusterId; - private static String scmId; private static MiniOzoneCluster cluster = null; private static OzoneClient client; @@ -88,12 +86,8 @@ public class TestOzoneDebugShell { protected static void startCluster() throws Exception { // Init HA cluster omServiceId = "om-service-test1"; - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); final int numDNs = 3; cluster = MiniOzoneCluster.newBuilder(conf) - .setClusterId(clusterId) - .setScmId(scmId) .setOMServiceId(omServiceId) .setNumDatanodes(numDNs) .build(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneShellHA.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneShellHA.java index b3c4a523a36a..9596e96026a4 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneShellHA.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneShellHA.java @@ -135,8 +135,6 @@ public class TestOzoneShellHA { private static final PrintStream OLD_ERR = System.err; private static String omServiceId; - private static String clusterId; - private static String scmId; private static int numOfOMs; /** @@ -176,14 +174,10 @@ protected static void startCluster(OzoneConfiguration conf) throws Exception { // Init HA cluster omServiceId = "om-service-test1"; numOfOMs = 3; - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); final int numDNs = 5; conf.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_KEY_PROVIDER_PATH, getKeyProviderURI(miniKMS)); cluster = MiniOzoneCluster.newOMHABuilder(conf) - .setClusterId(clusterId) - .setScmId(scmId) .setOMServiceId(omServiceId) .setNumOfOzoneManagers(numOfOMs) .setNumDatanodes(numDNs) diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java index a9ad4b4e387c..6abfbed2bd38 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java @@ -57,7 +57,6 @@ import java.security.PrivilegedExceptionAction; import java.util.Arrays; import java.util.List; -import java.util.UUID; import static java.nio.charset.StandardCharsets.UTF_8; import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_MULTITENANCY_ENABLED; @@ -108,8 +107,6 @@ public class TestOzoneTenantShell { private static final PrintStream OLD_ERR = System.err; private static String omServiceId; - private static String clusterId; - private static String scmId; private static int numOfOMs; private static final boolean USE_ACTUAL_RANGER = false; @@ -156,11 +153,7 @@ public static void init() throws Exception { // Init cluster omServiceId = "om-service-test1"; numOfOMs = 3; - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); cluster = MiniOzoneCluster.newOMHABuilder(conf) - .setClusterId(clusterId) - .setScmId(scmId) .setOMServiceId(omServiceId) .setNumOfOzoneManagers(numOfOMs) .withoutDatanodes() // Remove this once we are actually writing data diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestReconfigShell.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestReconfigShell.java index 231301cb35af..427b36d9a952 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestReconfigShell.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestReconfigShell.java @@ -68,8 +68,6 @@ public static void setup() throws Exception { OzoneConfiguration conf = new OzoneConfiguration(); String omServiceId = UUID.randomUUID().toString(); cluster = MiniOzoneCluster.newOMHABuilder(conf) - .setClusterId(UUID.randomUUID().toString()) - .setScmId(UUID.randomUUID().toString()) .setOMServiceId(omServiceId) .setNumOfOzoneManagers(1) .setNumOfStorageContainerManagers(1) diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestScmAdminHA.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestScmAdminHA.java index 3754bfceccd8..2e1b7a78736f 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestScmAdminHA.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestScmAdminHA.java @@ -18,7 +18,6 @@ package org.apache.hadoop.ozone.shell; import java.net.InetSocketAddress; -import java.util.UUID; import org.apache.hadoop.hdds.cli.OzoneAdmin; import org.apache.hadoop.hdds.conf.OzoneConfiguration; @@ -36,8 +35,6 @@ public class TestScmAdminHA { private static OzoneConfiguration conf; private static String omServiceId; private static int numOfOMs; - private static String clusterId; - private static String scmId; private static MiniOzoneCluster cluster; @BeforeAll @@ -48,11 +45,7 @@ public static void init() throws Exception { // Init HA cluster omServiceId = "om-service-test1"; numOfOMs = 3; - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); cluster = MiniOzoneCluster.newOMHABuilder(conf) - .setClusterId(clusterId) - .setScmId(scmId) .setOMServiceId(omServiceId) .setNumOfOzoneManagers(numOfOMs) .build(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestTransferLeadershipShell.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestTransferLeadershipShell.java index f27e22e9065b..62d50708c83a 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestTransferLeadershipShell.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestTransferLeadershipShell.java @@ -34,7 +34,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; -import java.util.UUID; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -47,8 +46,6 @@ public class TestTransferLeadershipShell { private MiniOzoneHAClusterImpl cluster = null; private OzoneConfiguration conf; - private String clusterId; - private String scmId; private String omServiceId; private String scmServiceId; private int numOfOMs = 3; @@ -64,15 +61,13 @@ public class TestTransferLeadershipShell { @BeforeEach public void init() throws Exception { conf = new OzoneConfiguration(); - clusterId = UUID.randomUUID().toString(); - scmId = UUID.randomUUID().toString(); omServiceId = "om-service-test1"; scmServiceId = "scm-service-test1"; conf.setLong(ScmConfigKeys.OZONE_SCM_HA_RATIS_SNAPSHOT_THRESHOLD, SNAPSHOT_THRESHOLD); cluster = (MiniOzoneHAClusterImpl) MiniOzoneCluster.newHABuilder(conf) - .setClusterId(clusterId).setScmId(scmId).setOMServiceId(omServiceId) + .setOMServiceId(omServiceId) .setSCMServiceId(scmServiceId).setNumOfOzoneManagers(numOfOMs) .setNumOfStorageContainerManagers(numOfSCMs) .setNumOfActiveSCMs(numOfSCMs).setNumOfActiveOMs(numOfOMs) diff --git a/hadoop-ozone/integration-test/src/test/resources/ozone-site.xml b/hadoop-ozone/integration-test/src/test/resources/ozone-site.xml index 4c415c0c7e0d..0d63a3405724 100644 --- a/hadoop-ozone/integration-test/src/test/resources/ozone-site.xml +++ b/hadoop-ozone/integration-test/src/test/resources/ozone-site.xml @@ -41,6 +41,21 @@ 4 + + ozone.scm.handler.count.key + 20 + + + + ozone.om.handler.count.key + 20 + + + + dfs.container.ratis.datastream.enabled + true + + ozone.scm.close.container.wait.duration 1s