[jira] Updated: (LUCENE-2373) Create a Codec to work with streaming and append-only filesystems

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[jira] Updated: (LUCENE-2373) Create a Codec to work with streaming and append-only filesystems

Michael Gibney (Jira)

     [ https://issues.apache.org/jira/browse/LUCENE-2373?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless updated LUCENE-2373:

    Attachment: LUCENE-2373.patch

Patch looks great!  Thanks Andrzej.

I tweaked a few things -- added some missing copyrights, removed some unnecessary imports, etc.  I also strengthened the test a bit, by having it write 2 segments and then optimize them, which hit an exception because seek was called when building the compound file doc store (cfx) file.  So I fixed test to also disable that compound-file, and added explanation of this in AppendingCodec's jdocs.

We still need a CHANGES entry, but... should this go into contrib/misc instead of core?  Few people need to use appending codec?

> Create a Codec to work with streaming and append-only filesystems
> -----------------------------------------------------------------
>                 Key: LUCENE-2373
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2373
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>            Reporter: Andrzej Bialecki
>             Fix For: 4.0
>         Attachments: appending.patch, appending.patch, LUCENE-2373.patch
> Since early 2.x times Lucene used a skip/seek/write trick to patch the length of the terms dict into a place near the start of the output data file. This however made it impossible to use Lucene with append-only filesystems such as HDFS.
> In the post-flex trunk the following code in StandardTermsDictWriter initiates this:
> {code}
>     // Count indexed fields up front
>     CodecUtil.writeHeader(out, CODEC_NAME, VERSION_CURRENT);
>     out.writeLong(0);                             // leave space for end index pointer
> {code}
> and completes this in close():
> {code}
>       out.seek(CodecUtil.headerLength(CODEC_NAME));
>       out.writeLong(dirStart);
> {code}
> I propose to change this layout so that this pointer is stored simply at the end of the file. It's always 8 bytes long, and we known the final length of the file from Directory, so it's a single additional seek(length - 8) to read it, which is not much considering the benefits.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]