Changes between Version 13 and Version 14 of LogParser


Ignore:
Timestamp:
Jul 7, 2008, 12:13:29 PM (16 years ago)
Author:
waue
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • LogParser

    v13 v14  
    3939        public static class MapClass extends MapReduceBase implements
    4040                        Mapper<WritableComparable, Text, Text, Writable> {
    41                 @Override
    42                 // MapReduceBase.configure(JobConf job)
    43                 // Default implementation that does nothing.
    4441                public void configure(JobConf job) {
    45                         // String get(String name,String defaultValue)
    46                         // Get the value of the name property. If no such property exists,\
    47                         //      then defaultValue is returned.
    4842                        tableName = job.get(TABLE, "");
    4943                }
    50 
    5144                public void map(WritableComparable key, Text value,
    5245                                OutputCollector<Text, Writable> output, Reporter reporter)
    5346                                throws IOException {
    54                        
    5547                        try {
    56                                 /*
    57                                 print(value.toString());
    58                                 FileWriter out = new FileWriter(new File(
    59                                 "/home/waue/mr-result.txt"));
    60                                 out.write(value.toString());
    61                                 out.flush();
    62                                 out.close();
    63                                 */
    6448                                LogParser log = new LogParser(value.toString());
    65                                
    6649                                if (table == null)
    6750                                        table = new HTable(conf, new Text(tableName));
     
    8265                                                log.getUrl().getBytes());
    8366                                table.commit(lockId, log.getTimestamp());
    84                                
    8567                        } catch (Exception e) {
    8668                                e.printStackTrace();
    8769                        }
    88                        
    8970                }
    9071        }