close
Warning:
Can't synchronize with repository "(default)" (Unsupported version control system "svn": /usr/lib/python2.7/dist-packages/libsvn/_fs.so: failed to map segment from shared object: Cannot allocate memory). Look in the Trac log for more information.
- Timestamp:
-
Sep 28, 2010, 10:02:52 AM (15 years ago)
- Author:
-
waue
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
|
v1
|
v2
|
|
| 10 | 10 | [wiki:NCHCCloudCourse100928_4_EXM4 上一關 < ] 第五關 [wiki:NCHCCloudCourse100928_4_EXM6 > 下一關] |
| 11 | 11 | |
| | 12 | = 說明 = |
| | 13 | {{{ |
| | 14 | #!text |
| | 15 | WordCountV2 |
| | 16 | 說明: |
| | 17 | 用於字數統計,並且增加略過大小寫辨識、符號篩除等功能 |
| | 18 | |
| | 19 | 測試方法: |
| | 20 | 將此程式運作在hadoop 0.20 平台上,執行: |
| | 21 | --------------------------- |
| | 22 | hadoop jar WordCountV2.jar -Dwordcount.case.sensitive=false \ |
| | 23 | <input> <output> -skip patterns/patterns.txt |
| | 24 | --------------------------- |
| | 25 | |
| | 26 | 注意: |
| | 27 | 1. 在hdfs 上來源檔案的路徑為 你所指定的 <input> |
| | 28 | 請注意必須先放資料到此hdfs上的資料夾內,且此資料夾內只能放檔案,不可再放資料夾 |
| | 29 | 2. 運算完後,程式將執行結果放在hdfs 的輸出路徑為 你所指定的 <output> |
| | 30 | 3. 請建立一個資料夾 pattern 並在裡面放置pattern.txt,內容如下(一行一個,前置提示符號\) |
| | 31 | \. |
| | 32 | \, |
| | 33 | \! |
| | 34 | |
| | 35 | }}} |
| | 36 | |
| | 37 | = WordCountV2.java = |
| 12 | 38 | |
| 13 | 39 | {{{ |
| … |
… |
|
| 47 | 73 | import org.apache.hadoop.util.ToolRunner; |
| 48 | 74 | |
| 49 | | //WordCountV2 |
| 50 | | //說明: |
| 51 | | // 用於字數統計,並且增加略過大小寫辨識、符號篩除等功能 |
| 52 | | // |
| 53 | | //測試方法: |
| 54 | | // 將此程式運作在hadoop 0.20 平台上,執行: |
| 55 | | // --------------------------- |
| 56 | | // hadoop jar WordCountV2.jar -Dwordcount.case.sensitive=false \ |
| 57 | | // <input> <output> -skip patterns/patterns.txt |
| 58 | | // --------------------------- |
| 59 | | // |
| 60 | | //注意: |
| 61 | | //1. 在hdfs 上來源檔案的路徑為 你所指定的 <input> |
| 62 | | // 請注意必須先放資料到此hdfs上的資料夾內,且此資料夾內只能放檔案,不可再放資料夾 |
| 63 | | //2. 運算完後,程式將執行結果放在hdfs 的輸出路徑為 你所指定的 <output> |
| 64 | | //3. 請建立一個資料夾 pattern 並在裡面放置pattern.txt,內容如下(一行一個,前置提示符號\) |
| 65 | | // \. |
| 66 | | // \, |
| 67 | | // \! |
| 68 | | |
| 69 | 75 | @SuppressWarnings("deprecation") |
| 70 | 76 | public class WordCountV2 extends Configured implements Tool { |