hadoop-mapreduce-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrea Barbato <and.barb...@gmail.com>
Subject Hadoop Pipes C++ Simple Question
Date Fri, 10 Jan 2014 16:44:50 GMT
Hi, i have a simple question.
I have this example code:

class WordCountMapper : public HadoopPipes::Mapper {public:
  // constructor: does nothing
  WordCountMapper( HadoopPipes::TaskContext& context ) { }
  // map function: receives a line, outputs (word,"1") to reducer.
  void map( HadoopPipes::MapContext& context ) { ... }
  }};
class WordCountReducer : public HadoopPipes::Reducer {public:
  // constructor: does nothing
  WordCountReducer(HadoopPipes::TaskContext& context) {}
  // reduce function
  void reduce( HadoopPipes::ReduceContext& context ) { ... }};
int main(int argc, char *argv[]) {
  return HadoopPipes::runTask(HadoopPipes::TemplateFactory<WordCountMapper,WordCountReducer>()
);}

Can I write some code lines (like the I/O operations) in the main function
body?
Thanks in advance.

Mime
View raw message