java - Hadoop - remove newline from reducer output -


my hadoop program reads thousands of line (.log) file , parse them.after write them file using output.collect() function.but after each reducer output writes output newline.how can write on same line , how make can make sure output file 1 line?

reducer class

 public class reduce extends mapreducebase     implements reducer<text, text, text, text> {      public void reduce(text key, iterator<text> values,outputcollector<text, text> output,             reporter reporter) throws ioexception {         text t2 = new text("");       output.collect(key, t2);     }   } 

mapper class

    public void map(longwritable key, text value,                          outputcollector<text, text> output,                          reporter reporter) throws ioexception {        path("xxxx");//location of file in hdfs inputstreamreader(fs.open(pt)));                  string line = value.tostring();                  string bepublished="";                string patternstring = "xxxx;                pattern pattern = pattern.compile(patternstring);                matcher matcher = pattern.matcher(line);                     for(int u=0;u<48;u++){        //here update bepublished string                      }                   text t2 = new text("");                  output.collect(new text(bepublished), t2);           } 


Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

How to provide Authorization & Authentication using Asp.net, C#? -

How to use Authorization & Authentication in Asp.net, C#? -