Lucene supports several types (MMapDirectory, NIOFSDirectory, SimpleFSDirectory) -- which one is used by Confluence 5?
I suspect that it's SimpleFSDirectory before 5.2 and whatever is autodetected by Lucene in 5.2 and newer, but a confirmation from dev team would be nice.
Hi Sergey,
Short answer: You're right, it uses whatever is detected by Lucene in Confluence 5.3.
You can download the source of Confluence, as soon as you've purchased at least a $10 license. I searched in the code and I found the following snippet in DirectoryUtil (Confluence 5.3):
/** * get a Directory from a path and don't throw a whingy bloody IOException. * Upgrade the index version if incompatible with the current version. */ public static Directory getDirectory(File path) { try { if (!path.exists() && !path.mkdir()) { throw new IOException("Unable to create index directory '" + path.getAbsolutePath() + "'"); } FSDirectory directory = FSDirectory.open(path); return directory; } catch (IOException e) { throw new LuceneException(e); } }
According the the JavaDoc of FSDirectory, as you wrote properly: open() will "allow Lucene to choose the best FSDirectory implementation given your environment". This snippet is then used in classes such as "DefaultEdgeQueries" and so on. I think the best solution for you is to look at the code directly. For sure, none of the 3 names you mention appear in the source of Confluence 5.3.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.