Append to hadoop sequence file

129 views Asked by At

Is there any java api to append sequence file in hdfs. I am able to write the file for the first time, but once i close the writer object and opening it again for appending some more data it is giving exception.

fileWriter = SequenceFile.createWriter(fileContext, configuration, filePath, 
    Text.class, Text.class, 
    CompressionType.NONE, new DefaultCodec(), 
    new SequenceFile.Metadata(),
    EnumSet.of(CreateFlag.CREATE, CreateFlag.APPEND), 
    Options.CreateOpts.createParent()); 
fileWriter.append(something);
fileWriter.close(); 

Again opening the file writer for append more

fileWriter = SequenceFile.createWriter(...); 

then append more is not working

0

There are 0 answers