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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.apache.hadoop.hdds.scm.ha;

import org.apache.hadoop.hdds.HddsConfigKeys;
import org.apache.hadoop.hdds.conf.DefaultConfigManager;
import org.apache.hadoop.hdds.conf.OzoneConfiguration;
import org.apache.hadoop.hdds.scm.ScmConfigKeys;
import org.apache.hadoop.hdds.scm.ScmRatisServerConfig;
Expand All @@ -33,6 +32,8 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -74,7 +75,6 @@ class TestSCMConfiguration {
void setup() {
conf = new OzoneConfiguration();
conf.set(OZONE_METADATA_DIRS, tempDir.getAbsolutePath());
DefaultConfigManager.clearDefaultConfigs();
}

@Test
Expand Down Expand Up @@ -293,19 +293,21 @@ public void testSamePortConfig() throws Exception {

}

@Test
public void testDefaultConfigWithInitializedSCM()
@ParameterizedTest
@ValueSource(booleans = {true, false})
public void testDefaultConfigWithInitializedSCM(boolean isRatisEnabled)
throws IOException {
// The default config for RatisEnabled is true.
assertTrue(SCMHAUtils.isSCMHAEnabled(conf));

// If the cluster is already initalized, use the value from StorageConfig.
SCMStorageConfig scmStorageConfig = mock(SCMStorageConfig.class);
when(scmStorageConfig.getState())
.thenReturn(Storage.StorageState.INITIALIZED);
when(scmStorageConfig.isSCMHAEnabled()).thenReturn(false);
DefaultConfigManager.clearDefaultConfigs();
when(scmStorageConfig.isSCMHAEnabled()).thenReturn(isRatisEnabled);
SCMHANodeDetails.loadSCMHAConfig(conf, scmStorageConfig);

assertEquals(SCMHAUtils.isSCMHAEnabled(conf),
scmStorageConfig.isSCMHAEnabled());
when(scmStorageConfig.isSCMHAEnabled()).thenReturn(false);
DefaultConfigManager.clearDefaultConfigs();
assertTrue(SCMHAUtils.isSCMHAEnabled(conf));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/
package org.apache.hadoop.hdds.scm.upgrade;

import org.apache.hadoop.hdds.conf.DefaultConfigManager;
import org.apache.hadoop.hdds.conf.OzoneConfiguration;
import org.apache.hadoop.hdds.scm.HddsTestUtils;
import org.apache.hadoop.hdds.scm.ScmConfig;
Expand Down Expand Up @@ -67,7 +66,6 @@ public void testUpgrade(@TempDir Path dataPath) throws Exception {
conf.set(ScmConfigKeys.OZONE_SCM_DB_DIRS, dataPath.toString());
conf.set(OzoneConfigKeys.OZONE_METADATA_DIRS, dataPath.toString());
// This init should always succeed, since SCM is not pre-finalized yet.
DefaultConfigManager.clearDefaultConfigs();
boolean initResult1 = StorageContainerManager.scmInit(conf, CLUSTER_ID);
assertTrue(initResult1);

Expand All @@ -77,7 +75,6 @@ public void testUpgrade(@TempDir Path dataPath) throws Exception {
scm.getFinalizationManager().getUpgradeFinalizer().getStatus());


DefaultConfigManager.clearDefaultConfigs();
boolean initResult2 = StorageContainerManager.scmInit(conf, CLUSTER_ID);
assertTrue(initResult2);
scm.start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.apache.hadoop.hdds.scm;

import org.apache.hadoop.hdds.client.RatisReplicationConfig;
import org.apache.hadoop.hdds.conf.DefaultConfigManager;
import org.apache.hadoop.hdds.conf.OzoneConfiguration;
import org.apache.hadoop.hdds.protocol.proto.HddsProtos.ReplicationFactor;
import org.apache.hadoop.hdds.scm.container.ContainerInfo;
Expand Down Expand Up @@ -137,7 +136,6 @@ public void stop() {
if (cluster != null) {
cluster.stop();
}
DefaultConfigManager.clearDefaultConfigs();
}

private void createCredentialsInKDC() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.apache.hadoop.hdds.scm;

import org.apache.hadoop.hdds.annotation.InterfaceAudience;
import org.apache.hadoop.hdds.conf.DefaultConfigManager;
import org.apache.hadoop.hdds.conf.OzoneConfiguration;
import org.apache.hadoop.hdds.protocol.SecretKeyProtocol;
import org.apache.hadoop.hdds.scm.server.SCMHTTPServerConfig;
Expand Down Expand Up @@ -119,7 +118,6 @@ public void stop() {
if (cluster != null) {
cluster.stop();
}
DefaultConfigManager.clearDefaultConfigs();
}

private void createCredentialsInKDC() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
package org.apache.hadoop.hdds.scm;

import org.apache.hadoop.hdds.client.RatisReplicationConfig;
import org.apache.hadoop.hdds.conf.DefaultConfigManager;
import org.apache.hadoop.hdds.conf.OzoneConfiguration;
import org.apache.hadoop.hdds.protocol.proto.HddsProtos;
import org.apache.hadoop.hdds.scm.container.ContainerID;
Expand Down Expand Up @@ -118,7 +117,6 @@ public void shutdown() {
if (cluster != null) {
cluster.shutdown();
}
DefaultConfigManager.clearDefaultConfigs();
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.RandomUtils;
import org.apache.hadoop.hdds.annotation.InterfaceAudience;
import org.apache.hadoop.hdds.conf.DefaultConfigManager;
import org.apache.hadoop.hdds.conf.OzoneConfiguration;
import org.apache.hadoop.hdds.scm.OzoneClientConfig;
import org.apache.hadoop.hdds.scm.ScmConfig;
Expand Down Expand Up @@ -157,7 +156,6 @@ public static void stop() {
if (cluster != null) {
cluster.stop();
}
DefaultConfigManager.clearDefaultConfigs();
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import com.google.common.collect.Maps;
import org.apache.hadoop.hdds.annotation.InterfaceAudience;
import org.apache.hadoop.ozone.admin.OzoneAdmin;
import org.apache.hadoop.hdds.conf.DefaultConfigManager;
import org.apache.hadoop.hdds.conf.OzoneConfiguration;
import org.apache.hadoop.hdds.scm.ScmConfig;
import org.apache.hadoop.hdds.scm.server.SCMHTTPServerConfig;
Expand Down Expand Up @@ -127,7 +126,6 @@ public static void stop() {
if (cluster != null) {
cluster.stop();
}
DefaultConfigManager.clearDefaultConfigs();
}

private SecretKeyManager getScmSecretKeyManager() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.apache.hadoop.ozone;

import org.apache.commons.lang3.RandomUtils;
import org.apache.hadoop.hdds.conf.DefaultConfigManager;
import org.apache.hadoop.hdds.conf.OzoneConfiguration;
import org.apache.hadoop.hdds.utils.IOUtils;
import org.apache.hadoop.ozone.client.OzoneClient;
Expand Down Expand Up @@ -121,7 +120,6 @@ public static void stop() {
if (cluster != null) {
cluster.stop();
}
DefaultConfigManager.clearDefaultConfigs();
}

private String initiateMultipartUpload() throws IOException, OS3Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@

import org.apache.commons.validator.routines.DomainValidator;
import org.apache.hadoop.hdds.HddsConfigKeys;
import org.apache.hadoop.hdds.conf.DefaultConfigManager;
import org.apache.hadoop.hdds.conf.OzoneConfiguration;
import org.apache.hadoop.hdds.protocol.proto.HddsProtos;
import org.apache.hadoop.hdds.protocol.proto.SCMSecurityProtocolProtos;
Expand Down Expand Up @@ -280,7 +279,6 @@ void stop() throws Exception {
} catch (Exception e) {
LOG.error("Failed to stop TestSecureOzoneCluster", e);
}
DefaultConfigManager.clearDefaultConfigs();
}

private void createCredentialsInKDC() throws Exception {
Expand Down
Loading