自定義信息1
26-Oct-2013 22:41:41
10
task_xx_m_2
自定義信息2
26-Oct-2013 22:41:41
10
更多的執行過程信息,我們則通過“org.apache.commons.logging.Log”來收集,通過tasklog頁面可以查閱到這些詳細的日志信息。
作為map task的輸入,我通過在hdfs上生成的一堆隨機數據來實現,InputSplit類讀取了hdfs上作為模擬真實數據的輸入后,將其根據map數切分成n份(n=自定義的map數量),并將其分發給對應的map task,map task拿到自己那份數據后,立即啟動多個線程執行上述測試工具代碼:
public void map(LongWritable key, List<Pair> value, OutputCollector<Text, LongWritable> context, Reporter reporter) throws IOException { 。。。。。。 for(int i=0; i < this.threadnum; i++){ SCNThread t = new SCNThread(value, reporter, start, this); t.start(); this.alivethread.addAndGet(1); } 。。。。。。 |
原文轉自:http://www.taobaotest.com/blogs/2515