If it's all in the same JVM you could set a static class variable in the reducer's setup() method... or any other class as appropriate.
Accessing hadoop config setting without having to pass Configuration object through many layers
-
02-04-2022 - |
Domanda
In the hadoop project I am working on, I need to access a setting in the hadoop Configuration
object. However, I only need this setting many, many layers into the reducer, and I really would rather not pass the Context
or Configuration
objects through so many constructors just for this purpose.
Is there a way I can somehow get access to this setting without passing the configuration through everything between the reducer and the actual class that needs it?
One potential solution I have in mind is to set the configuration setting as a java system property at the start of the reducer, so that way I can access it using System.getProperty()
but I'd like to know if there are any cleaner methods.
Soluzione
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow