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

Uwe Schindler edited comment on LUCENE-5946 at 9/14/14 2:12 PM:
----------------------------------------------------------------

{quote}
By the way: why did NIO use 16384 bytes bufsize instead of the default 8192? In 
my opinion we should consequently use 8 KiB, especially if we do heavy random 
access like docvalues.
But this is another discussion for another issue.
{quote}

We no longer use RAF here, so the malloc "bug" in the JVM does not apply. So 
16384 is a good choice here, too (was extensively tested for NIOFSDir)! We 
should just not make the buffer larger, because NIO internally has a pool of 
DirectBuffers to handle the actual disk I/O.

In addition, this is unrelated to the actual buffer size. This is just the 
*maximum* to read as chunk if some code requests megabytes of data. The 
BufferedIndexInput buffering is unrelated, so most reads (like docvalues) use 
much smaller buffers.


was (Author: thetaphi):
{quote}
By the way: why did NIO use 16384 bytes bufsize instead of the default 8192? In 
my opinion we should consequently use 8 KiB, especially if we do heavy random 
access like docvalues.
But this is another discussion for another issue.
{quote}

We no longer use RAF here, so the malloc "bug" in the JVM does not apply. So 
16384 is a good choice here, too (was extensively tested for NIOFSDir)! We 
should just not make the buffer larger, because NIO internally has a pool of 
DirectBuffers to handle the actual disk I/O.

> Change SimpleFSDirectory to use newByteChannel
> ----------------------------------------------
>
>                 Key: LUCENE-5946
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5946
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Robert Muir
>         Attachments: LUCENE-5946.patch
>
>
> Currently our javadocs point to using SimpleFSDirectory "to avoid 
> ClosedByInterruptException".
> But this is really bogus. If you interrupt() a thread doing i/o, then you 
> need to be prepared for the consequences. Its just that RAF is broken and not 
> interruptible at all, but that shouldnt justify us continuing to use it.
> SimpleFSDirectory should be "the most portable", so it should use 
> Files.newByteChannel. And we should remove the javadocs/warnings about 
> ClosedByInterrupt



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to