[ 
https://issues.apache.org/jira/browse/LUCENE-1658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12714851#action_12714851
 ] 

Michael McCandless commented on LUCENE-1658:
--------------------------------------------

bq. I am currently playing with this. For the end-user it is not really needed, 
that directories are cached. Even if he gets a directory that it is cached, he 
can see it as a alone one. he can close it (because of refcounting and so on) 
and do everything, he can do with a single directory, too.

The original purpose of the cache was to ensure each unique  directory in the 
filesystem alway mapped to a single instance of FSDir, so that you could 
synchronize on that instance and be certain that this is equivalent to 
synchronizing access to that underlying filesystem directory.

Lucene had relied on this at one point, but no longer does.  I'm not sure if 
any apps out there still rely on this, so it's dangerous to simply remove it, 
especially when we have another option (using a new method "open") that won't 
break such apps.

bq. More, the mixing of cached and uncached dirs bring more problems (I am 
currently investigating).

We should get to the bottom of this, but these problems are pre-existing to 
this issue, right?  (One could already directly instantiate each directory).

bq. The move from FSDir to SimpleFSDir is more complicated than it seems. In my 
opinion, it would be a question, if this move should wait until 3.0.

As long as we preserve the old getDirectory, back-compatible, this change 
should have no impact on back-compatibility.

Ie, it's only if you use the new FSDir.open() API that you get the new 
behavior.  I intentionally went and fixed tests to use FSDir.open so that we 
stress the new functionality, which then led us to discover tests making 
invalid assumptions, which we should then fix.

> Absorb NIOFSDirectory into FSDirectory
> --------------------------------------
>
>                 Key: LUCENE-1658
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1658
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Store
>            Reporter: Michael McCandless
>            Assignee: Uwe Schindler
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: LUCENE-1658-take2.patch, LUCENE-1658-take2.patch, 
> LUCENE-1658.patch, LUCENE-1658.patch, LUCENE-1658.patch
>
>
> I think whether one uses java.io.* vs java.nio.* or eventually
> java.nio2.*, or some other means, is an under-the-hood implementation
> detail of FSDirectory and doesn't merit a whole separate class.
> I think FSDirectory should be the core class one uses when one's index
> is in the filesystem.
> So, I'd like to deprecate NIOFSDirectory, absorbing it into
> FSDirectory, and add a setting "useNIO" to FSDirectory.  It should
> default to "true" for non-Windows OSs, because it gives far better
> concurrent performance on all platforms but Windows (due to known Sun
> JRE issue http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6265734).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-dev-h...@lucene.apache.org

Reply via email to