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

Uwe Schindler commented on LUCENE-1658:
---------------------------------------

I am not so happy :), but I work on it.

Currently my problem is more a failure for the test in LUCENE-1453. After 
reopening a DirectoryIndexReader, sometimes (not always) the directory is 
closed, even when
This failure depends on the random seed in testFSDirectoryReopen2() and is 
reproducible also with the current version of FSDirectory. It seems that 1453 
is not completely fixed. I am looking now since 5 hourcs and cannot find the 
error, the code consists of a lot of printlns and so on. :(

When I found out, what the problem is, I will perhaps open an additional issue, 
but it seems, that the problem has to do with the FSDirectory changes. 
Somewhere the directory is closed, although it should be stay open. But what I 
can say: The error is simplier to reproduce, if the directory is not cached!

I have a lot of other fixes for the failing tests on some platforms, I will 
post a revised patch some time with getDirectory deprecated and open() again.

One thing: For investigating this bug, I changed the IndexReader.open() methods 
to use a non-cached directory. I think we should do this in the final version, 
too (also for Indexwriter). So also replace FSDir.getDirectory() by open for 
all these ctors and opens() that get a String with the index directory. If we 
do not want to do this, I suggest to deprecate all these methods and tell the 
user to open the directory themselfes and pass Directory instances to 
Writer/Reader. This would help cleaning up the code immense later, because we 
can remove all these closeDirectory checks/pass-throughs everywhere, which are 
silly... This makes the code completely not-understandable. In my opinion, one 
should open/close the directory himself and close it after usage.

> 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