1

在我的用例中,我需要一种将键/值对附加到现有序列文件的方法。怎么做?任何线索都会有很大帮助。我正在使用 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
4

2 回答 2

1

更新:问题 HADOOP-7139现在已关闭,并且从版本 2.6.1 / 2.7.2开始可以附加到现有的 SequenceFile :)

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

于 2015-10-28T08:15:56.377 回答
0

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

有一个悬而未决的问题需要解决,但仍未解决。

于 2015-06-02T23:44:38.183 回答