Which type of Lucene directory does Confluence use?

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.

1 answer

1 accepted

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

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Friday in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

278 views 11 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you