附加到现有序列文件

时间:2014-09-15 10:09:19

标签: hadoop sequencefile

在我的用例中,我需要找到一种方法将键/值对附加到现有的序列文件中。怎么做?任何线索都会有很大帮助。我正在使用hadoop 2x。

另外,我遇​​到了以下文档。任何人都可以告诉我如何使用它来追加?

public static org.apache.hadoop.io.SequenceFile.Writer createWriter(FileContext fc,                                                                     配置conf,                                                                     路径名称,                                                                     类keyClass,                                                                     类valClass,                                                                     org.apache.hadoop.io.SequenceFile.CompressionType compressionType,                                                                     CompressionCodec编解码器,                                                                     org.apache.hadoop.io.SequenceFile.Metadata 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

2 个答案:

答案 0 :(得分:1)

更新:issue HADOOP-7139现已关闭,版本为2.6.1 / 2.7.2 可以附加到现有的SequenceFile :)

(我使用的是2.7.1版并寻找附加到SequenceFile,所以我将其降级为2.6.1因为版本2.7.2它还没有出来)

答案 1 :(得分:0)

仍然无法附加到现有的序列文件。

有一个开放的issue可以解决这个问题,但它还没有解决。