Skip to content

Commit 371c9eb

Browse files
committed
Revert "HDDS-1596. Create service endpoint to download configuration from SCM."
This reverts commit c0499bd.
1 parent 16576fd commit 371c9eb

File tree

22 files changed

+23
-504
lines changed

22 files changed

+23
-504
lines changed

hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/conf/OzoneConfiguration.java

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -47,43 +47,19 @@ public class OzoneConfiguration extends Configuration {
4747
}
4848

4949
public OzoneConfiguration() {
50-
this(false);
51-
}
52-
53-
private OzoneConfiguration(boolean justTheDefaults) {
5450
OzoneConfiguration.activate();
5551
loadDefaults();
56-
if (!justTheDefaults) {
57-
loadConfigFiles();
58-
}
59-
}
60-
61-
private void loadConfigFiles() {
62-
addResource("ozone-global.xml");
63-
addResource("ozone-site.xml");
6452
}
6553

6654
public OzoneConfiguration(Configuration conf) {
67-
this(conf, false);
68-
}
69-
70-
private OzoneConfiguration(Configuration conf, boolean justTheDefaults) {
7155
super(conf);
7256
//load the configuration from the classloader of the original conf.
7357
setClassLoader(conf.getClassLoader());
7458
if (!(conf instanceof OzoneConfiguration)) {
7559
loadDefaults();
76-
//here we load the REAL configuration.
77-
if (!justTheDefaults) {
78-
loadConfigFiles();
79-
}
8060
}
8161
}
8262

83-
public static OzoneConfiguration createWithDefaultsOnly() {
84-
return new OzoneConfiguration(true);
85-
}
86-
8763
private void loadDefaults() {
8864
try {
8965
//there could be multiple ozone-default-generated.xml files on the
@@ -98,6 +74,7 @@ private void loadDefaults() {
9874
} catch (IOException e) {
9975
e.printStackTrace();
10076
}
77+
addResource("ozone-site.xml");
10178
}
10279

10380
public List<Property> readPropertyFromXml(URL url) throws JAXBException {
@@ -339,9 +316,4 @@ public Properties getAllPropertiesByTag(String tag) {
339316
}
340317
return props;
341318
}
342-
343-
@Override
344-
public synchronized Properties getProps() {
345-
return super.getProps();
346-
}
347319
}

hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/discovery/DiscoveryUtil.java

Lines changed: 0 additions & 90 deletions
This file was deleted.

hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/discovery/package-info.java

Lines changed: 0 additions & 22 deletions
This file was deleted.

hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/HddsDatanodeService.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.apache.hadoop.hdds.cli.GenericCli;
2626
import org.apache.hadoop.hdds.cli.HddsVersionProvider;
2727
import org.apache.hadoop.hdds.conf.OzoneConfiguration;
28-
import org.apache.hadoop.hdds.discovery.DiscoveryUtil;
2928
import org.apache.hadoop.hdds.protocol.DatanodeDetails;
3029
import org.apache.hadoop.hdds.protocol.proto.SCMSecurityProtocolProtos.SCMGetCertResponseProto;
3130
import org.apache.hadoop.hdds.protocolPB.SCMSecurityProtocolClientSideTranslatorPB;
@@ -141,12 +140,7 @@ public Void call() throws Exception {
141140
StringUtils
142141
.startupShutdownMessage(HddsDatanodeService.class, args, LOG);
143142
}
144-
OzoneConfiguration ozoneConfiguration = createOzoneConfiguration();
145-
if (DiscoveryUtil.loadGlobalConfig(ozoneConfiguration)) {
146-
//reload the configuration with the downloaded new configs.
147-
ozoneConfiguration = createOzoneConfiguration();
148-
}
149-
start(ozoneConfiguration);
143+
start(createOzoneConfiguration());
150144
join();
151145
return null;
152146
}

hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/BaseHttpServer.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import javax.servlet.http.HttpServlet;
3434
import java.io.IOException;
3535
import java.net.InetSocketAddress;
36-
import java.util.Map;
3736
import java.util.Optional;
3837

3938
import static org.apache.hadoop.hdds.HddsUtils.getHostNameFromConfigKeys;
@@ -128,18 +127,6 @@ protected void addServlet(String servletName, String pathSpec,
128127
httpServer.addServlet(servletName, pathSpec, clazz);
129128
}
130129

131-
/**
132-
* Add a servlet to BaseHttpServer.
133-
*
134-
* @param servletName The name of the servlet
135-
* @param pathSpec The path spec for the servlet
136-
* @param clazz The servlet class
137-
*/
138-
protected void addInternalServlet(String servletName, String pathSpec,
139-
Class<? extends HttpServlet> clazz, Map<String, String> initParams) {
140-
httpServer.addInternalServlet(servletName, pathSpec, clazz, initParams);
141-
}
142-
143130
/**
144131
* Returns the WebAppContext associated with this HttpServer.
145132
*

hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/ServerUtils.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,7 @@ public static InetSocketAddress updateRPCListenAddress(
9696
rpcServer.getListenerAddress());
9797
}
9898

99-
public static InetSocketAddress updateRPCListenPort(
100-
OzoneConfiguration conf, String rpcAddressKey,
101-
InetSocketAddress listenerAddress) {
102-
String originalValue = conf.get(rpcAddressKey);
103-
//remove existing port
104-
originalValue = originalValue.replaceAll(":.*", "");
105-
conf.set(rpcAddressKey,
106-
originalValue + ":" + listenerAddress.getPort());
107-
return new InetSocketAddress(originalValue,
108-
listenerAddress.getPort());
109-
}
99+
110100
/**
111101
* After starting an server, updates configuration with the actual
112102
* listening address of that server. The listening address may be different

hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/server/TestServerUtils.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,11 @@
2323
import org.apache.hadoop.hdds.conf.OzoneConfiguration;
2424
import org.apache.hadoop.hdds.scm.ScmConfigKeys;
2525
import org.apache.hadoop.test.PathUtils;
26-
27-
import org.junit.Assert;
2826
import org.junit.Rule;
2927
import org.junit.Test;
3028
import org.junit.rules.ExpectedException;
3129

3230
import java.io.File;
33-
import java.net.InetSocketAddress;
3431

3532
import static org.junit.Assert.assertEquals;
3633
import static org.junit.Assert.assertFalse;
@@ -123,18 +120,4 @@ public void ozoneMetadataDirRejectsList() {
123120
ServerUtils.getOzoneMetaDirPath(conf);
124121
}
125122

126-
@Test
127-
public void updateRpcListenPort() {
128-
OzoneConfiguration conf = new OzoneConfiguration();
129-
130-
conf.set("test1", "localhost:0");
131-
ServerUtils.updateRPCListenPort(conf, "test1",
132-
new InetSocketAddress("0.0.0.0", 1234));
133-
Assert.assertEquals("localhost:1234", conf.get("test1"));
134-
135-
conf.set("test2", "localhost");
136-
ServerUtils.updateRPCListenPort(conf, "test2",
137-
new InetSocketAddress("0.0.0.0", 1234));
138-
Assert.assertEquals("localhost:1234", conf.get("test2"));
139-
}
140123
}

hadoop-hdds/pom.xml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -191,27 +191,6 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
191191
<version>${bouncycastle.version}</version>
192192
</dependency>
193193

194-
<dependency>
195-
<groupId>com.sun.xml.bind</groupId>
196-
<artifactId>jaxb-impl</artifactId>
197-
<version>2.3.0.1</version>
198-
</dependency>
199-
<dependency>
200-
<groupId>com.sun.xml.bind</groupId>
201-
<artifactId>jaxb-core</artifactId>
202-
<version>2.3.0.1</version>
203-
</dependency>
204-
<dependency>
205-
<groupId>javax.xml.bind</groupId>
206-
<artifactId>jaxb-api</artifactId>
207-
<version>2.3.0</version>
208-
</dependency>
209-
<dependency>
210-
<groupId>javax.activation</groupId>
211-
<artifactId>activation</artifactId>
212-
<version>1.1.1</version>
213-
</dependency>
214-
215194
<dependency>
216195
<groupId>org.junit.jupiter</groupId>
217196
<artifactId>junit-jupiter-api</artifactId>

hadoop-hdds/server-scm/pom.xml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,24 +54,6 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
5454
<artifactId>hadoop-hdds-docs</artifactId>
5555
</dependency>
5656

57-
<dependency>
58-
<groupId>com.sun.xml.bind</groupId>
59-
<artifactId>jaxb-impl</artifactId>
60-
</dependency>
61-
<dependency>
62-
<groupId>com.sun.xml.bind</groupId>
63-
<artifactId>jaxb-core</artifactId>
64-
</dependency>
65-
<dependency>
66-
<groupId>javax.xml.bind</groupId>
67-
<artifactId>jaxb-api</artifactId>
68-
</dependency>
69-
<dependency>
70-
<groupId>javax.activation</groupId>
71-
<artifactId>activation</artifactId>
72-
</dependency>
73-
74-
7557
<dependency>
7658
<groupId>org.apache.hadoop</groupId>
7759
<artifactId>hadoop-hdds-container-service</artifactId>

hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/discovery/ConfigurationEndpoint.java

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)