wiki:NTUOSS160412/Lab7

◢ <實作六> | <回課程大綱> ▲ | <作業> ◣

實作七 Lab7

編譯 WordCount 範例

  • 在 lab007 與 lab008 範例程式中,我們可以發現 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 的內容,以下哪幾個陳述是正確的?(複選) <提示>

diff ${HOME}/hadoop_labs/lab007/class ${HOME}/hadoop_labs/lab009/class
      (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
      (E) Only in ${HOME}/hadoop_labs/lab007/class/: WordCount.class

<問題 2> 請問執行任務時,同時有幾個 Mapper?

      (A) 0
      (B) 同 input 目錄檔案區塊個數

<問題 3> 請問執行任務時,同時有幾個 Reducer?

      (A) 0
      (B) 1
      (C) 2
      (D) 3

<問題 4> 請問執行任務時,同一個 Map Task 會有幾個 Task Attempt?

      (A) 0
      (B) 1 個(含)以上
Last modified 9 years ago Last modified on Apr 11, 2016, 3:46:29 PM