Changes between Version 2 and Version 3 of NCHCCloudCourse100929_4_HBEX7


Ignore:
Timestamp:
Sep 28, 2010, 8:25:45 PM (14 years ago)
Author:
waue
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • NCHCCloudCourse100929_4_HBEX7

    v2 v3  
    1515        此程式碼將HBase的資料取出來,再將結果塞回hdfs上
    1616
    17  == 結果: ==
    18 {{{
    19  $ hadoop fs -cat <hdfs_output>/part-r-00000
    2017
    21         54 30 31        GunLong
    22         54 30 32        Esing
    23         54 30 33        SunDon
    24         54 30 34        StarBucks
    25 }}}
    2618== 注意: ==
    27 1.      請注意hbase 上必須要有 table, 並且已經有資料
     191.      請注意之前已經run 過 範例六
    2820
    29212.      運算完後,程式將執行結果放在你指定 hdfs的<hdfs_output> 內
     
    9082  public static void main(String args[]) throws Exception {
    9183    // debug
    92 //    String[] argv = { "wordcount", "output-lhm" };
     84//    String[] argv = { "output-lhm" };
    9385//    args = argv;
    9486
    95     String tablename = args[0] ;
     87    String tablename = "wordcount";
    9688
    9789    Configuration conf = new Configuration();
     
    121113    job.setOutputValueClass(Text.class);
    122114
    123     FileOutputFormat.setOutputPath(job, new Path(args[1]));
     115    FileOutputFormat.setOutputPath(job, new Path(args[0]));
    124116
    125117    System.exit(job.waitForCompletion(true) ? 0 : 1);
     
    127119}
    128120
     121
    129122}}}
    130123
     124 * 執行結果
    131125
     126觀察 /user/hadoop/output-lhm/part-r-00000 檔案的結果