[ 
https://issues.apache.org/jira/browse/LUCENE-4848?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Uwe Schindler updated LUCENE-4848:
----------------------------------

    Attachment: LUCENE-4848-MMapDirectory.patch

For demonstartation puposes, I attached the simple patch for MMapDirectory that 
uses the new StandardOpenMode and FileChannel.open() provided by Java 7. I did 
not yet really test the deletion of open files on windows, but all tests pass 
(as they should).

It would also be interesting if this patch maybe solves the 
ClosedChannelException problem on interrupt? The time window in MMap is very 
short that the bug can happen (only after opening the channel, while mmap is 
doing its work before the channel is closed).

As you see, the Path API of Java 7 is not yet exposed to the public API. The 
whole code is still working with java.io.File, only when opening the channel it 
calls File.toPath(). 

Michael Poindexter: We should do the same and *no* other changes in NIO. Just 
move away from RAF and use FileChannel.
                
> Add Directory implementations using NIO2 APIs
> ---------------------------------------------
>
>                 Key: LUCENE-4848
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4848
>             Project: Lucene - Core
>          Issue Type: Task
>            Reporter: Michael Poindexter
>            Assignee: Uwe Schindler
>            Priority: Minor
>         Attachments: jdk7directory.zip, LUCENE-4848-MMapDirectory.patch
>
>
> 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]

Reply via email to