lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grant Ingersoll <gsing...@syr.edu>
Subject Re: Lazy Field Loading
Date Fri, 31 Mar 2006 12:21:19 GMT
OK, how about a vote on this.

I see several ways of implementing the front end to this:

1. Declarative:  On construction of a Document, you declare the Field to 
be Lazy.

2. Implicit:  All fields are Lazy

3. Size of Field.  Pass into IndexReader.document() the size of the 
field above which it will be lazily loaded.  A default size can also be 
used.

4.  By Field name.  Pass in the names of the Fields that you want loaded 
lazily.

Thanks,
Grant

Doug Cutting wrote:
> Grant Ingersoll wrote:
>> My main concern is the semantics of the fieldsStream and whether that 
>> would be closed behind the back of the LazyField implementation.  My 
>> understanding is that as long as the IndexReader is open, this stream 
>> should also be open.  Is that correct?   What am I forgetting about?
>
> You need to make sure that access to the stream is synchronized, so 
> that one thread doesn't move the file pointer while someone else is 
> reading.  You could use a cloned stream in a ThreadLocal to avoid 
> contention.
>
> Doug
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>
>

-- 

Grant Ingersoll 
Sr. Software Engineer 
Center for Natural Language Processing 
Syracuse University 
School of Information Studies 
335 Hinds Hall 
Syracuse, NY 13244 

http://www.cnlp.org 
Voice:  315-443-5484 
Fax: 315-443-6886 


---------------------------------------------------------------------
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