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?