On 5/11/06, Marvin Humphrey <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]