lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley" <ysee...@gmail.com>
Subject Re: VInt's as prefix. Was: bytecount as prefix
Date Thu, 11 May 2006 16:02:27 GMT
On 5/11/06, Marvin Humphrey <marvin@rectangular.com> wrote:
> Maybe we should consider loading differing subclasses of IndexInput/
> IndexOutput based on the detected file format version?  If this were
> C, I'd use function pointers.  What's the best way to approximate
> that in Java?

Nothing but subclassing.

There are already different subclasses of IndexInput and IndexOutput.
The problem is, there are already 7 implementations of IndexInput, so
one would need to create 7 more implementations with different
readVInt() for example.

You could perhaps decouple and factor out part of the functionality
into a VIntReader and VIntWriter, for example, but readVInt() is
called *so* often, I'd be pretty afraid of the performance
implications.  1.5 HotSpot might be able to handle it... but then
there are people who need to use -client, people stuck on Java1.4,
etc.

-Yonik
http://incubator.apache.org/solr Solr, the open-source Lucene search server

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