Changes between Version 2 and Version 3 of NCHCCloudCourse100929_4_HBEX7
- Timestamp:
- Sep 28, 2010, 8:25:45 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
NCHCCloudCourse100929_4_HBEX7
v2 v3 15 15 此程式碼將HBase的資料取出來,再將結果塞回hdfs上 16 16 17 == 結果: ==18 {{{19 $ hadoop fs -cat <hdfs_output>/part-r-0000020 17 21 54 30 31 GunLong22 54 30 32 Esing23 54 30 33 SunDon24 54 30 34 StarBucks25 }}}26 18 == 注意: == 27 1. 請注意 hbase 上必須要有 table, 並且已經有資料19 1. 請注意之前已經run 過 範例六 28 20 29 21 2. 運算完後,程式將執行結果放在你指定 hdfs的<hdfs_output> 內 … … 90 82 public static void main(String args[]) throws Exception { 91 83 // debug 92 // String[] argv = { " wordcount", "output-lhm" };84 // String[] argv = { "output-lhm" }; 93 85 // args = argv; 94 86 95 String tablename = args[0];87 String tablename = "wordcount"; 96 88 97 89 Configuration conf = new Configuration(); … … 121 113 job.setOutputValueClass(Text.class); 122 114 123 FileOutputFormat.setOutputPath(job, new Path(args[ 1]));115 FileOutputFormat.setOutputPath(job, new Path(args[0])); 124 116 125 117 System.exit(job.waitForCompletion(true) ? 0 : 1); … … 127 119 } 128 120 121 129 122 }}} 130 123 124 * 執行結果 131 125 126 觀察 /user/hadoop/output-lhm/part-r-00000 檔案的結果