Reputation: 899
I just wanted to try a tutorial (https://ccp.cloudera.com/display/DOC/Hadoop+Tutorial) program WordCount V.2 (bottom of the page) in which they are using the following method to set up some basic variables for the programm:
public void configure(JobConf job) {
...
}
However I'm trying to use the new Hadoop API and this method does not seem to exist anymore? Can anyone tell me what the equivalent way of doing something like this in the new API is?
Also how can I access my Configuration during runtime? Do I simply call:
Job.getConfiguration();
Upvotes: 0
Views: 463
Reputation: 20969
You can override the setup method in your Mapper
/Reducer
, this will behave like configure
.
The signature looks as follows:
@Override
protected void setup(Context context) throws IOException,
InterruptedException {
There you get a Context
object, where you can call:
Configuration conf = context.getConfiguration();
map
and cleanup
, both have these context objects, so you can get your Configuration
anytime.
Upvotes: 2