1

I have a Hadoop program in which I need to add a couple of line to the beginning of the reducer's output file (when it's done) in my Java program. I'm using the following code

 RandomAccessFile f = new RandomAccessFile(new File("/user/hzakerza/graph/output9/part-r-00000"), "rw");
 f.seek(0);             
 f.writeChars("some line");
 f.close();

However it gives me an error that the file does not exist. How can I insert a few lines to this file within my Java program?

Simulant
  • 19,190
  • 8
  • 63
  • 98
HHH
  • 6,085
  • 20
  • 92
  • 164

0 Answers0