What is Keyword Context in Hadoop programming worl

2019-01-14 18:56发布

What exactly is this keyword Context in Hadoop MapReduce world in new API terms?

Its extensively used to write output pairs out of Maps and Reduce, however I am not sure if it can be used somewhere else and what's exactly happening whenever I use context. Is it a Iterator with different name?

What is relation between Class Mapper.Context, Class Reducer.Context and Job.Context?

Can someone please explain this starting with Layman's terms and then going in detail. Not able understand much from Hadoop API documentations.

Thanks for your time and help.

2条回答
The star\"
2楼-- · 2019-01-14 19:09

The new API makes extensive use of Context objects that allow the user code to communicate with MapRduce system.

It unifies the role of JobConf, OutputCollector, and Reporter from old API.

查看更多
一纸荒年 Trace。
3楼-- · 2019-01-14 19:12

Context object: allows the Mapper/Reducer to interact with the rest of the Hadoop system. It includes configuration data for the job as well as interfaces which allow it to emit output.

Applications can use the Context:

  • to report progress
  • to set application-level status messages
  • update Counters
  • indicate they are alive
  • to get the values that are stored in job configuration across map/reduce phase.
查看更多
登录 后发表回答