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

ASF GitHub Bot commented on KAFKA-5841:
---------------------------------------

GitHub user huxihx opened a pull request:

    https://github.com/apache/kafka/pull/3798

    KAFKA-5841: AbstractIndex should offer `makeReadOnly` method

    AbstractIndex should offer `makeReadOnly` method that changed the 
underlying MappedByteBuffer read-only.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/huxihx/kafka KAFKA-5841

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/kafka/pull/3798.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #3798
    
----
commit a2d97ff6c814368ac7e7eadc63569de36d3965af
Author: huxihx <huxi...@hotmail.com>
Date:   2017-09-06T06:48:54Z

    KAFKA-5841: AbstractIndex should offer `makeReadOnly` method as mentioned 
in comments

----


> Open old index files with read-only permission
> ----------------------------------------------
>
>                 Key: KAFKA-5841
>                 URL: https://issues.apache.org/jira/browse/KAFKA-5841
>             Project: Kafka
>          Issue Type: Improvement
>            Reporter: Jason Gustafson
>            Assignee: huxihx
>
> Since old index files do not change, we may as well drop the write permission 
> needed when opening them. From the doc comments in {{OffsetIndex}}, it sounds 
> like we may have had this implemented at one point:
> {code}
>  * Index files can be opened in two ways: either as an empty, mutable index 
> that allows appends or
>  * an immutable read-only index file that has previously been populated. The 
> makeReadOnly method will turn a mutable file into an 
>  * immutable one and truncate off any extra bytes. This is done when the 
> index file is rolled over.
> {code}
> So we should either support this or (if there is good reason not to) update 
> the comment.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to