[
https://issues.apache.org/jira/browse/LUCENE-4848?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13609242#comment-13609242
]
Uwe Schindler commented on LUCENE-4848:
---------------------------------------
I finally did some tests before committing:
- It is possible with NIOFSDirectory to open an IndexReader and after that
remove all files in Windows. The IndexReader is still working as it should.
This mimics POSIX behaviour, so Lucene can get rid of files earlier when NIOFS
is used.
- With MMapDirectory, the file channel also has delete allowed, but the windows
documentation explicitly says:
http://msdn.microsoft.com/en-us/library/aa363915%28v=VS.85%29.aspx that mmapped
files cannot be deleted (the documentation is a bit unclear, but the "OR"
states both possibilities):
{quote}
The DeleteFile function fails if an application attempts to delete a file that
has other handles open for normal I/O or as a memory-mapped file
(FILE_SHARE_DELETE must have been specified when other handles were opened).
The DeleteFile function marks a file for deletion on close. Therefore, the file
deletion does not occur until the last handle to the file is closed. Subsequent
calls to CreateFile to open the file fail with ERROR_ACCESS_DENIED.
{quote}
I will commit this now.
> Fix Directory implementations to use NIO2 APIs
> ----------------------------------------------
>
> Key: LUCENE-4848
> URL: https://issues.apache.org/jira/browse/LUCENE-4848
> Project: Lucene - Core
> Issue Type: Task
> Affects Versions: 5.0
> Reporter: Michael Poindexter
> Assignee: Uwe Schindler
> Priority: Minor
> Fix For: 5.0
>
> Attachments: jdk7directory.zip, LUCENE-4848-MMapDirectory.patch,
> LUCENE-4848.patch, LUCENE-4848.patch, LUCENE-4848.patch, LUCENE-4848.patch,
> LUCENE-4848.patch, LUCENE-4848.patch, LUCENE-4848.patch, LUCENE-4848.patch,
> LUCENE-4848.patch.txt
>
>
> I have implemented 3 Directory subclasses using NIO2 API's (available on
> JDK7). These may be suitable for inclusion in a Lucene contrib module.
> See the mailing list at http://lucene.markmail.org/thread/lrv7miivzmjm3ml5
> for more details about this code and the advantages it provides.
> The code is attached as a zip to this issue. I'll be happy to make any
> changes requested. I've included some minimal smoke tests, but any help in
> how to use the normal Lucene tests to perform more thorough testing would be
> appreciated.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]