lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Spencer, Dave" <>
Subject RE: getAllFieldNames diffs
Date Wed, 13 Nov 2002 17:44:19 GMT
re: "Note that iterators are suitable for very large collections of

I think you're implying that Set/Collection is not suitable for a large
collection but I don't think that is apriori true. The Set doesn't have
to be stored in memory - it could just lazily fetch values as you call
methods in it, thus I think Set/Collection could be used to represent
data sets of "infinite" size. As an existence proof I wrote a Map
PersistentMap) backed by an on-disk BTree (jdbm) and it uses a bounded
amount of RAM:

-----Original Message-----
From: Materna, Wolf-Dietrich (empolis B)
Sent: Wednesday, November 13, 2002 1:14 AM
To: 'Lucene Developers List'
Subject: AW: getAllFieldNames diffs

[Clemens Marschner]
> > Instead of returning Object[] or Collection I would 
> > consider returning an
> > iterator. Iterators may be designed data-driven, that is, temporary
> > objects are only created when next() is called and not at the time 
> > the method is called. There are powerful frameworks like the XXL
> > extensively use iterators to implement cursors efficiently
> >
> > Finally Iterators are supposed to be the standard mechanism 
> > to returning collections in Java, aren't they?

[Peter Mularien] 
> Your reasoning is logical, and it fits in nicely with many of 
> the existing API calls returning Enumeration.
Sorry, but I don't agree.
Iterators and enumations doesn't support serveral useful operations, for
instance get 
the number of elements. You have to loop over all elements, which is a
Note that iterators are suitable for very large collections of elements
all terms or documents in a index, but the number of fields is always
That means
you can't compare both cases. You will restrict only the benefit of your
function and make 
some things harder.

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message