1

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.

1
  • you can set some value in conf objet and retrive it in reducer Commented Apr 7, 2013 at 12:57

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.