Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
MapReduce >> mail # user >>


Of course you can, you can think this as an independent runnable program.
2014/1/11 Andrea Barbato <[EMAIL PROTECTED]>

> 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.
>

--
Best Wishes!

Yours, Zesheng
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB