在我的用例中,我需要一种将键/值对附加到现有序列文件的方法。怎么做?任何线索都会有很大帮助。我正在使用 hadoop 2x。
另外,我遇到了以下文档。谁能告诉我如何使用它来追加?
public static org.apache.hadoop.io.SequenceFile.Writer createWriter(FileContext fc, Configuration conf, Path name, Class keyClass, Class valClass, org.apache.hadoop.io.SequenceFile.CompressionType compressionType, CompressionCodec codec, org.apache. hadoop.io.SequenceFile.Metadata 元数据,EnumSet createFlag,org.apache.hadoop.fs.Options.CreateOpts...opts) 抛出 IOException
Construct the preferred type of SequenceFile Writer.
Parameters:
fc - The context for the specified file.
conf - The configuration.
name - The name of the file.
keyClass - The 'key' type.
valClass - The 'value' type.
compressionType - The compression type.
codec - The compression codec.
metadata - The metadata of the file.
**createFlag - gives the semantics of create: overwrite, append etc.**
opts - file creation options; see Options.CreateOpts.
Returns:
Returns the handle to the constructed SequenceFile Writer.
Throws:
IOException