DataNode: using hostname as node name default (#17025)

* using the hostname as the default node-name, if none was specified explicitly

* using the hostname as the default node-name, if none was specified explicitly

* using the hostname as the default node-name, if none was specified explicitly

* nodeName is either set explicitly in the conf file or will be the result of the hostname setting otherwise

* small refactoring
This commit is contained in:
Jan Heise
2023-10-24 11:01:20 +02:00
committed by GitHub
parent ebc0e8dc24
commit d709ae84da
7 changed files with 12 additions and 19 deletions

View File

@@ -310,7 +310,7 @@ public class Configuration extends BaseConfiguration {
}
public String getDatanodeNodeName() {
return datanodeNodeName;
return datanodeNodeName != null && !datanodeNodeName.isBlank() ? datanodeNodeName : getHostname();
}
public String getInitialManagerNodes() {