Let’s say you need to get the name of hdfs cluster in an application. To do this, you need to get the org.apache.hadoop.conf.Configuration object:
@Autowired Configuration conf;
In the place we need, we get the fs.defaultFS property value:
String hdfsName = conf.get("fs.defaultFS"); log.info("HDFS cluster name = " + name);
If you still have any questions, feel free to ask me in the comments under this article, or write me on firstname.lastname@example.org.
If I saved your day, you can support me :)