lucene-dev mailing list archives

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

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
(called
PersistentMap) backed by an on-disk BTree (jdbm) and it uses a bounded
amount of RAM:

http://www.tropo.com/techno/java/jdbm/


-----Original Message-----
From: Materna, Wolf-Dietrich (empolis B)
[mailto:Wolf-Dietrich.Materna@empolis.com]
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
library
that
> > 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
bad
solution.
Note that iterators are suitable for very large collections of elements
containing
all terms or documents in a index, but the number of fields is always
small.
That means
you can't compare both cases. You will restrict only the benefit of your
function and make 
some things harder.
Regards,
	Wolf-Dietrich

--
To unsubscribe, e-mail:
<mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:lucene-dev-help@jakarta.apache.org>



--
To unsubscribe, e-mail:   <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>


Mime
View raw message