Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Which type of Lucene directory does Confluence use?

Sergey Svishchev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 5, 2013

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

1 vote
Answer accepted
Adrien Ragot 2
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 22, 2014

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events