[pylucene-dev] FSDirectory/MMapDirectory.getDirectory()
single-argument wrapping bug?
Andi Vajda
vajda at osafoundation.org
Wed May 23 10:25:40 PDT 2007
On Wed, 23 May 2007, Aaron Lav wrote:
> I'm having trouble with the single-argument getDirectory(path) forms
> for FSDirectory/MMapDirectory: the attached test_getDirectory.py code
> gives an InvalidArgsError.
>
> The attached patch (getDirectory.diff) seems to fix things for me.
Indeed, there was a typo in the one-arg pattern for FSDirectory.getDirectory().
I just checked in a fix for that. Thanks for the patch.
> (I was briefly confused by MMapDirectory.getDirectory returning a
> FSDirectory, so I included an explanatory comment.)
As for MMapDirectory, I checked the Lucene sources and it actually doesn't
have a getDirectory() method at all (or I missed it). The comments say that
in order to create an MMapDirectory via getDirectory(), the
'org.apache.lucene.FSDirectory.class' property needs to be set to the
MMapDirectory class name 'org.apache.lucene.store.MMapDirectory'.
Checking the FSDirectory sources confirms this. The actual class instantiated
is FSDirectory or whatever is set in that property.
I therefore removed the MMapDirectory.getDirectory() implementation
completely. It still inherits the FSDirectory one, of course.
Andi..
More information about the pylucene-dev
mailing list