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

ASF subversion and git services commented on LUCENE-9264:
---------------------------------------------------------

Commit 624f5a3c2f5ab25a44b3e3843dbef36d4ed70602 in lucene-solr's branch 
refs/heads/master from Robert Muir
[ https://gitbox.apache.org/repos/asf?p=lucene-solr.git;h=624f5a3 ]

LUCENE-9264: Remove SimpleFSDirectory in favor of NIOFSDirectory

Closes #1321


> Remove SimpleFSDirectory in favor of NIOFsDirectory
> ---------------------------------------------------
>
>                 Key: LUCENE-9264
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9264
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Yannick Welsch
>            Priority: Minor
>             Fix For: master (9.0)
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> {{SimpleFSDirectory}} looks to duplicate what's already offered by 
> {{NIOFsDirectory}}. The only difference is that {{SimpleFSDirectory}} is 
> using non-positional reads on the {{FileChannel}} (i.e., reads that are 
> stateful, changing the current position), and {{SimpleFSDirectory}} therefore 
> has to externally synchronize access to the read method.
> On Windows, positional reads are not supported, which is why {{FileChannel}} 
> is already internally using synchronization to guarantee only access by one 
> thread at a time for positional reads (see {{read(ByteBuffer dst, long 
> position)}} in {{FileChannelImpl}}, and {{FileDispatcher.needsPositionLock}}, 
> which returns true on Windows) and the JDK implementation for Windows is 
> emulating positional reads by using non-positional ones, see 
> [http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/windows/native/sun/nio/ch/FileDispatcherImpl.c#l139].
> This means that on Windows, there should be no difference between 
> {{NIOFsDirectory}} and {{SimpleFSDirectory}} in terms of performance (it 
> should be equally poor as both implementations only allow one thread at a 
> time to read). On Linux/Mac, {{NIOFsDirectory}} is superior to 
> {{SimpleFSDirectory}}, however, as positional reads (pread) can be done 
> concurrently.
> My proposal is to remove {{SimpleFSDirectory}} and replace its uses with 
> {{NIOFsDirectory}}, given how similar these two directory implementations are 
> ({{SimpleFSDirectory}} isn't really simpler).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to