title: Writing to HDFS : File is overwritten
body: <p>I am writing to hadoop file system. But everytime I append something, it overwrites the data instead of adding it to the existing data/file. The code which is doing this is provided below. This code is called again and again for different data. Is opening a new SequenceFile.Writer everytime a problem?</p>
  
  <p>Each time I am getting the path as new Path("someDir");</p>
  
  <pre><code>  public void writeToHDFS(Path path, long uniqueId, String data){
        FileSystem fs = path.getFileSystem(conf);
        SequenceFile.Writer inputWriter = new SequenceFile.Writer(fs, conf,
            path, LongWritable.class, MyWritable.class);
        inputWriter.append(new LongWritable(uniqueId++), new MyWritable(data));
        inputWriter.close();
    }
  </code></pre>