lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-2373) Create a Codec to work with streaming and append-only filesystems
Date Sat, 26 Jun 2010 00:28:50 GMT

    [ https://issues.apache.org/jira/browse/LUCENE-2373?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12882782#action_12882782
] 

Robert Muir commented on LUCENE-2373:
-------------------------------------

{quote}
Note 2: o.a.l.index.codecs.* doesn't have access to many package-level APIs from o.a.l.index.*,
so I had to relax the visibility of some methods and fields. Perhaps this may be tightened
back in a later revision...
{quote}

Hi, I wouldn't worry about this. In general Mike had this problem when moving things to the
codec package, so we added a javadocs tag for consistent labeling: @lucene.internal

This expands to the following text: NOTE: This API is for Lucene internal purposes only and
might change in incompatible ways in the next release.

Example usage: http://svn.apache.org/repos/asf/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/IndexFileNames.java

Additionally we added another tag: @lucene.experimental, which you can use for any new APIs
you introduce that might not have the final stable API (most codecs use this already I think).

This expands to the following text: WARNING: This API is experimental and might change in
incompatible ways in the next release.

Example usage:
http://svn.apache.org/repos/asf/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/pulsing/PulsingCodec.java


> 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
>
>
> 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message