lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Grant Ingersoll (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-662) Extendable writer and reader of field data
Date Sat, 10 Mar 2007 00:36:09 GMT

    [ https://issues.apache.org/jira/browse/LUCENE-662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12479779
] 

Grant Ingersoll commented on LUCENE-662:
----------------------------------------

Hi Nicolas,

I tried applying indexFormat.patch and am getting:
grantingersoll@britta[1016]$ patch -p 0 -i ../patches/indexFormat.patch --dry-run
patching file src/test/org/apache/lucene/store/IndexInputTest.java
patching file src/test/org/apache/lucene/index/DocHelper.java
patching file src/test/org/apache/lucene/index/TestIndexFormat.java
can't find file to patch at input line 369
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|
|Property changes on: src/test/org/apache/lucene/index/TestIndexFormat.java
|___________________________________________________________________
|Name: svn:keywords
|   + Date Revision Author HeadURL Id
|Name: svn:eol-style
|   + native
|
|Index: src/test/org/apache/lucene/index/impl/TestSegmentTermDocs.java
|===================================================================
|--- src/test/org/apache/lucene/index/impl/TestSegmentTermDocs.java     (revision 0)
|+++ src/test/org/apache/lucene/index/impl/TestSegmentTermDocs.java     (working copy)
--------------------------
File to patch: 

--------
Meaning, it doesn't know what to do with this diff.  From the looks of it, TestSegmentTermDocs.java
did not get move to the impl directory from the directory it was in.

I'm not sure how to handle this in SVN, but I suspect you have to do a local copy move first.
 Perhaps try applying this patch to a clean checkout to let me know if it works for you. 
Also, perhaps we can collaborate with Doron to write up some benchmarks or to at least make
sure the existing benchmarks are covering this new way.

> Extendable writer and reader of field data
> ------------------------------------------
>
>                 Key: LUCENE-662
>                 URL: https://issues.apache.org/jira/browse/LUCENE-662
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Store
>            Reporter: Nicolas Lalevée
>            Priority: Minor
>         Attachments: entrytable.patch, generic-fieldIO-2.patch, generic-fieldIO-3.patch,
generic-fieldIO-4.patch, generic-fieldIO-5.patch, generic-fieldIO.patch, indexFormat.patch
>
>
> As discussed on the dev mailing list, I have modified Lucene to allow to define how the
data of a field is writen and read in the index.
> Basically, I have introduced the notion of IndexFormat. It is in fact a factory of FieldsWriter
and FieldsReader. So the IndexReader, the indexWriter and the SegmentMerger are using this
factory and not doing a "new FieldsReader/Writer()".
> I have also introduced the notion of FieldData. It handles every data of a field, and
also the writing and the reading in a stream. I have done this way because in the current
design of Lucene, Fiedable is an interface, so methods with a protected or package visibility
cannot be defined.
> A FieldsWriter just writes data into a stream via the FieldData of the field.
> A FieldsReader instanciates a FieldData depending on the field name. Then it use the
field data to read the stream. And finnaly it instanciates a Field with the field data.
> About compatibility, I think it is kept, as I have writen a DefaultIndexFormat that provides
some DefaultFieldsWriter and DefaultFieldsReader. These implementations do the exact job that
is done today.
> To acheive this modification, some classes and methods had to be moved from private and/or
final to public or protected.
> About the lazy fields, I have implemented them in a more general way in the implementation
of the abstract class FieldData, so it will be totally transparent for the Lucene user that
will extends FieldData. The stream is kept in the fieldData and used as soon as the stringValue
(or something else) is called. Implementing this way allowed me to handle the recently introduced
LOAD_FOR_MERGE; it is just a lazy field data, and when read() is called on this lazy field
data, the saved input stream is directly copied in the output stream.
> I have a last issue with this patch. The current design allow to read an index in an
old format, and just do a writer.addIndexes() into a new format. With the new design, you
cannot, because the writer will use the FieldData.write provided by the reader.
> enjoy !

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


Mime
View raw message