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

Karthick Sankarachary commented on LUCENE-2453:
-----------------------------------------------

Hi Shai,

To answer your comments:

    *  buffer can still be final (and should) since it's only initialized in 
the ctor

[K] Agreed. It's not like we want to allow the size of the buffer to be changed 
once it has been instantiated.

    * I'd inline checkBufferSize in the ctor

[K] Done. Again, we only need to check the buffer size one time in the ctor.

    * I think that adding the same level of control to BufferedIndexInput would 
be useful too?

[K] Actually, the BufferedIndexInput already allows this level of control, and 
then some. In fact, I plagiarized the #checkBufferSize method from that class, 
where it is used twice, once in the ctor, and then again in the #setBufferSize 
method. In theory, we could allow the size of the BufferedIndexOutput's buffer 
to be reset as well, but in case the buffer is made smaller, we'll have to take 
care to flush some of the "older" bytes that no longer fit in the buffer. IMO, 
that was not worth the risk and hassle.

I will update the patch momentarily based on the comments above, and keep you 
posted on the benchmark results.

Regards,
Karthick 

> Make Index Output Buffer Size Configurable
> ------------------------------------------
>
>                 Key: LUCENE-2453
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2453
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Store
>    Affects Versions: 3.0.1
>            Reporter: Karthick Sankarachary
>         Attachments: LUCENE-2453.patch
>
>
> Currently, the buffered index input class allows sub-classes and users 
> thereof to specify a size for the input buffer, which by default is 1024 
> bytes. In practice, this option is leveraged by the simple file and compound 
> segment index input sub-classes. 
> By the same token, it would be nice if the buffered index output class could 
> open up it's buffer size for users to configure. In particular, this would 
> allow sub-classes thereof to align the output buffer size, which by default 
> is 16348 bytes, to that of the underlying directory's data unit. For example, 
> a network-based directory might want to buffer data in multiples of it's 
> maximum transmission unit. To use an existing use-case, the file system-based 
> directory could potentially choose to align it's output buffer size to the 
> operating system's file block size.
> The proposed change to the buffered index output class involves defining a 
> one-arg constructor that takes a user-defined buffer size, and a default 
> constructor that uses the currently defined buffer size.

-- 
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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to