lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley" <>
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 <> 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,

-Yonik Solr, the open-source Lucene search server

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

View raw message