◢ <[wiki:III131019/Lab16 實作十六]> | <[wiki:III131019 回課程大綱]> ▲ | <[wiki:III131019/Lab18 實作十八]> ◣
= 實作十七 Lab17 =
{{{
#!html
將 WordCount 範例改成三個公開的類別
Inner Class v.s. Public Classes
}}}
[[PageOutline]]
{{{
#!text
請先連線至 nodeN.3du.me , N 為您的報名編號
}}}
* 在前兩個範例中,我們可以發現 WordCount 範例程式都是以所謂的 Inner Class 語法撰寫而成,那是否可以改寫成多個 Public Class 呢?答案是可以的!
{{{
cd ~/hadoop_labs/lab009
ant
hadoop fs -rmr input output
hadoop fs -put ~/hadoop/conf input
hadoop jar WordCount.jar input output
hadoop fs -ls output
hadoop fs -cat output/part-r-00000
}}}
== 實作習題 ==
<問題 1> 請比較 ${HOME}/hadoop_labs/lab007/class 與 ${HOME}/hadoop_labs/lab009/class 的內容,以下哪幾個陳述是正確的?(複選)
{{{
#!text
(A) Only in ${HOME}/hadoop_labs/lab009/class/: IntSumReducer.class
(B) Only in ${HOME}/hadoop_labs/lab009/class/: TokenizerMapper.class
(C) Only in ${HOME}/hadoop_labs/lab007/class/: WordCount$IntSumReducer.class
(D) Only in ${HOME}/hadoop_labs/lab007/class/: WordCount$TokenizerMapper.class
(D) Only in ${HOME}/hadoop_labs/lab007/class/: WordCount.class
}}}
<問題 2> 請問執行任務時,同時有幾個 Mapper?
<問題 3> 請問執行任務時,同時有幾個 Reducer?
<問題 4> 請問執行任務時,同一個 Map Task 會有幾個 Task Attempt?
{{{
#!text
(A) 0
(B) 1 個(含)以上
}}}