附加到现有序列文件

nzk0hqpo  于 2021-05-30  发布在  Hadoop
关注(0)|答案(2)|浏览(308)

在我的用例中,我需要一种方法来将键/值对附加到现有的序列文件中。怎么做?任何线索都会大有帮助。我正在使用hadoop 2x。
另外,我还看到了下面的文档。有人能告诉我怎么用这个附加吗?
public static org.apache.hadoop.io.sequencefile.writer createwriter(filecontext fc,configuration,path name,class keyclass,class valclass,org.apache.hadoop.io.sequencefile.compressiontype compressioncodec codec,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
wtzytmuj

wtzytmuj1#

更新:问题hadoop-7139现在已经关闭,从版本2.6.1/2.7.2可以附加到现有的sequencefile:)
(我当时使用的是2.7.1版本,正在查找附加到sequencefile,因此我将其降级到2.6.1版本,因为2.7.2版本尚未发布)

83qze16e

83qze16e2#

仍然无法附加到现有的序列文件。
有一个悬而未决的问题,但它仍然没有解决。

相关问题